From 7657ca5326c440699fdb8897a49d9708fba986d1 Mon Sep 17 00:00:00 2001 From: stack72 Date: Mon, 12 Oct 2020 14:43:24 +0100 Subject: [PATCH] Upgrade to v3.1.0 of the GitHub Terraform Provider --- CHANGELOG.md | 1 + .../cmd/pulumi-resource-github/schema.json | 223 ++++---- provider/go.mod | 2 +- provider/go.sum | 4 + sdk/dotnet/BranchProtection.cs | 213 +++---- ...rotectionRequiredPullRequestReviewArgs.cs} | 25 +- ...ectionRequiredPullRequestReviewGetArgs.cs} | 25 +- ...ranchProtectionRequiredStatusCheckArgs.cs} | 7 +- ...chProtectionRequiredStatusCheckGetArgs.cs} | 7 +- .../BranchProtectionRestrictionsArgs.cs | 43 -- .../BranchProtectionRestrictionsGetArgs.cs | 43 -- ...nchProtectionRequiredPullRequestReview.cs} | 18 +- ...=> BranchProtectionRequiredStatusCheck.cs} | 8 +- .../Outputs/BranchProtectionRestrictions.cs | 33 -- sdk/dotnet/Repository.cs | 36 ++ sdk/dotnet/RepositoryFile.cs | 33 +- sdk/go/github/branchProtection.go | 93 ++- sdk/go/github/pulumiTypes.go | 533 ++++-------------- sdk/go/github/repository.go | 20 + sdk/go/github/repositoryFile.go | 29 +- sdk/nodejs/branchProtection.ts | 135 ++--- sdk/nodejs/repository.ts | 28 + sdk/nodejs/repositoryFile.ts | 26 +- sdk/nodejs/types/input.ts | 21 +- sdk/nodejs/types/output.ts | 21 +- sdk/python/pulumi_github/_inputs.py | 110 +--- sdk/python/pulumi_github/_tables.py | 10 + sdk/python/pulumi_github/branch_protection.py | 143 ++--- sdk/python/pulumi_github/outputs.py | 77 +-- sdk/python/pulumi_github/repository.py | 30 +- sdk/python/pulumi_github/repository_file.py | 26 +- 31 files changed, 727 insertions(+), 1296 deletions(-) rename sdk/dotnet/Inputs/{BranchProtectionRequiredPullRequestReviewsArgs.cs => BranchProtectionRequiredPullRequestReviewArgs.cs} (52%) rename sdk/dotnet/Inputs/{BranchProtectionRequiredPullRequestReviewsGetArgs.cs => BranchProtectionRequiredPullRequestReviewGetArgs.cs} (52%) rename sdk/dotnet/Inputs/{BranchProtectionRequiredStatusChecksArgs.cs => BranchProtectionRequiredStatusCheckArgs.cs} (75%) rename sdk/dotnet/Inputs/{BranchProtectionRequiredStatusChecksGetArgs.cs => BranchProtectionRequiredStatusCheckGetArgs.cs} (74%) delete mode 100644 sdk/dotnet/Inputs/BranchProtectionRestrictionsArgs.cs delete mode 100644 sdk/dotnet/Inputs/BranchProtectionRestrictionsGetArgs.cs rename sdk/dotnet/Outputs/{BranchProtectionRequiredPullRequestReviews.cs => BranchProtectionRequiredPullRequestReview.cs} (66%) rename sdk/dotnet/Outputs/{BranchProtectionRequiredStatusChecks.cs => BranchProtectionRequiredStatusCheck.cs} (73%) delete mode 100644 sdk/dotnet/Outputs/BranchProtectionRestrictions.cs diff --git a/CHANGELOG.md b/CHANGELOG.md index c189b876..5d6765b1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ CHANGELOG ========= ## HEAD (Unreleased) +* Upgrade to v3.1.0 of the GitHub Terraform Provider * Upgrade to pulumi-terraform-bridge v2.8.0 * Upgrade to Pulumi v2.10.0 diff --git a/provider/cmd/pulumi-resource-github/schema.json b/provider/cmd/pulumi-resource-github/schema.json index a20961ca..302f43d4 100644 --- a/provider/cmd/pulumi-resource-github/schema.json +++ b/provider/cmd/pulumi-resource-github/schema.json @@ -53,7 +53,7 @@ } }, "types": { - "github:/BranchProtectionRequiredPullRequestReviews:BranchProtectionRequiredPullRequestReviews": { + "github:/BranchProtectionRequiredPullRequestReview:BranchProtectionRequiredPullRequestReview": { "properties": { "dismissStaleReviews": { "type": "boolean", @@ -63,7 +63,7 @@ } } }, - "dismissalTeams": { + "dismissalRestrictions": { "type": "array", "items": { "type": "string" @@ -74,26 +74,6 @@ } } }, - "dismissalUsers": { - "type": "array", - "items": { - "type": "string" - }, - "language": { - "python": { - "mapCase": false - } - } - }, - "includeAdmins": { - "type": "boolean", - "deprecationMessage": "Use enforce_admins instead", - "language": { - "python": { - "mapCase": false - } - } - }, "requireCodeOwnerReviews": { "type": "boolean", "language": { @@ -113,7 +93,7 @@ }, "type": "object" }, - "github:/BranchProtectionRequiredStatusChecks:BranchProtectionRequiredStatusChecks": { + "github:/BranchProtectionRequiredStatusCheck:BranchProtectionRequiredStatusCheck": { "properties": { "contexts": { "type": "array", @@ -126,15 +106,6 @@ } } }, - "includeAdmins": { - "type": "boolean", - "deprecationMessage": "Use enforce_admins instead", - "language": { - "python": { - "mapCase": false - } - } - }, "strict": { "type": "boolean", "language": { @@ -146,44 +117,6 @@ }, "type": "object" }, - "github:/BranchProtectionRestrictions:BranchProtectionRestrictions": { - "properties": { - "apps": { - "type": "array", - "items": { - "type": "string" - }, - "language": { - "python": { - "mapCase": false - } - } - }, - "teams": { - "type": "array", - "items": { - "type": "string" - }, - "language": { - "python": { - "mapCase": false - } - } - }, - "users": { - "type": "array", - "items": { - "type": "string" - }, - "language": { - "python": { - "mapCase": false - } - } - } - }, - "type": "object" - }, "github:/OrganizationWebhookConfiguration:OrganizationWebhookConfiguration": { "properties": { "contentType": { @@ -774,112 +707,132 @@ } }, "github:index/branchProtection:BranchProtection": { - "description": "Protects a GitHub branch.\n\nThis resource allows you to configure branch protection for repositories in your organization. When applied, the branch will be protected from forced pushes and deletion. Additional constraints, such as required status checks or restrictions on users, teams, and apps, can also be configured.\n\n{{% examples %}}\n## Example Usage\n{{% example %}}\n\n```typescript\nimport * as pulumi from \"@pulumi/pulumi\";\nimport * as github from \"@pulumi/github\";\n\nconst exampleTeam = new github.Team(\"example\", {});\n// Protect the master branch of the foo repository. Additionally, require that\n// the \"ci/travis\" context to be passing and only allow the engineers team merge\n// to the branch.\nconst exampleBranchProtection = new github.BranchProtection(\"example\", {\n branch: \"master\",\n enforceAdmins: true,\n repository: github_repository_example.name,\n requiredPullRequestReviews: {\n dismissStaleReviews: true,\n dismissalTeams: [\n exampleTeam.slug,\n github_team_second.slug,\n ],\n dismissalUsers: [\"foo-user\"],\n },\n requiredStatusChecks: {\n contexts: [\"ci/travis\"],\n strict: false,\n },\n restrictions: {\n apps: [\"foo-app\"],\n teams: [exampleTeam.slug],\n users: [\"foo-user\"],\n },\n});\nconst exampleTeamRepository = new github.TeamRepository(\"example\", {\n permission: \"pull\",\n repository: github_repository_example.name,\n teamId: exampleTeam.id,\n});\n```\n```python\nimport pulumi\nimport pulumi_github as github\n\nexample_team = github.Team(\"exampleTeam\")\n# Protect the master branch of the foo repository. Additionally, require that\n# the \"ci/travis\" context to be passing and only allow the engineers team merge\n# to the branch.\nexample_branch_protection = github.BranchProtection(\"exampleBranchProtection\",\n branch=\"master\",\n enforce_admins=True,\n repository=github_repository[\"example\"][\"name\"],\n required_pull_request_reviews=github.BranchProtectionRequiredPullRequestReviewsArgs(\n dismiss_stale_reviews=True,\n dismissal_teams=[\n example_team.slug,\n github_team[\"second\"][\"slug\"],\n ],\n dismissal_users=[\"foo-user\"],\n ),\n required_status_checks=github.BranchProtectionRequiredStatusChecksArgs(\n contexts=[\"ci/travis\"],\n strict=False,\n ),\n restrictions=github.BranchProtectionRestrictionsArgs(\n apps=[\"foo-app\"],\n teams=[example_team.slug],\n users=[\"foo-user\"],\n ))\nexample_team_repository = github.TeamRepository(\"exampleTeamRepository\",\n permission=\"pull\",\n repository=github_repository[\"example\"][\"name\"],\n team_id=example_team.id)\n```\n```csharp\nusing Pulumi;\nusing Github = Pulumi.Github;\n\nclass MyStack : Stack\n{\n public MyStack()\n {\n var exampleTeam = new Github.Team(\"exampleTeam\", new Github.TeamArgs\n {\n });\n // Protect the master branch of the foo repository. Additionally, require that\n // the \"ci/travis\" context to be passing and only allow the engineers team merge\n // to the branch.\n var exampleBranchProtection = new Github.BranchProtection(\"exampleBranchProtection\", new Github.BranchProtectionArgs\n {\n Branch = \"master\",\n EnforceAdmins = true,\n Repository = github_repository.Example.Name,\n RequiredPullRequestReviews = new Github.Inputs.BranchProtectionRequiredPullRequestReviewsArgs\n {\n DismissStaleReviews = true,\n DismissalTeams = \n {\n exampleTeam.Slug,\n github_team.Second.Slug,\n },\n DismissalUsers = \n {\n \"foo-user\",\n },\n },\n RequiredStatusChecks = new Github.Inputs.BranchProtectionRequiredStatusChecksArgs\n {\n Contexts = \n {\n \"ci/travis\",\n },\n Strict = false,\n },\n Restrictions = new Github.Inputs.BranchProtectionRestrictionsArgs\n {\n Apps = \n {\n \"foo-app\",\n },\n Teams = \n {\n exampleTeam.Slug,\n },\n Users = \n {\n \"foo-user\",\n },\n },\n });\n var exampleTeamRepository = new Github.TeamRepository(\"exampleTeamRepository\", new Github.TeamRepositoryArgs\n {\n Permission = \"pull\",\n Repository = github_repository.Example.Name,\n TeamId = exampleTeam.Id,\n });\n }\n\n}\n```\n{{% /example %}}\n{{% /examples %}}", + "description": "Protects a GitHub branch.\n\nThis resource allows you to configure branch protection for repositories in your organization. When applied, the branch will be protected from forced pushes and deletion. Additional constraints, such as required status checks or restrictions on users, teams, and apps, can also be configured.\n", "properties": { - "branch": { - "type": "string", - "description": "The Git branch to protect.\n" - }, "enforceAdmins": { "type": "boolean", "description": "Boolean, setting this to `true` enforces status checks for repository administrators.\n" }, - "etag": { - "type": "string" + "pattern": { + "type": "string", + "description": "Identifies the protection rule pattern.\n" }, - "repository": { + "pushRestrictions": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The list of actor IDs that may push to the branch.\n" + }, + "repositoryId": { "type": "string", - "description": "The GitHub repository name.\n" + "description": "The repository associated with this branch protection rule.\n" }, "requireSignedCommits": { "type": "boolean", "description": "Boolean, setting this to `true` requires all commits to be signed with GPG.\n" }, "requiredPullRequestReviews": { - "$ref": "#/types/github:/BranchProtectionRequiredPullRequestReviews:BranchProtectionRequiredPullRequestReviews", + "type": "array", + "items": { + "$ref": "#/types/github:/BranchProtectionRequiredPullRequestReview:BranchProtectionRequiredPullRequestReview" + }, "description": "Enforce restrictions for pull request reviews. See Required Pull Request Reviews below for details.\n" }, "requiredStatusChecks": { - "$ref": "#/types/github:/BranchProtectionRequiredStatusChecks:BranchProtectionRequiredStatusChecks", + "type": "array", + "items": { + "$ref": "#/types/github:/BranchProtectionRequiredStatusCheck:BranchProtectionRequiredStatusCheck" + }, "description": "Enforce restrictions for required status checks. See Required Status Checks below for details.\n" - }, - "restrictions": { - "$ref": "#/types/github:/BranchProtectionRestrictions:BranchProtectionRestrictions", - "description": "Enforce restrictions for the users and teams that may push to the branch. See Restrictions below for details.\n" } }, "required": [ - "branch", - "etag", - "repository" + "pattern", + "repositoryId" ], "inputProperties": { - "branch": { - "type": "string", - "description": "The Git branch to protect.\n" - }, "enforceAdmins": { "type": "boolean", "description": "Boolean, setting this to `true` enforces status checks for repository administrators.\n" }, - "repository": { + "pattern": { "type": "string", - "description": "The GitHub repository name.\n" + "description": "Identifies the protection rule pattern.\n" + }, + "pushRestrictions": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The list of actor IDs that may push to the branch.\n" + }, + "repositoryId": { + "type": "string", + "description": "The repository associated with this branch protection rule.\n" }, "requireSignedCommits": { "type": "boolean", "description": "Boolean, setting this to `true` requires all commits to be signed with GPG.\n" }, "requiredPullRequestReviews": { - "$ref": "#/types/github:/BranchProtectionRequiredPullRequestReviews:BranchProtectionRequiredPullRequestReviews", + "type": "array", + "items": { + "$ref": "#/types/github:/BranchProtectionRequiredPullRequestReview:BranchProtectionRequiredPullRequestReview" + }, "description": "Enforce restrictions for pull request reviews. See Required Pull Request Reviews below for details.\n" }, "requiredStatusChecks": { - "$ref": "#/types/github:/BranchProtectionRequiredStatusChecks:BranchProtectionRequiredStatusChecks", + "type": "array", + "items": { + "$ref": "#/types/github:/BranchProtectionRequiredStatusCheck:BranchProtectionRequiredStatusCheck" + }, "description": "Enforce restrictions for required status checks. See Required Status Checks below for details.\n" - }, - "restrictions": { - "$ref": "#/types/github:/BranchProtectionRestrictions:BranchProtectionRestrictions", - "description": "Enforce restrictions for the users and teams that may push to the branch. See Restrictions below for details.\n" } }, "requiredInputs": [ - "branch", - "repository" + "pattern", + "repositoryId" ], "stateInputs": { "description": "Input properties used for looking up and filtering BranchProtection resources.\n", "properties": { - "branch": { - "type": "string", - "description": "The Git branch to protect.\n" - }, "enforceAdmins": { "type": "boolean", "description": "Boolean, setting this to `true` enforces status checks for repository administrators.\n" }, - "etag": { - "type": "string" + "pattern": { + "type": "string", + "description": "Identifies the protection rule pattern.\n" }, - "repository": { + "pushRestrictions": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The list of actor IDs that may push to the branch.\n" + }, + "repositoryId": { "type": "string", - "description": "The GitHub repository name.\n" + "description": "The repository associated with this branch protection rule.\n" }, "requireSignedCommits": { "type": "boolean", "description": "Boolean, setting this to `true` requires all commits to be signed with GPG.\n" }, "requiredPullRequestReviews": { - "$ref": "#/types/github:/BranchProtectionRequiredPullRequestReviews:BranchProtectionRequiredPullRequestReviews", + "type": "array", + "items": { + "$ref": "#/types/github:/BranchProtectionRequiredPullRequestReview:BranchProtectionRequiredPullRequestReview" + }, "description": "Enforce restrictions for pull request reviews. See Required Pull Request Reviews below for details.\n" }, "requiredStatusChecks": { - "$ref": "#/types/github:/BranchProtectionRequiredStatusChecks:BranchProtectionRequiredStatusChecks", + "type": "array", + "items": { + "$ref": "#/types/github:/BranchProtectionRequiredStatusCheck:BranchProtectionRequiredStatusCheck" + }, "description": "Enforce restrictions for required status checks. See Required Status Checks below for details.\n" - }, - "restrictions": { - "$ref": "#/types/github:/BranchProtectionRestrictions:BranchProtectionRestrictions", - "description": "Enforce restrictions for the users and teams that may push to the branch. See Restrictions below for details.\n" } }, "type": "object" @@ -1260,6 +1213,10 @@ "type": "boolean", "description": "Set to `false` to disable squash merges on the repository.\n" }, + "archiveOnDestroy": { + "type": "boolean", + "description": "Set to `true` to archive the repository instead of deleting on destroy.\n" + }, "archived": { "type": "boolean", "description": "Specifies if the repository should be archived. Defaults to `false`. **NOTE** Currently, the API does not support unarchiving.\n" @@ -1365,6 +1322,10 @@ "visibility": { "type": "string", "description": "Can be `public` or `private`. If your organization is associated with an enterprise account using GitHub Enterprise Cloud or GitHub Enterprise Server 2.20+, visibility can also be `internal`. The `visibility` parameter overrides the `private` parameter.\n" + }, + "vulnerabilityAlerts": { + "type": "boolean", + "description": "Set to `true` to enable security alerts for vulnerable dependencies. Enabling requires alerts to be enabled on the owner level. (Note for importing: GitHub enables the alerts on public repos but disables them on private repos by default.) See [GitHub Documentation](https://help.github.com/en/github/managing-security-vulnerabilities/about-security-alerts-for-vulnerable-dependencies) for details.\n" } }, "required": [ @@ -1394,6 +1355,10 @@ "type": "boolean", "description": "Set to `false` to disable squash merges on the repository.\n" }, + "archiveOnDestroy": { + "type": "boolean", + "description": "Set to `true` to archive the repository instead of deleting on destroy.\n" + }, "archived": { "type": "boolean", "description": "Specifies if the repository should be archived. Defaults to `false`. **NOTE** Currently, the API does not support unarchiving.\n" @@ -1469,6 +1434,10 @@ "visibility": { "type": "string", "description": "Can be `public` or `private`. If your organization is associated with an enterprise account using GitHub Enterprise Cloud or GitHub Enterprise Server 2.20+, visibility can also be `internal`. The `visibility` parameter overrides the `private` parameter.\n" + }, + "vulnerabilityAlerts": { + "type": "boolean", + "description": "Set to `true` to enable security alerts for vulnerable dependencies. Enabling requires alerts to be enabled on the owner level. (Note for importing: GitHub enables the alerts on public repos but disables them on private repos by default.) See [GitHub Documentation](https://help.github.com/en/github/managing-security-vulnerabilities/about-security-alerts-for-vulnerable-dependencies) for details.\n" } }, "stateInputs": { @@ -1486,6 +1455,10 @@ "type": "boolean", "description": "Set to `false` to disable squash merges on the repository.\n" }, + "archiveOnDestroy": { + "type": "boolean", + "description": "Set to `true` to archive the repository instead of deleting on destroy.\n" + }, "archived": { "type": "boolean", "description": "Specifies if the repository should be archived. Defaults to `false`. **NOTE** Currently, the API does not support unarchiving.\n" @@ -1591,6 +1564,10 @@ "visibility": { "type": "string", "description": "Can be `public` or `private`. If your organization is associated with an enterprise account using GitHub Enterprise Cloud or GitHub Enterprise Server 2.20+, visibility can also be `internal`. The `visibility` parameter overrides the `private` parameter.\n" + }, + "vulnerabilityAlerts": { + "type": "boolean", + "description": "Set to `true` to enable security alerts for vulnerable dependencies. Enabling requires alerts to be enabled on the owner level. (Note for importing: GitHub enables the alerts on public repos but disables them on private repos by default.) See [GitHub Documentation](https://help.github.com/en/github/managing-security-vulnerabilities/about-security-alerts-for-vulnerable-dependencies) for details.\n" } }, "type": "object" @@ -1741,7 +1718,7 @@ } }, "github:index/repositoryFile:RepositoryFile": { - "description": "This resource allows you to create and manage files within a\nGitHub repository.\n\n\n{{% examples %}}\n## Example Usage\n{{% example %}}\n\n```typescript\nimport * as pulumi from \"@pulumi/pulumi\";\nimport * as github from \"@pulumi/github\";\n\nconst gitignore = new github.RepositoryFile(\"gitignore\", {\n content: \"**/*.tfstate\",\n file: \".gitignore\",\n repository: \"example\",\n});\n```\n```python\nimport pulumi\nimport pulumi_github as github\n\ngitignore = github.RepositoryFile(\"gitignore\",\n content=\"**/*.tfstate\",\n file=\".gitignore\",\n repository=\"example\")\n```\n```csharp\nusing Pulumi;\nusing Github = Pulumi.Github;\n\nclass MyStack : Stack\n{\n public MyStack()\n {\n var gitignore = new Github.RepositoryFile(\"gitignore\", new Github.RepositoryFileArgs\n {\n Content = \"**/*.tfstate\",\n File = \".gitignore\",\n Repository = \"example\",\n });\n }\n\n}\n```\n```go\npackage main\n\nimport (\n\t\"github.com/pulumi/pulumi-github/sdk/v2/go/github\"\n\t\"github.com/pulumi/pulumi/sdk/v2/go/pulumi\"\n)\n\nfunc main() {\n\tpulumi.Run(func(ctx *pulumi.Context) error {\n\t\t_, err := github.NewRepositoryFile(ctx, \"gitignore\", \u0026github.RepositoryFileArgs{\n\t\t\tContent: pulumi.String(\"**/*.tfstate\"),\n\t\t\tFile: pulumi.String(\".gitignore\"),\n\t\t\tRepository: pulumi.String(\"example\"),\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t})\n}\n```\n{{% /example %}}\n{{% /examples %}}", + "description": "This resource allows you to create and manage files within a\nGitHub repository.\n\n\n{{% examples %}}\n## Example Usage\n{{% example %}}\n\n```typescript\nimport * as pulumi from \"@pulumi/pulumi\";\nimport * as github from \"@pulumi/github\";\n\nconst fooRepository = new github.Repository(\"fooRepository\", {autoInit: true});\nconst fooRepositoryFile = new github.RepositoryFile(\"fooRepositoryFile\", {\n repository: fooRepository.name,\n branch: \"main\",\n file: \".gitignore\",\n content: \"**/*.tfstate\",\n commitMessage: \"Managed by Terraform\",\n commitAuthor: \"Terraform User\",\n commitEmail: \"terraform@example.com\",\n overwriteOnCreate: true,\n});\n```\n```python\nimport pulumi\nimport pulumi_github as github\n\nfoo_repository = github.Repository(\"fooRepository\", auto_init=True)\nfoo_repository_file = github.RepositoryFile(\"fooRepositoryFile\",\n repository=foo_repository.name,\n branch=\"main\",\n file=\".gitignore\",\n content=\"**/*.tfstate\",\n commit_message=\"Managed by Terraform\",\n commit_author=\"Terraform User\",\n commit_email=\"terraform@example.com\",\n overwrite_on_create=True)\n```\n```csharp\nusing Pulumi;\nusing Github = Pulumi.Github;\n\nclass MyStack : Stack\n{\n public MyStack()\n {\n var fooRepository = new Github.Repository(\"fooRepository\", new Github.RepositoryArgs\n {\n AutoInit = true,\n });\n var fooRepositoryFile = new Github.RepositoryFile(\"fooRepositoryFile\", new Github.RepositoryFileArgs\n {\n Repository = fooRepository.Name,\n Branch = \"main\",\n File = \".gitignore\",\n Content = \"**/*.tfstate\",\n CommitMessage = \"Managed by Terraform\",\n CommitAuthor = \"Terraform User\",\n CommitEmail = \"terraform@example.com\",\n OverwriteOnCreate = true,\n });\n }\n\n}\n```\n```go\npackage main\n\nimport (\n\t\"github.com/pulumi/pulumi-github/sdk/v2/go/github\"\n\t\"github.com/pulumi/pulumi/sdk/v2/go/pulumi\"\n)\n\nfunc main() {\n\tpulumi.Run(func(ctx *pulumi.Context) error {\n\t\tfooRepository, err := github.NewRepository(ctx, \"fooRepository\", \u0026github.RepositoryArgs{\n\t\t\tAutoInit: pulumi.Bool(true),\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\t_, err = github.NewRepositoryFile(ctx, \"fooRepositoryFile\", \u0026github.RepositoryFileArgs{\n\t\t\tRepository: fooRepository.Name,\n\t\t\tBranch: pulumi.String(\"main\"),\n\t\t\tFile: pulumi.String(\".gitignore\"),\n\t\t\tContent: pulumi.String(\"**/*.tfstate\"),\n\t\t\tCommitMessage: pulumi.String(\"Managed by Terraform\"),\n\t\t\tCommitAuthor: pulumi.String(\"Terraform User\"),\n\t\t\tCommitEmail: pulumi.String(\"terraform@example.com\"),\n\t\t\tOverwriteOnCreate: pulumi.Bool(true),\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t})\n}\n```\n{{% /example %}}\n{{% /examples %}}", "properties": { "branch": { "type": "string", @@ -1767,6 +1744,10 @@ "type": "string", "description": "The path of the file to manage.\n" }, + "overwriteOnCreate": { + "type": "boolean", + "description": "Enable overwriting existing files\n" + }, "repository": { "type": "string", "description": "The repository name\n" @@ -1810,6 +1791,10 @@ "type": "string", "description": "The path of the file to manage.\n" }, + "overwriteOnCreate": { + "type": "boolean", + "description": "Enable overwriting existing files\n" + }, "repository": { "type": "string", "description": "The repository name\n" @@ -1847,6 +1832,10 @@ "type": "string", "description": "The path of the file to manage.\n" }, + "overwriteOnCreate": { + "type": "boolean", + "description": "Enable overwriting existing files\n" + }, "repository": { "type": "string", "description": "The repository name\n" diff --git a/provider/go.mod b/provider/go.mod index 00487805..5a873ce2 100644 --- a/provider/go.mod +++ b/provider/go.mod @@ -8,5 +8,5 @@ require ( github.com/hashicorp/terraform-plugin-sdk v1.9.1 github.com/pulumi/pulumi-terraform-bridge/v2 v2.8.0 github.com/pulumi/pulumi/sdk/v2 v2.10.0 - github.com/terraform-providers/terraform-provider-github v1.3.1-0.20200908195321-ec1ed2e044f6 + github.com/terraform-providers/terraform-provider-github v1.3.1-0.20201012131225-9c532df81939 ) diff --git a/provider/go.sum b/provider/go.sum index 4b2388a6..d8e64e34 100644 --- a/provider/go.sum +++ b/provider/go.sum @@ -321,6 +321,8 @@ github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-github/v31 v31.0.0 h1:JJUxlP9lFK+ziXKimTCprajMApV1ecWD4NB6CCb0plo= github.com/google/go-github/v31 v31.0.0/go.mod h1:NQPZol8/1sMoWYGN2yaALIBytu17gAWfhbweiEed3pM= +github.com/google/go-github/v32 v32.1.0 h1:GWkQOdXqviCPx7Q7Fj+KyPoGm4SwHRh8rheoPhd27II= +github.com/google/go-github/v32 v32.1.0/go.mod h1:rIEpZD9CTDQwDK9GDrtMTycQNA4JU3qBsCizh3q2WCI= github.com/google/go-querystring v1.0.0 h1:Xkwi/a1rcvNg1PPYe5vI8GbeBY/jrVuDX5ASuANWTrk= github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= github.com/google/go-replayers/grpcreplay v0.1.0/go.mod h1:8Ig2Idjpr6gifRd6pNVggX6TC1Zw6Jx74AKp7QNH2QE= @@ -772,6 +774,8 @@ github.com/terraform-providers/terraform-provider-github v1.3.1-0.20200714231544 github.com/terraform-providers/terraform-provider-github v1.3.1-0.20200714231544-91ed9f877a34/go.mod h1:ctVieu3ueVfdSO90MNKKdG2nWo8VVQ8d5b/XfGWJNp4= github.com/terraform-providers/terraform-provider-github v1.3.1-0.20200908195321-ec1ed2e044f6 h1:etKh6zHOyvp43WgoYocuzsRswU+COIED0iF1fmyUDSE= github.com/terraform-providers/terraform-provider-github v1.3.1-0.20200908195321-ec1ed2e044f6/go.mod h1:+AzJdpe92BtK4jgbT02FzNou+rfBJZs1TdEYJQJDn4A= +github.com/terraform-providers/terraform-provider-github v1.3.1-0.20201012131225-9c532df81939 h1:4hpF780kTkJQWY6XuNeWFvWvbLNEtpXP1gcsSTg2QLw= +github.com/terraform-providers/terraform-provider-github v1.3.1-0.20201012131225-9c532df81939/go.mod h1:Ya0FMXPrjKFAfZ6LQP7Ks+n3ss8Y9P2gkstLBzKvcQY= github.com/terraform-providers/terraform-provider-http v1.2.0 h1:pOP/SNlLjB18CydtTJJwzkZGkHYX3LWzIoQpYQuBdyw= github.com/terraform-providers/terraform-provider-http v1.2.0/go.mod h1:2Iot921OkLVSZr8FbIkvRN84ZV3w+oFKb7RlmPTQQAQ= github.com/terraform-providers/terraform-provider-openstack v1.15.0/go.mod h1:2aQ6n/BtChAl1y2S60vebhyJyZXBsuAI5G4+lHrT1Ew= diff --git a/sdk/dotnet/BranchProtection.cs b/sdk/dotnet/BranchProtection.cs index 1fc414b8..14021704 100644 --- a/sdk/dotnet/BranchProtection.cs +++ b/sdk/dotnet/BranchProtection.cs @@ -13,98 +13,32 @@ namespace Pulumi.Github /// Protects a GitHub branch. /// /// This resource allows you to configure branch protection for repositories in your organization. When applied, the branch will be protected from forced pushes and deletion. Additional constraints, such as required status checks or restrictions on users, teams, and apps, can also be configured. - /// - /// ## Example Usage - /// - /// ```csharp - /// using Pulumi; - /// using Github = Pulumi.Github; - /// - /// class MyStack : Stack - /// { - /// public MyStack() - /// { - /// var exampleTeam = new Github.Team("exampleTeam", new Github.TeamArgs - /// { - /// }); - /// // Protect the master branch of the foo repository. Additionally, require that - /// // the "ci/travis" context to be passing and only allow the engineers team merge - /// // to the branch. - /// var exampleBranchProtection = new Github.BranchProtection("exampleBranchProtection", new Github.BranchProtectionArgs - /// { - /// Branch = "master", - /// EnforceAdmins = true, - /// Repository = github_repository.Example.Name, - /// RequiredPullRequestReviews = new Github.Inputs.BranchProtectionRequiredPullRequestReviewsArgs - /// { - /// DismissStaleReviews = true, - /// DismissalTeams = - /// { - /// exampleTeam.Slug, - /// github_team.Second.Slug, - /// }, - /// DismissalUsers = - /// { - /// "foo-user", - /// }, - /// }, - /// RequiredStatusChecks = new Github.Inputs.BranchProtectionRequiredStatusChecksArgs - /// { - /// Contexts = - /// { - /// "ci/travis", - /// }, - /// Strict = false, - /// }, - /// Restrictions = new Github.Inputs.BranchProtectionRestrictionsArgs - /// { - /// Apps = - /// { - /// "foo-app", - /// }, - /// Teams = - /// { - /// exampleTeam.Slug, - /// }, - /// Users = - /// { - /// "foo-user", - /// }, - /// }, - /// }); - /// var exampleTeamRepository = new Github.TeamRepository("exampleTeamRepository", new Github.TeamRepositoryArgs - /// { - /// Permission = "pull", - /// Repository = github_repository.Example.Name, - /// TeamId = exampleTeam.Id, - /// }); - /// } - /// - /// } - /// ``` /// public partial class BranchProtection : Pulumi.CustomResource { - /// - /// The Git branch to protect. - /// - [Output("branch")] - public Output Branch { get; private set; } = null!; - /// /// Boolean, setting this to `true` enforces status checks for repository administrators. /// [Output("enforceAdmins")] public Output EnforceAdmins { get; private set; } = null!; - [Output("etag")] - public Output Etag { get; private set; } = null!; + /// + /// Identifies the protection rule pattern. + /// + [Output("pattern")] + public Output Pattern { get; private set; } = null!; + + /// + /// The list of actor IDs that may push to the branch. + /// + [Output("pushRestrictions")] + public Output> PushRestrictions { get; private set; } = null!; /// - /// The GitHub repository name. + /// The repository associated with this branch protection rule. /// - [Output("repository")] - public Output Repository { get; private set; } = null!; + [Output("repositoryId")] + public Output RepositoryId { get; private set; } = null!; /// /// Boolean, setting this to `true` requires all commits to be signed with GPG. @@ -116,19 +50,13 @@ public partial class BranchProtection : Pulumi.CustomResource /// Enforce restrictions for pull request reviews. See Required Pull Request Reviews below for details. /// [Output("requiredPullRequestReviews")] - public Output RequiredPullRequestReviews { get; private set; } = null!; + public Output> RequiredPullRequestReviews { get; private set; } = null!; /// /// Enforce restrictions for required status checks. See Required Status Checks below for details. /// [Output("requiredStatusChecks")] - public Output RequiredStatusChecks { get; private set; } = null!; - - /// - /// Enforce restrictions for the users and teams that may push to the branch. See Restrictions below for details. - /// - [Output("restrictions")] - public Output Restrictions { get; private set; } = null!; + public Output> RequiredStatusChecks { get; private set; } = null!; /// @@ -176,12 +104,6 @@ public static BranchProtection Get(string name, Input id, BranchProtecti public sealed class BranchProtectionArgs : Pulumi.ResourceArgs { - /// - /// The Git branch to protect. - /// - [Input("branch", required: true)] - public Input Branch { get; set; } = null!; - /// /// Boolean, setting this to `true` enforces status checks for repository administrators. /// @@ -189,10 +111,28 @@ public sealed class BranchProtectionArgs : Pulumi.ResourceArgs public Input? EnforceAdmins { get; set; } /// - /// The GitHub repository name. + /// Identifies the protection rule pattern. /// - [Input("repository", required: true)] - public Input Repository { get; set; } = null!; + [Input("pattern", required: true)] + public Input Pattern { get; set; } = null!; + + [Input("pushRestrictions")] + private InputList? _pushRestrictions; + + /// + /// The list of actor IDs that may push to the branch. + /// + public InputList PushRestrictions + { + get => _pushRestrictions ?? (_pushRestrictions = new InputList()); + set => _pushRestrictions = value; + } + + /// + /// The repository associated with this branch protection rule. + /// + [Input("repositoryId", required: true)] + public Input RepositoryId { get; set; } = null!; /// /// Boolean, setting this to `true` requires all commits to be signed with GPG. @@ -200,23 +140,29 @@ public sealed class BranchProtectionArgs : Pulumi.ResourceArgs [Input("requireSignedCommits")] public Input? RequireSignedCommits { get; set; } - /// - /// Enforce restrictions for pull request reviews. See Required Pull Request Reviews below for details. - /// [Input("requiredPullRequestReviews")] - public Input? RequiredPullRequestReviews { get; set; } + private InputList? _requiredPullRequestReviews; /// - /// Enforce restrictions for required status checks. See Required Status Checks below for details. + /// Enforce restrictions for pull request reviews. See Required Pull Request Reviews below for details. /// + public InputList RequiredPullRequestReviews + { + get => _requiredPullRequestReviews ?? (_requiredPullRequestReviews = new InputList()); + set => _requiredPullRequestReviews = value; + } + [Input("requiredStatusChecks")] - public Input? RequiredStatusChecks { get; set; } + private InputList? _requiredStatusChecks; /// - /// Enforce restrictions for the users and teams that may push to the branch. See Restrictions below for details. + /// Enforce restrictions for required status checks. See Required Status Checks below for details. /// - [Input("restrictions")] - public Input? Restrictions { get; set; } + public InputList RequiredStatusChecks + { + get => _requiredStatusChecks ?? (_requiredStatusChecks = new InputList()); + set => _requiredStatusChecks = value; + } public BranchProtectionArgs() { @@ -225,26 +171,35 @@ public BranchProtectionArgs() public sealed class BranchProtectionState : Pulumi.ResourceArgs { - /// - /// The Git branch to protect. - /// - [Input("branch")] - public Input? Branch { get; set; } - /// /// Boolean, setting this to `true` enforces status checks for repository administrators. /// [Input("enforceAdmins")] public Input? EnforceAdmins { get; set; } - [Input("etag")] - public Input? Etag { get; set; } + /// + /// Identifies the protection rule pattern. + /// + [Input("pattern")] + public Input? Pattern { get; set; } + + [Input("pushRestrictions")] + private InputList? _pushRestrictions; + + /// + /// The list of actor IDs that may push to the branch. + /// + public InputList PushRestrictions + { + get => _pushRestrictions ?? (_pushRestrictions = new InputList()); + set => _pushRestrictions = value; + } /// - /// The GitHub repository name. + /// The repository associated with this branch protection rule. /// - [Input("repository")] - public Input? Repository { get; set; } + [Input("repositoryId")] + public Input? RepositoryId { get; set; } /// /// Boolean, setting this to `true` requires all commits to be signed with GPG. @@ -252,23 +207,29 @@ public sealed class BranchProtectionState : Pulumi.ResourceArgs [Input("requireSignedCommits")] public Input? RequireSignedCommits { get; set; } - /// - /// Enforce restrictions for pull request reviews. See Required Pull Request Reviews below for details. - /// [Input("requiredPullRequestReviews")] - public Input? RequiredPullRequestReviews { get; set; } + private InputList? _requiredPullRequestReviews; /// - /// Enforce restrictions for required status checks. See Required Status Checks below for details. + /// Enforce restrictions for pull request reviews. See Required Pull Request Reviews below for details. /// + public InputList RequiredPullRequestReviews + { + get => _requiredPullRequestReviews ?? (_requiredPullRequestReviews = new InputList()); + set => _requiredPullRequestReviews = value; + } + [Input("requiredStatusChecks")] - public Input? RequiredStatusChecks { get; set; } + private InputList? _requiredStatusChecks; /// - /// Enforce restrictions for the users and teams that may push to the branch. See Restrictions below for details. + /// Enforce restrictions for required status checks. See Required Status Checks below for details. /// - [Input("restrictions")] - public Input? Restrictions { get; set; } + public InputList RequiredStatusChecks + { + get => _requiredStatusChecks ?? (_requiredStatusChecks = new InputList()); + set => _requiredStatusChecks = value; + } public BranchProtectionState() { diff --git a/sdk/dotnet/Inputs/BranchProtectionRequiredPullRequestReviewsArgs.cs b/sdk/dotnet/Inputs/BranchProtectionRequiredPullRequestReviewArgs.cs similarity index 52% rename from sdk/dotnet/Inputs/BranchProtectionRequiredPullRequestReviewsArgs.cs rename to sdk/dotnet/Inputs/BranchProtectionRequiredPullRequestReviewArgs.cs index 9d492880..e740f76f 100644 --- a/sdk/dotnet/Inputs/BranchProtectionRequiredPullRequestReviewsArgs.cs +++ b/sdk/dotnet/Inputs/BranchProtectionRequiredPullRequestReviewArgs.cs @@ -10,37 +10,26 @@ namespace Pulumi.Github.Inputs { - public sealed class BranchProtectionRequiredPullRequestReviewsArgs : Pulumi.ResourceArgs + public sealed class BranchProtectionRequiredPullRequestReviewArgs : Pulumi.ResourceArgs { [Input("dismissStaleReviews")] public Input? DismissStaleReviews { get; set; } - [Input("dismissalTeams")] - private InputList? _dismissalTeams; - public InputList DismissalTeams + [Input("dismissalRestrictions")] + private InputList? _dismissalRestrictions; + public InputList DismissalRestrictions { - get => _dismissalTeams ?? (_dismissalTeams = new InputList()); - set => _dismissalTeams = value; + get => _dismissalRestrictions ?? (_dismissalRestrictions = new InputList()); + set => _dismissalRestrictions = value; } - [Input("dismissalUsers")] - private InputList? _dismissalUsers; - public InputList DismissalUsers - { - get => _dismissalUsers ?? (_dismissalUsers = new InputList()); - set => _dismissalUsers = value; - } - - [Input("includeAdmins")] - public Input? IncludeAdmins { get; set; } - [Input("requireCodeOwnerReviews")] public Input? RequireCodeOwnerReviews { get; set; } [Input("requiredApprovingReviewCount")] public Input? RequiredApprovingReviewCount { get; set; } - public BranchProtectionRequiredPullRequestReviewsArgs() + public BranchProtectionRequiredPullRequestReviewArgs() { } } diff --git a/sdk/dotnet/Inputs/BranchProtectionRequiredPullRequestReviewsGetArgs.cs b/sdk/dotnet/Inputs/BranchProtectionRequiredPullRequestReviewGetArgs.cs similarity index 52% rename from sdk/dotnet/Inputs/BranchProtectionRequiredPullRequestReviewsGetArgs.cs rename to sdk/dotnet/Inputs/BranchProtectionRequiredPullRequestReviewGetArgs.cs index e0462577..861c99a1 100644 --- a/sdk/dotnet/Inputs/BranchProtectionRequiredPullRequestReviewsGetArgs.cs +++ b/sdk/dotnet/Inputs/BranchProtectionRequiredPullRequestReviewGetArgs.cs @@ -10,37 +10,26 @@ namespace Pulumi.Github.Inputs { - public sealed class BranchProtectionRequiredPullRequestReviewsGetArgs : Pulumi.ResourceArgs + public sealed class BranchProtectionRequiredPullRequestReviewGetArgs : Pulumi.ResourceArgs { [Input("dismissStaleReviews")] public Input? DismissStaleReviews { get; set; } - [Input("dismissalTeams")] - private InputList? _dismissalTeams; - public InputList DismissalTeams + [Input("dismissalRestrictions")] + private InputList? _dismissalRestrictions; + public InputList DismissalRestrictions { - get => _dismissalTeams ?? (_dismissalTeams = new InputList()); - set => _dismissalTeams = value; + get => _dismissalRestrictions ?? (_dismissalRestrictions = new InputList()); + set => _dismissalRestrictions = value; } - [Input("dismissalUsers")] - private InputList? _dismissalUsers; - public InputList DismissalUsers - { - get => _dismissalUsers ?? (_dismissalUsers = new InputList()); - set => _dismissalUsers = value; - } - - [Input("includeAdmins")] - public Input? IncludeAdmins { get; set; } - [Input("requireCodeOwnerReviews")] public Input? RequireCodeOwnerReviews { get; set; } [Input("requiredApprovingReviewCount")] public Input? RequiredApprovingReviewCount { get; set; } - public BranchProtectionRequiredPullRequestReviewsGetArgs() + public BranchProtectionRequiredPullRequestReviewGetArgs() { } } diff --git a/sdk/dotnet/Inputs/BranchProtectionRequiredStatusChecksArgs.cs b/sdk/dotnet/Inputs/BranchProtectionRequiredStatusCheckArgs.cs similarity index 75% rename from sdk/dotnet/Inputs/BranchProtectionRequiredStatusChecksArgs.cs rename to sdk/dotnet/Inputs/BranchProtectionRequiredStatusCheckArgs.cs index a7cea979..863cab81 100644 --- a/sdk/dotnet/Inputs/BranchProtectionRequiredStatusChecksArgs.cs +++ b/sdk/dotnet/Inputs/BranchProtectionRequiredStatusCheckArgs.cs @@ -10,7 +10,7 @@ namespace Pulumi.Github.Inputs { - public sealed class BranchProtectionRequiredStatusChecksArgs : Pulumi.ResourceArgs + public sealed class BranchProtectionRequiredStatusCheckArgs : Pulumi.ResourceArgs { [Input("contexts")] private InputList? _contexts; @@ -20,13 +20,10 @@ public InputList Contexts set => _contexts = value; } - [Input("includeAdmins")] - public Input? IncludeAdmins { get; set; } - [Input("strict")] public Input? Strict { get; set; } - public BranchProtectionRequiredStatusChecksArgs() + public BranchProtectionRequiredStatusCheckArgs() { } } diff --git a/sdk/dotnet/Inputs/BranchProtectionRequiredStatusChecksGetArgs.cs b/sdk/dotnet/Inputs/BranchProtectionRequiredStatusCheckGetArgs.cs similarity index 74% rename from sdk/dotnet/Inputs/BranchProtectionRequiredStatusChecksGetArgs.cs rename to sdk/dotnet/Inputs/BranchProtectionRequiredStatusCheckGetArgs.cs index c2152a57..b7b6c402 100644 --- a/sdk/dotnet/Inputs/BranchProtectionRequiredStatusChecksGetArgs.cs +++ b/sdk/dotnet/Inputs/BranchProtectionRequiredStatusCheckGetArgs.cs @@ -10,7 +10,7 @@ namespace Pulumi.Github.Inputs { - public sealed class BranchProtectionRequiredStatusChecksGetArgs : Pulumi.ResourceArgs + public sealed class BranchProtectionRequiredStatusCheckGetArgs : Pulumi.ResourceArgs { [Input("contexts")] private InputList? _contexts; @@ -20,13 +20,10 @@ public InputList Contexts set => _contexts = value; } - [Input("includeAdmins")] - public Input? IncludeAdmins { get; set; } - [Input("strict")] public Input? Strict { get; set; } - public BranchProtectionRequiredStatusChecksGetArgs() + public BranchProtectionRequiredStatusCheckGetArgs() { } } diff --git a/sdk/dotnet/Inputs/BranchProtectionRestrictionsArgs.cs b/sdk/dotnet/Inputs/BranchProtectionRestrictionsArgs.cs deleted file mode 100644 index 48dd9d78..00000000 --- a/sdk/dotnet/Inputs/BranchProtectionRestrictionsArgs.cs +++ /dev/null @@ -1,43 +0,0 @@ -// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** -// *** Do not edit by hand unless you're certain you know what you are doing! *** - -using System; -using System.Collections.Generic; -using System.Collections.Immutable; -using System.Threading.Tasks; -using Pulumi.Serialization; - -namespace Pulumi.Github.Inputs -{ - - public sealed class BranchProtectionRestrictionsArgs : Pulumi.ResourceArgs - { - [Input("apps")] - private InputList? _apps; - public InputList Apps - { - get => _apps ?? (_apps = new InputList()); - set => _apps = value; - } - - [Input("teams")] - private InputList? _teams; - public InputList Teams - { - get => _teams ?? (_teams = new InputList()); - set => _teams = value; - } - - [Input("users")] - private InputList? _users; - public InputList Users - { - get => _users ?? (_users = new InputList()); - set => _users = value; - } - - public BranchProtectionRestrictionsArgs() - { - } - } -} diff --git a/sdk/dotnet/Inputs/BranchProtectionRestrictionsGetArgs.cs b/sdk/dotnet/Inputs/BranchProtectionRestrictionsGetArgs.cs deleted file mode 100644 index 462e1402..00000000 --- a/sdk/dotnet/Inputs/BranchProtectionRestrictionsGetArgs.cs +++ /dev/null @@ -1,43 +0,0 @@ -// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** -// *** Do not edit by hand unless you're certain you know what you are doing! *** - -using System; -using System.Collections.Generic; -using System.Collections.Immutable; -using System.Threading.Tasks; -using Pulumi.Serialization; - -namespace Pulumi.Github.Inputs -{ - - public sealed class BranchProtectionRestrictionsGetArgs : Pulumi.ResourceArgs - { - [Input("apps")] - private InputList? _apps; - public InputList Apps - { - get => _apps ?? (_apps = new InputList()); - set => _apps = value; - } - - [Input("teams")] - private InputList? _teams; - public InputList Teams - { - get => _teams ?? (_teams = new InputList()); - set => _teams = value; - } - - [Input("users")] - private InputList? _users; - public InputList Users - { - get => _users ?? (_users = new InputList()); - set => _users = value; - } - - public BranchProtectionRestrictionsGetArgs() - { - } - } -} diff --git a/sdk/dotnet/Outputs/BranchProtectionRequiredPullRequestReviews.cs b/sdk/dotnet/Outputs/BranchProtectionRequiredPullRequestReview.cs similarity index 66% rename from sdk/dotnet/Outputs/BranchProtectionRequiredPullRequestReviews.cs rename to sdk/dotnet/Outputs/BranchProtectionRequiredPullRequestReview.cs index ae53cc10..f11fbe73 100644 --- a/sdk/dotnet/Outputs/BranchProtectionRequiredPullRequestReviews.cs +++ b/sdk/dotnet/Outputs/BranchProtectionRequiredPullRequestReview.cs @@ -11,33 +11,25 @@ namespace Pulumi.Github.Outputs { [OutputType] - public sealed class BranchProtectionRequiredPullRequestReviews + public sealed class BranchProtectionRequiredPullRequestReview { public readonly bool? DismissStaleReviews; - public readonly ImmutableArray DismissalTeams; - public readonly ImmutableArray DismissalUsers; - public readonly bool? IncludeAdmins; + public readonly ImmutableArray DismissalRestrictions; public readonly bool? RequireCodeOwnerReviews; public readonly int? RequiredApprovingReviewCount; [OutputConstructor] - private BranchProtectionRequiredPullRequestReviews( + private BranchProtectionRequiredPullRequestReview( bool? dismissStaleReviews, - ImmutableArray dismissalTeams, - - ImmutableArray dismissalUsers, - - bool? includeAdmins, + ImmutableArray dismissalRestrictions, bool? requireCodeOwnerReviews, int? requiredApprovingReviewCount) { DismissStaleReviews = dismissStaleReviews; - DismissalTeams = dismissalTeams; - DismissalUsers = dismissalUsers; - IncludeAdmins = includeAdmins; + DismissalRestrictions = dismissalRestrictions; RequireCodeOwnerReviews = requireCodeOwnerReviews; RequiredApprovingReviewCount = requiredApprovingReviewCount; } diff --git a/sdk/dotnet/Outputs/BranchProtectionRequiredStatusChecks.cs b/sdk/dotnet/Outputs/BranchProtectionRequiredStatusCheck.cs similarity index 73% rename from sdk/dotnet/Outputs/BranchProtectionRequiredStatusChecks.cs rename to sdk/dotnet/Outputs/BranchProtectionRequiredStatusCheck.cs index 64b909ae..f62928b2 100644 --- a/sdk/dotnet/Outputs/BranchProtectionRequiredStatusChecks.cs +++ b/sdk/dotnet/Outputs/BranchProtectionRequiredStatusCheck.cs @@ -11,22 +11,18 @@ namespace Pulumi.Github.Outputs { [OutputType] - public sealed class BranchProtectionRequiredStatusChecks + public sealed class BranchProtectionRequiredStatusCheck { public readonly ImmutableArray Contexts; - public readonly bool? IncludeAdmins; public readonly bool? Strict; [OutputConstructor] - private BranchProtectionRequiredStatusChecks( + private BranchProtectionRequiredStatusCheck( ImmutableArray contexts, - bool? includeAdmins, - bool? strict) { Contexts = contexts; - IncludeAdmins = includeAdmins; Strict = strict; } } diff --git a/sdk/dotnet/Outputs/BranchProtectionRestrictions.cs b/sdk/dotnet/Outputs/BranchProtectionRestrictions.cs deleted file mode 100644 index 02f79461..00000000 --- a/sdk/dotnet/Outputs/BranchProtectionRestrictions.cs +++ /dev/null @@ -1,33 +0,0 @@ -// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** -// *** Do not edit by hand unless you're certain you know what you are doing! *** - -using System; -using System.Collections.Generic; -using System.Collections.Immutable; -using System.Threading.Tasks; -using Pulumi.Serialization; - -namespace Pulumi.Github.Outputs -{ - - [OutputType] - public sealed class BranchProtectionRestrictions - { - public readonly ImmutableArray Apps; - public readonly ImmutableArray Teams; - public readonly ImmutableArray Users; - - [OutputConstructor] - private BranchProtectionRestrictions( - ImmutableArray apps, - - ImmutableArray teams, - - ImmutableArray users) - { - Apps = apps; - Teams = teams; - Users = users; - } - } -} diff --git a/sdk/dotnet/Repository.cs b/sdk/dotnet/Repository.cs index 31e55ded..c90c87d7 100644 --- a/sdk/dotnet/Repository.cs +++ b/sdk/dotnet/Repository.cs @@ -58,6 +58,12 @@ public partial class Repository : Pulumi.CustomResource [Output("allowSquashMerge")] public Output AllowSquashMerge { get; private set; } = null!; + /// + /// Set to `true` to archive the repository instead of deleting on destroy. + /// + [Output("archiveOnDestroy")] + public Output ArchiveOnDestroy { get; private set; } = null!; + /// /// Specifies if the repository should be archived. Defaults to `false`. **NOTE** Currently, the API does not support unarchiving. /// @@ -213,6 +219,12 @@ public partial class Repository : Pulumi.CustomResource [Output("visibility")] public Output Visibility { get; private set; } = null!; + /// + /// Set to `true` to enable security alerts for vulnerable dependencies. Enabling requires alerts to be enabled on the owner level. (Note for importing: GitHub enables the alerts on public repos but disables them on private repos by default.) See [GitHub Documentation](https://help.github.com/en/github/managing-security-vulnerabilities/about-security-alerts-for-vulnerable-dependencies) for details. + /// + [Output("vulnerabilityAlerts")] + public Output VulnerabilityAlerts { get; private set; } = null!; + /// /// Create a Repository resource with the given unique name, arguments, and options. @@ -277,6 +289,12 @@ public sealed class RepositoryArgs : Pulumi.ResourceArgs [Input("allowSquashMerge")] public Input? AllowSquashMerge { get; set; } + /// + /// Set to `true` to archive the repository instead of deleting on destroy. + /// + [Input("archiveOnDestroy")] + public Input? ArchiveOnDestroy { get; set; } + /// /// Specifies if the repository should be archived. Defaults to `false`. **NOTE** Currently, the API does not support unarchiving. /// @@ -396,6 +414,12 @@ public InputList Topics [Input("visibility")] public Input? Visibility { get; set; } + /// + /// Set to `true` to enable security alerts for vulnerable dependencies. Enabling requires alerts to be enabled on the owner level. (Note for importing: GitHub enables the alerts on public repos but disables them on private repos by default.) See [GitHub Documentation](https://help.github.com/en/github/managing-security-vulnerabilities/about-security-alerts-for-vulnerable-dependencies) for details. + /// + [Input("vulnerabilityAlerts")] + public Input? VulnerabilityAlerts { get; set; } + public RepositoryArgs() { } @@ -421,6 +445,12 @@ public sealed class RepositoryState : Pulumi.ResourceArgs [Input("allowSquashMerge")] public Input? AllowSquashMerge { get; set; } + /// + /// Set to `true` to archive the repository instead of deleting on destroy. + /// + [Input("archiveOnDestroy")] + public Input? ArchiveOnDestroy { get; set; } + /// /// Specifies if the repository should be archived. Defaults to `false`. **NOTE** Currently, the API does not support unarchiving. /// @@ -582,6 +612,12 @@ public InputList Topics [Input("visibility")] public Input? Visibility { get; set; } + /// + /// Set to `true` to enable security alerts for vulnerable dependencies. Enabling requires alerts to be enabled on the owner level. (Note for importing: GitHub enables the alerts on public repos but disables them on private repos by default.) See [GitHub Documentation](https://help.github.com/en/github/managing-security-vulnerabilities/about-security-alerts-for-vulnerable-dependencies) for details. + /// + [Input("vulnerabilityAlerts")] + public Input? VulnerabilityAlerts { get; set; } + public RepositoryState() { } diff --git a/sdk/dotnet/RepositoryFile.cs b/sdk/dotnet/RepositoryFile.cs index b6a75327..5b2adc94 100644 --- a/sdk/dotnet/RepositoryFile.cs +++ b/sdk/dotnet/RepositoryFile.cs @@ -23,11 +23,20 @@ namespace Pulumi.Github /// { /// public MyStack() /// { - /// var gitignore = new Github.RepositoryFile("gitignore", new Github.RepositoryFileArgs + /// var fooRepository = new Github.Repository("fooRepository", new Github.RepositoryArgs /// { - /// Content = "**/*.tfstate", + /// AutoInit = true, + /// }); + /// var fooRepositoryFile = new Github.RepositoryFile("fooRepositoryFile", new Github.RepositoryFileArgs + /// { + /// Repository = fooRepository.Name, + /// Branch = "main", /// File = ".gitignore", - /// Repository = "example", + /// Content = "**/*.tfstate", + /// CommitMessage = "Managed by Terraform", + /// CommitAuthor = "Terraform User", + /// CommitEmail = "terraform@example.com", + /// OverwriteOnCreate = true, /// }); /// } /// @@ -73,6 +82,12 @@ public partial class RepositoryFile : Pulumi.CustomResource [Output("file")] public Output File { get; private set; } = null!; + /// + /// Enable overwriting existing files + /// + [Output("overwriteOnCreate")] + public Output OverwriteOnCreate { get; private set; } = null!; + /// /// The repository name /// @@ -168,6 +183,12 @@ public sealed class RepositoryFileArgs : Pulumi.ResourceArgs [Input("file", required: true)] public Input File { get; set; } = null!; + /// + /// Enable overwriting existing files + /// + [Input("overwriteOnCreate")] + public Input? OverwriteOnCreate { get; set; } + /// /// The repository name /// @@ -218,6 +239,12 @@ public sealed class RepositoryFileState : Pulumi.ResourceArgs [Input("file")] public Input? File { get; set; } + /// + /// Enable overwriting existing files + /// + [Input("overwriteOnCreate")] + public Input? OverwriteOnCreate { get; set; } + /// /// The repository name /// diff --git a/sdk/go/github/branchProtection.go b/sdk/go/github/branchProtection.go index 343a0ba4..817be818 100644 --- a/sdk/go/github/branchProtection.go +++ b/sdk/go/github/branchProtection.go @@ -16,31 +16,30 @@ import ( type BranchProtection struct { pulumi.CustomResourceState - // The Git branch to protect. - Branch pulumi.StringOutput `pulumi:"branch"` // Boolean, setting this to `true` enforces status checks for repository administrators. EnforceAdmins pulumi.BoolPtrOutput `pulumi:"enforceAdmins"` - Etag pulumi.StringOutput `pulumi:"etag"` - // The GitHub repository name. - Repository pulumi.StringOutput `pulumi:"repository"` + // Identifies the protection rule pattern. + Pattern pulumi.StringOutput `pulumi:"pattern"` + // The list of actor IDs that may push to the branch. + PushRestrictions pulumi.StringArrayOutput `pulumi:"pushRestrictions"` + // The repository associated with this branch protection rule. + RepositoryId pulumi.StringOutput `pulumi:"repositoryId"` // Boolean, setting this to `true` requires all commits to be signed with GPG. RequireSignedCommits pulumi.BoolPtrOutput `pulumi:"requireSignedCommits"` // Enforce restrictions for pull request reviews. See Required Pull Request Reviews below for details. - RequiredPullRequestReviews BranchProtectionRequiredPullRequestReviewsPtrOutput `pulumi:"requiredPullRequestReviews"` + RequiredPullRequestReviews BranchProtectionRequiredPullRequestReviewArrayOutput `pulumi:"requiredPullRequestReviews"` // Enforce restrictions for required status checks. See Required Status Checks below for details. - RequiredStatusChecks BranchProtectionRequiredStatusChecksPtrOutput `pulumi:"requiredStatusChecks"` - // Enforce restrictions for the users and teams that may push to the branch. See Restrictions below for details. - Restrictions BranchProtectionRestrictionsPtrOutput `pulumi:"restrictions"` + RequiredStatusChecks BranchProtectionRequiredStatusCheckArrayOutput `pulumi:"requiredStatusChecks"` } // NewBranchProtection registers a new resource with the given unique name, arguments, and options. func NewBranchProtection(ctx *pulumi.Context, name string, args *BranchProtectionArgs, opts ...pulumi.ResourceOption) (*BranchProtection, error) { - if args == nil || args.Branch == nil { - return nil, errors.New("missing required argument 'Branch'") + if args == nil || args.Pattern == nil { + return nil, errors.New("missing required argument 'Pattern'") } - if args == nil || args.Repository == nil { - return nil, errors.New("missing required argument 'Repository'") + if args == nil || args.RepositoryId == nil { + return nil, errors.New("missing required argument 'RepositoryId'") } if args == nil { args = &BranchProtectionArgs{} @@ -67,39 +66,37 @@ func GetBranchProtection(ctx *pulumi.Context, // Input properties used for looking up and filtering BranchProtection resources. type branchProtectionState struct { - // The Git branch to protect. - Branch *string `pulumi:"branch"` // Boolean, setting this to `true` enforces status checks for repository administrators. - EnforceAdmins *bool `pulumi:"enforceAdmins"` - Etag *string `pulumi:"etag"` - // The GitHub repository name. - Repository *string `pulumi:"repository"` + EnforceAdmins *bool `pulumi:"enforceAdmins"` + // Identifies the protection rule pattern. + Pattern *string `pulumi:"pattern"` + // The list of actor IDs that may push to the branch. + PushRestrictions []string `pulumi:"pushRestrictions"` + // The repository associated with this branch protection rule. + RepositoryId *string `pulumi:"repositoryId"` // Boolean, setting this to `true` requires all commits to be signed with GPG. RequireSignedCommits *bool `pulumi:"requireSignedCommits"` // Enforce restrictions for pull request reviews. See Required Pull Request Reviews below for details. - RequiredPullRequestReviews *BranchProtectionRequiredPullRequestReviews `pulumi:"requiredPullRequestReviews"` + RequiredPullRequestReviews []BranchProtectionRequiredPullRequestReview `pulumi:"requiredPullRequestReviews"` // Enforce restrictions for required status checks. See Required Status Checks below for details. - RequiredStatusChecks *BranchProtectionRequiredStatusChecks `pulumi:"requiredStatusChecks"` - // Enforce restrictions for the users and teams that may push to the branch. See Restrictions below for details. - Restrictions *BranchProtectionRestrictions `pulumi:"restrictions"` + RequiredStatusChecks []BranchProtectionRequiredStatusCheck `pulumi:"requiredStatusChecks"` } type BranchProtectionState struct { - // The Git branch to protect. - Branch pulumi.StringPtrInput // Boolean, setting this to `true` enforces status checks for repository administrators. EnforceAdmins pulumi.BoolPtrInput - Etag pulumi.StringPtrInput - // The GitHub repository name. - Repository pulumi.StringPtrInput + // Identifies the protection rule pattern. + Pattern pulumi.StringPtrInput + // The list of actor IDs that may push to the branch. + PushRestrictions pulumi.StringArrayInput + // The repository associated with this branch protection rule. + RepositoryId pulumi.StringPtrInput // Boolean, setting this to `true` requires all commits to be signed with GPG. RequireSignedCommits pulumi.BoolPtrInput // Enforce restrictions for pull request reviews. See Required Pull Request Reviews below for details. - RequiredPullRequestReviews BranchProtectionRequiredPullRequestReviewsPtrInput + RequiredPullRequestReviews BranchProtectionRequiredPullRequestReviewArrayInput // Enforce restrictions for required status checks. See Required Status Checks below for details. - RequiredStatusChecks BranchProtectionRequiredStatusChecksPtrInput - // Enforce restrictions for the users and teams that may push to the branch. See Restrictions below for details. - Restrictions BranchProtectionRestrictionsPtrInput + RequiredStatusChecks BranchProtectionRequiredStatusCheckArrayInput } func (BranchProtectionState) ElementType() reflect.Type { @@ -107,38 +104,38 @@ func (BranchProtectionState) ElementType() reflect.Type { } type branchProtectionArgs struct { - // The Git branch to protect. - Branch string `pulumi:"branch"` // Boolean, setting this to `true` enforces status checks for repository administrators. EnforceAdmins *bool `pulumi:"enforceAdmins"` - // The GitHub repository name. - Repository string `pulumi:"repository"` + // Identifies the protection rule pattern. + Pattern string `pulumi:"pattern"` + // The list of actor IDs that may push to the branch. + PushRestrictions []string `pulumi:"pushRestrictions"` + // The repository associated with this branch protection rule. + RepositoryId string `pulumi:"repositoryId"` // Boolean, setting this to `true` requires all commits to be signed with GPG. RequireSignedCommits *bool `pulumi:"requireSignedCommits"` // Enforce restrictions for pull request reviews. See Required Pull Request Reviews below for details. - RequiredPullRequestReviews *BranchProtectionRequiredPullRequestReviews `pulumi:"requiredPullRequestReviews"` + RequiredPullRequestReviews []BranchProtectionRequiredPullRequestReview `pulumi:"requiredPullRequestReviews"` // Enforce restrictions for required status checks. See Required Status Checks below for details. - RequiredStatusChecks *BranchProtectionRequiredStatusChecks `pulumi:"requiredStatusChecks"` - // Enforce restrictions for the users and teams that may push to the branch. See Restrictions below for details. - Restrictions *BranchProtectionRestrictions `pulumi:"restrictions"` + RequiredStatusChecks []BranchProtectionRequiredStatusCheck `pulumi:"requiredStatusChecks"` } // The set of arguments for constructing a BranchProtection resource. type BranchProtectionArgs struct { - // The Git branch to protect. - Branch pulumi.StringInput // Boolean, setting this to `true` enforces status checks for repository administrators. EnforceAdmins pulumi.BoolPtrInput - // The GitHub repository name. - Repository pulumi.StringInput + // Identifies the protection rule pattern. + Pattern pulumi.StringInput + // The list of actor IDs that may push to the branch. + PushRestrictions pulumi.StringArrayInput + // The repository associated with this branch protection rule. + RepositoryId pulumi.StringInput // Boolean, setting this to `true` requires all commits to be signed with GPG. RequireSignedCommits pulumi.BoolPtrInput // Enforce restrictions for pull request reviews. See Required Pull Request Reviews below for details. - RequiredPullRequestReviews BranchProtectionRequiredPullRequestReviewsPtrInput + RequiredPullRequestReviews BranchProtectionRequiredPullRequestReviewArrayInput // Enforce restrictions for required status checks. See Required Status Checks below for details. - RequiredStatusChecks BranchProtectionRequiredStatusChecksPtrInput - // Enforce restrictions for the users and teams that may push to the branch. See Restrictions below for details. - Restrictions BranchProtectionRestrictionsPtrInput + RequiredStatusChecks BranchProtectionRequiredStatusCheckArrayInput } func (BranchProtectionArgs) ElementType() reflect.Type { diff --git a/sdk/go/github/pulumiTypes.go b/sdk/go/github/pulumiTypes.go index 0036ebbd..9cbfb0fe 100644 --- a/sdk/go/github/pulumiTypes.go +++ b/sdk/go/github/pulumiTypes.go @@ -10,527 +10,216 @@ import ( "github.com/pulumi/pulumi/sdk/v2/go/pulumi" ) -type BranchProtectionRequiredPullRequestReviews struct { - DismissStaleReviews *bool `pulumi:"dismissStaleReviews"` - DismissalTeams []string `pulumi:"dismissalTeams"` - DismissalUsers []string `pulumi:"dismissalUsers"` - // Deprecated: Use enforce_admins instead - IncludeAdmins *bool `pulumi:"includeAdmins"` - RequireCodeOwnerReviews *bool `pulumi:"requireCodeOwnerReviews"` - RequiredApprovingReviewCount *int `pulumi:"requiredApprovingReviewCount"` -} - -// BranchProtectionRequiredPullRequestReviewsInput is an input type that accepts BranchProtectionRequiredPullRequestReviewsArgs and BranchProtectionRequiredPullRequestReviewsOutput values. -// You can construct a concrete instance of `BranchProtectionRequiredPullRequestReviewsInput` via: -// -// BranchProtectionRequiredPullRequestReviewsArgs{...} -type BranchProtectionRequiredPullRequestReviewsInput interface { - pulumi.Input - - ToBranchProtectionRequiredPullRequestReviewsOutput() BranchProtectionRequiredPullRequestReviewsOutput - ToBranchProtectionRequiredPullRequestReviewsOutputWithContext(context.Context) BranchProtectionRequiredPullRequestReviewsOutput -} - -type BranchProtectionRequiredPullRequestReviewsArgs struct { - DismissStaleReviews pulumi.BoolPtrInput `pulumi:"dismissStaleReviews"` - DismissalTeams pulumi.StringArrayInput `pulumi:"dismissalTeams"` - DismissalUsers pulumi.StringArrayInput `pulumi:"dismissalUsers"` - // Deprecated: Use enforce_admins instead - IncludeAdmins pulumi.BoolPtrInput `pulumi:"includeAdmins"` - RequireCodeOwnerReviews pulumi.BoolPtrInput `pulumi:"requireCodeOwnerReviews"` - RequiredApprovingReviewCount pulumi.IntPtrInput `pulumi:"requiredApprovingReviewCount"` -} - -func (BranchProtectionRequiredPullRequestReviewsArgs) ElementType() reflect.Type { - return reflect.TypeOf((*BranchProtectionRequiredPullRequestReviews)(nil)).Elem() -} - -func (i BranchProtectionRequiredPullRequestReviewsArgs) ToBranchProtectionRequiredPullRequestReviewsOutput() BranchProtectionRequiredPullRequestReviewsOutput { - return i.ToBranchProtectionRequiredPullRequestReviewsOutputWithContext(context.Background()) -} - -func (i BranchProtectionRequiredPullRequestReviewsArgs) ToBranchProtectionRequiredPullRequestReviewsOutputWithContext(ctx context.Context) BranchProtectionRequiredPullRequestReviewsOutput { - return pulumi.ToOutputWithContext(ctx, i).(BranchProtectionRequiredPullRequestReviewsOutput) -} - -func (i BranchProtectionRequiredPullRequestReviewsArgs) ToBranchProtectionRequiredPullRequestReviewsPtrOutput() BranchProtectionRequiredPullRequestReviewsPtrOutput { - return i.ToBranchProtectionRequiredPullRequestReviewsPtrOutputWithContext(context.Background()) -} - -func (i BranchProtectionRequiredPullRequestReviewsArgs) ToBranchProtectionRequiredPullRequestReviewsPtrOutputWithContext(ctx context.Context) BranchProtectionRequiredPullRequestReviewsPtrOutput { - return pulumi.ToOutputWithContext(ctx, i).(BranchProtectionRequiredPullRequestReviewsOutput).ToBranchProtectionRequiredPullRequestReviewsPtrOutputWithContext(ctx) -} - -// BranchProtectionRequiredPullRequestReviewsPtrInput is an input type that accepts BranchProtectionRequiredPullRequestReviewsArgs, BranchProtectionRequiredPullRequestReviewsPtr and BranchProtectionRequiredPullRequestReviewsPtrOutput values. -// You can construct a concrete instance of `BranchProtectionRequiredPullRequestReviewsPtrInput` via: -// -// BranchProtectionRequiredPullRequestReviewsArgs{...} -// -// or: -// -// nil -type BranchProtectionRequiredPullRequestReviewsPtrInput interface { - pulumi.Input - - ToBranchProtectionRequiredPullRequestReviewsPtrOutput() BranchProtectionRequiredPullRequestReviewsPtrOutput - ToBranchProtectionRequiredPullRequestReviewsPtrOutputWithContext(context.Context) BranchProtectionRequiredPullRequestReviewsPtrOutput -} - -type branchProtectionRequiredPullRequestReviewsPtrType BranchProtectionRequiredPullRequestReviewsArgs - -func BranchProtectionRequiredPullRequestReviewsPtr(v *BranchProtectionRequiredPullRequestReviewsArgs) BranchProtectionRequiredPullRequestReviewsPtrInput { - return (*branchProtectionRequiredPullRequestReviewsPtrType)(v) -} - -func (*branchProtectionRequiredPullRequestReviewsPtrType) ElementType() reflect.Type { - return reflect.TypeOf((**BranchProtectionRequiredPullRequestReviews)(nil)).Elem() -} - -func (i *branchProtectionRequiredPullRequestReviewsPtrType) ToBranchProtectionRequiredPullRequestReviewsPtrOutput() BranchProtectionRequiredPullRequestReviewsPtrOutput { - return i.ToBranchProtectionRequiredPullRequestReviewsPtrOutputWithContext(context.Background()) -} - -func (i *branchProtectionRequiredPullRequestReviewsPtrType) ToBranchProtectionRequiredPullRequestReviewsPtrOutputWithContext(ctx context.Context) BranchProtectionRequiredPullRequestReviewsPtrOutput { - return pulumi.ToOutputWithContext(ctx, i).(BranchProtectionRequiredPullRequestReviewsPtrOutput) -} - -type BranchProtectionRequiredPullRequestReviewsOutput struct{ *pulumi.OutputState } - -func (BranchProtectionRequiredPullRequestReviewsOutput) ElementType() reflect.Type { - return reflect.TypeOf((*BranchProtectionRequiredPullRequestReviews)(nil)).Elem() -} - -func (o BranchProtectionRequiredPullRequestReviewsOutput) ToBranchProtectionRequiredPullRequestReviewsOutput() BranchProtectionRequiredPullRequestReviewsOutput { - return o -} - -func (o BranchProtectionRequiredPullRequestReviewsOutput) ToBranchProtectionRequiredPullRequestReviewsOutputWithContext(ctx context.Context) BranchProtectionRequiredPullRequestReviewsOutput { - return o -} - -func (o BranchProtectionRequiredPullRequestReviewsOutput) ToBranchProtectionRequiredPullRequestReviewsPtrOutput() BranchProtectionRequiredPullRequestReviewsPtrOutput { - return o.ToBranchProtectionRequiredPullRequestReviewsPtrOutputWithContext(context.Background()) -} - -func (o BranchProtectionRequiredPullRequestReviewsOutput) ToBranchProtectionRequiredPullRequestReviewsPtrOutputWithContext(ctx context.Context) BranchProtectionRequiredPullRequestReviewsPtrOutput { - return o.ApplyT(func(v BranchProtectionRequiredPullRequestReviews) *BranchProtectionRequiredPullRequestReviews { - return &v - }).(BranchProtectionRequiredPullRequestReviewsPtrOutput) -} -func (o BranchProtectionRequiredPullRequestReviewsOutput) DismissStaleReviews() pulumi.BoolPtrOutput { - return o.ApplyT(func(v BranchProtectionRequiredPullRequestReviews) *bool { return v.DismissStaleReviews }).(pulumi.BoolPtrOutput) -} - -func (o BranchProtectionRequiredPullRequestReviewsOutput) DismissalTeams() pulumi.StringArrayOutput { - return o.ApplyT(func(v BranchProtectionRequiredPullRequestReviews) []string { return v.DismissalTeams }).(pulumi.StringArrayOutput) -} - -func (o BranchProtectionRequiredPullRequestReviewsOutput) DismissalUsers() pulumi.StringArrayOutput { - return o.ApplyT(func(v BranchProtectionRequiredPullRequestReviews) []string { return v.DismissalUsers }).(pulumi.StringArrayOutput) -} - -// Deprecated: Use enforce_admins instead -func (o BranchProtectionRequiredPullRequestReviewsOutput) IncludeAdmins() pulumi.BoolPtrOutput { - return o.ApplyT(func(v BranchProtectionRequiredPullRequestReviews) *bool { return v.IncludeAdmins }).(pulumi.BoolPtrOutput) -} - -func (o BranchProtectionRequiredPullRequestReviewsOutput) RequireCodeOwnerReviews() pulumi.BoolPtrOutput { - return o.ApplyT(func(v BranchProtectionRequiredPullRequestReviews) *bool { return v.RequireCodeOwnerReviews }).(pulumi.BoolPtrOutput) -} - -func (o BranchProtectionRequiredPullRequestReviewsOutput) RequiredApprovingReviewCount() pulumi.IntPtrOutput { - return o.ApplyT(func(v BranchProtectionRequiredPullRequestReviews) *int { return v.RequiredApprovingReviewCount }).(pulumi.IntPtrOutput) -} - -type BranchProtectionRequiredPullRequestReviewsPtrOutput struct{ *pulumi.OutputState } - -func (BranchProtectionRequiredPullRequestReviewsPtrOutput) ElementType() reflect.Type { - return reflect.TypeOf((**BranchProtectionRequiredPullRequestReviews)(nil)).Elem() -} - -func (o BranchProtectionRequiredPullRequestReviewsPtrOutput) ToBranchProtectionRequiredPullRequestReviewsPtrOutput() BranchProtectionRequiredPullRequestReviewsPtrOutput { - return o -} - -func (o BranchProtectionRequiredPullRequestReviewsPtrOutput) ToBranchProtectionRequiredPullRequestReviewsPtrOutputWithContext(ctx context.Context) BranchProtectionRequiredPullRequestReviewsPtrOutput { - return o -} - -func (o BranchProtectionRequiredPullRequestReviewsPtrOutput) Elem() BranchProtectionRequiredPullRequestReviewsOutput { - return o.ApplyT(func(v *BranchProtectionRequiredPullRequestReviews) BranchProtectionRequiredPullRequestReviews { - return *v - }).(BranchProtectionRequiredPullRequestReviewsOutput) -} - -func (o BranchProtectionRequiredPullRequestReviewsPtrOutput) DismissStaleReviews() pulumi.BoolPtrOutput { - return o.ApplyT(func(v *BranchProtectionRequiredPullRequestReviews) *bool { - if v == nil { - return nil - } - return v.DismissStaleReviews - }).(pulumi.BoolPtrOutput) -} - -func (o BranchProtectionRequiredPullRequestReviewsPtrOutput) DismissalTeams() pulumi.StringArrayOutput { - return o.ApplyT(func(v *BranchProtectionRequiredPullRequestReviews) []string { - if v == nil { - return nil - } - return v.DismissalTeams - }).(pulumi.StringArrayOutput) -} - -func (o BranchProtectionRequiredPullRequestReviewsPtrOutput) DismissalUsers() pulumi.StringArrayOutput { - return o.ApplyT(func(v *BranchProtectionRequiredPullRequestReviews) []string { - if v == nil { - return nil - } - return v.DismissalUsers - }).(pulumi.StringArrayOutput) -} - -// Deprecated: Use enforce_admins instead -func (o BranchProtectionRequiredPullRequestReviewsPtrOutput) IncludeAdmins() pulumi.BoolPtrOutput { - return o.ApplyT(func(v *BranchProtectionRequiredPullRequestReviews) *bool { - if v == nil { - return nil - } - return v.IncludeAdmins - }).(pulumi.BoolPtrOutput) -} - -func (o BranchProtectionRequiredPullRequestReviewsPtrOutput) RequireCodeOwnerReviews() pulumi.BoolPtrOutput { - return o.ApplyT(func(v *BranchProtectionRequiredPullRequestReviews) *bool { - if v == nil { - return nil - } - return v.RequireCodeOwnerReviews - }).(pulumi.BoolPtrOutput) -} - -func (o BranchProtectionRequiredPullRequestReviewsPtrOutput) RequiredApprovingReviewCount() pulumi.IntPtrOutput { - return o.ApplyT(func(v *BranchProtectionRequiredPullRequestReviews) *int { - if v == nil { - return nil - } - return v.RequiredApprovingReviewCount - }).(pulumi.IntPtrOutput) -} - -type BranchProtectionRequiredStatusChecks struct { - Contexts []string `pulumi:"contexts"` - // Deprecated: Use enforce_admins instead - IncludeAdmins *bool `pulumi:"includeAdmins"` - Strict *bool `pulumi:"strict"` +type BranchProtectionRequiredPullRequestReview struct { + DismissStaleReviews *bool `pulumi:"dismissStaleReviews"` + DismissalRestrictions []string `pulumi:"dismissalRestrictions"` + RequireCodeOwnerReviews *bool `pulumi:"requireCodeOwnerReviews"` + RequiredApprovingReviewCount *int `pulumi:"requiredApprovingReviewCount"` } -// BranchProtectionRequiredStatusChecksInput is an input type that accepts BranchProtectionRequiredStatusChecksArgs and BranchProtectionRequiredStatusChecksOutput values. -// You can construct a concrete instance of `BranchProtectionRequiredStatusChecksInput` via: +// BranchProtectionRequiredPullRequestReviewInput is an input type that accepts BranchProtectionRequiredPullRequestReviewArgs and BranchProtectionRequiredPullRequestReviewOutput values. +// You can construct a concrete instance of `BranchProtectionRequiredPullRequestReviewInput` via: // -// BranchProtectionRequiredStatusChecksArgs{...} -type BranchProtectionRequiredStatusChecksInput interface { +// BranchProtectionRequiredPullRequestReviewArgs{...} +type BranchProtectionRequiredPullRequestReviewInput interface { pulumi.Input - ToBranchProtectionRequiredStatusChecksOutput() BranchProtectionRequiredStatusChecksOutput - ToBranchProtectionRequiredStatusChecksOutputWithContext(context.Context) BranchProtectionRequiredStatusChecksOutput + ToBranchProtectionRequiredPullRequestReviewOutput() BranchProtectionRequiredPullRequestReviewOutput + ToBranchProtectionRequiredPullRequestReviewOutputWithContext(context.Context) BranchProtectionRequiredPullRequestReviewOutput } -type BranchProtectionRequiredStatusChecksArgs struct { - Contexts pulumi.StringArrayInput `pulumi:"contexts"` - // Deprecated: Use enforce_admins instead - IncludeAdmins pulumi.BoolPtrInput `pulumi:"includeAdmins"` - Strict pulumi.BoolPtrInput `pulumi:"strict"` -} - -func (BranchProtectionRequiredStatusChecksArgs) ElementType() reflect.Type { - return reflect.TypeOf((*BranchProtectionRequiredStatusChecks)(nil)).Elem() +type BranchProtectionRequiredPullRequestReviewArgs struct { + DismissStaleReviews pulumi.BoolPtrInput `pulumi:"dismissStaleReviews"` + DismissalRestrictions pulumi.StringArrayInput `pulumi:"dismissalRestrictions"` + RequireCodeOwnerReviews pulumi.BoolPtrInput `pulumi:"requireCodeOwnerReviews"` + RequiredApprovingReviewCount pulumi.IntPtrInput `pulumi:"requiredApprovingReviewCount"` } -func (i BranchProtectionRequiredStatusChecksArgs) ToBranchProtectionRequiredStatusChecksOutput() BranchProtectionRequiredStatusChecksOutput { - return i.ToBranchProtectionRequiredStatusChecksOutputWithContext(context.Background()) +func (BranchProtectionRequiredPullRequestReviewArgs) ElementType() reflect.Type { + return reflect.TypeOf((*BranchProtectionRequiredPullRequestReview)(nil)).Elem() } -func (i BranchProtectionRequiredStatusChecksArgs) ToBranchProtectionRequiredStatusChecksOutputWithContext(ctx context.Context) BranchProtectionRequiredStatusChecksOutput { - return pulumi.ToOutputWithContext(ctx, i).(BranchProtectionRequiredStatusChecksOutput) +func (i BranchProtectionRequiredPullRequestReviewArgs) ToBranchProtectionRequiredPullRequestReviewOutput() BranchProtectionRequiredPullRequestReviewOutput { + return i.ToBranchProtectionRequiredPullRequestReviewOutputWithContext(context.Background()) } -func (i BranchProtectionRequiredStatusChecksArgs) ToBranchProtectionRequiredStatusChecksPtrOutput() BranchProtectionRequiredStatusChecksPtrOutput { - return i.ToBranchProtectionRequiredStatusChecksPtrOutputWithContext(context.Background()) +func (i BranchProtectionRequiredPullRequestReviewArgs) ToBranchProtectionRequiredPullRequestReviewOutputWithContext(ctx context.Context) BranchProtectionRequiredPullRequestReviewOutput { + return pulumi.ToOutputWithContext(ctx, i).(BranchProtectionRequiredPullRequestReviewOutput) } -func (i BranchProtectionRequiredStatusChecksArgs) ToBranchProtectionRequiredStatusChecksPtrOutputWithContext(ctx context.Context) BranchProtectionRequiredStatusChecksPtrOutput { - return pulumi.ToOutputWithContext(ctx, i).(BranchProtectionRequiredStatusChecksOutput).ToBranchProtectionRequiredStatusChecksPtrOutputWithContext(ctx) -} - -// BranchProtectionRequiredStatusChecksPtrInput is an input type that accepts BranchProtectionRequiredStatusChecksArgs, BranchProtectionRequiredStatusChecksPtr and BranchProtectionRequiredStatusChecksPtrOutput values. -// You can construct a concrete instance of `BranchProtectionRequiredStatusChecksPtrInput` via: -// -// BranchProtectionRequiredStatusChecksArgs{...} +// BranchProtectionRequiredPullRequestReviewArrayInput is an input type that accepts BranchProtectionRequiredPullRequestReviewArray and BranchProtectionRequiredPullRequestReviewArrayOutput values. +// You can construct a concrete instance of `BranchProtectionRequiredPullRequestReviewArrayInput` via: // -// or: -// -// nil -type BranchProtectionRequiredStatusChecksPtrInput interface { +// BranchProtectionRequiredPullRequestReviewArray{ BranchProtectionRequiredPullRequestReviewArgs{...} } +type BranchProtectionRequiredPullRequestReviewArrayInput interface { pulumi.Input - ToBranchProtectionRequiredStatusChecksPtrOutput() BranchProtectionRequiredStatusChecksPtrOutput - ToBranchProtectionRequiredStatusChecksPtrOutputWithContext(context.Context) BranchProtectionRequiredStatusChecksPtrOutput + ToBranchProtectionRequiredPullRequestReviewArrayOutput() BranchProtectionRequiredPullRequestReviewArrayOutput + ToBranchProtectionRequiredPullRequestReviewArrayOutputWithContext(context.Context) BranchProtectionRequiredPullRequestReviewArrayOutput } -type branchProtectionRequiredStatusChecksPtrType BranchProtectionRequiredStatusChecksArgs - -func BranchProtectionRequiredStatusChecksPtr(v *BranchProtectionRequiredStatusChecksArgs) BranchProtectionRequiredStatusChecksPtrInput { - return (*branchProtectionRequiredStatusChecksPtrType)(v) -} +type BranchProtectionRequiredPullRequestReviewArray []BranchProtectionRequiredPullRequestReviewInput -func (*branchProtectionRequiredStatusChecksPtrType) ElementType() reflect.Type { - return reflect.TypeOf((**BranchProtectionRequiredStatusChecks)(nil)).Elem() +func (BranchProtectionRequiredPullRequestReviewArray) ElementType() reflect.Type { + return reflect.TypeOf((*[]BranchProtectionRequiredPullRequestReview)(nil)).Elem() } -func (i *branchProtectionRequiredStatusChecksPtrType) ToBranchProtectionRequiredStatusChecksPtrOutput() BranchProtectionRequiredStatusChecksPtrOutput { - return i.ToBranchProtectionRequiredStatusChecksPtrOutputWithContext(context.Background()) +func (i BranchProtectionRequiredPullRequestReviewArray) ToBranchProtectionRequiredPullRequestReviewArrayOutput() BranchProtectionRequiredPullRequestReviewArrayOutput { + return i.ToBranchProtectionRequiredPullRequestReviewArrayOutputWithContext(context.Background()) } -func (i *branchProtectionRequiredStatusChecksPtrType) ToBranchProtectionRequiredStatusChecksPtrOutputWithContext(ctx context.Context) BranchProtectionRequiredStatusChecksPtrOutput { - return pulumi.ToOutputWithContext(ctx, i).(BranchProtectionRequiredStatusChecksPtrOutput) +func (i BranchProtectionRequiredPullRequestReviewArray) ToBranchProtectionRequiredPullRequestReviewArrayOutputWithContext(ctx context.Context) BranchProtectionRequiredPullRequestReviewArrayOutput { + return pulumi.ToOutputWithContext(ctx, i).(BranchProtectionRequiredPullRequestReviewArrayOutput) } -type BranchProtectionRequiredStatusChecksOutput struct{ *pulumi.OutputState } +type BranchProtectionRequiredPullRequestReviewOutput struct{ *pulumi.OutputState } -func (BranchProtectionRequiredStatusChecksOutput) ElementType() reflect.Type { - return reflect.TypeOf((*BranchProtectionRequiredStatusChecks)(nil)).Elem() +func (BranchProtectionRequiredPullRequestReviewOutput) ElementType() reflect.Type { + return reflect.TypeOf((*BranchProtectionRequiredPullRequestReview)(nil)).Elem() } -func (o BranchProtectionRequiredStatusChecksOutput) ToBranchProtectionRequiredStatusChecksOutput() BranchProtectionRequiredStatusChecksOutput { +func (o BranchProtectionRequiredPullRequestReviewOutput) ToBranchProtectionRequiredPullRequestReviewOutput() BranchProtectionRequiredPullRequestReviewOutput { return o } -func (o BranchProtectionRequiredStatusChecksOutput) ToBranchProtectionRequiredStatusChecksOutputWithContext(ctx context.Context) BranchProtectionRequiredStatusChecksOutput { +func (o BranchProtectionRequiredPullRequestReviewOutput) ToBranchProtectionRequiredPullRequestReviewOutputWithContext(ctx context.Context) BranchProtectionRequiredPullRequestReviewOutput { return o } -func (o BranchProtectionRequiredStatusChecksOutput) ToBranchProtectionRequiredStatusChecksPtrOutput() BranchProtectionRequiredStatusChecksPtrOutput { - return o.ToBranchProtectionRequiredStatusChecksPtrOutputWithContext(context.Background()) +func (o BranchProtectionRequiredPullRequestReviewOutput) DismissStaleReviews() pulumi.BoolPtrOutput { + return o.ApplyT(func(v BranchProtectionRequiredPullRequestReview) *bool { return v.DismissStaleReviews }).(pulumi.BoolPtrOutput) } -func (o BranchProtectionRequiredStatusChecksOutput) ToBranchProtectionRequiredStatusChecksPtrOutputWithContext(ctx context.Context) BranchProtectionRequiredStatusChecksPtrOutput { - return o.ApplyT(func(v BranchProtectionRequiredStatusChecks) *BranchProtectionRequiredStatusChecks { - return &v - }).(BranchProtectionRequiredStatusChecksPtrOutput) -} -func (o BranchProtectionRequiredStatusChecksOutput) Contexts() pulumi.StringArrayOutput { - return o.ApplyT(func(v BranchProtectionRequiredStatusChecks) []string { return v.Contexts }).(pulumi.StringArrayOutput) +func (o BranchProtectionRequiredPullRequestReviewOutput) DismissalRestrictions() pulumi.StringArrayOutput { + return o.ApplyT(func(v BranchProtectionRequiredPullRequestReview) []string { return v.DismissalRestrictions }).(pulumi.StringArrayOutput) } -// Deprecated: Use enforce_admins instead -func (o BranchProtectionRequiredStatusChecksOutput) IncludeAdmins() pulumi.BoolPtrOutput { - return o.ApplyT(func(v BranchProtectionRequiredStatusChecks) *bool { return v.IncludeAdmins }).(pulumi.BoolPtrOutput) +func (o BranchProtectionRequiredPullRequestReviewOutput) RequireCodeOwnerReviews() pulumi.BoolPtrOutput { + return o.ApplyT(func(v BranchProtectionRequiredPullRequestReview) *bool { return v.RequireCodeOwnerReviews }).(pulumi.BoolPtrOutput) } -func (o BranchProtectionRequiredStatusChecksOutput) Strict() pulumi.BoolPtrOutput { - return o.ApplyT(func(v BranchProtectionRequiredStatusChecks) *bool { return v.Strict }).(pulumi.BoolPtrOutput) +func (o BranchProtectionRequiredPullRequestReviewOutput) RequiredApprovingReviewCount() pulumi.IntPtrOutput { + return o.ApplyT(func(v BranchProtectionRequiredPullRequestReview) *int { return v.RequiredApprovingReviewCount }).(pulumi.IntPtrOutput) } -type BranchProtectionRequiredStatusChecksPtrOutput struct{ *pulumi.OutputState } +type BranchProtectionRequiredPullRequestReviewArrayOutput struct{ *pulumi.OutputState } -func (BranchProtectionRequiredStatusChecksPtrOutput) ElementType() reflect.Type { - return reflect.TypeOf((**BranchProtectionRequiredStatusChecks)(nil)).Elem() +func (BranchProtectionRequiredPullRequestReviewArrayOutput) ElementType() reflect.Type { + return reflect.TypeOf((*[]BranchProtectionRequiredPullRequestReview)(nil)).Elem() } -func (o BranchProtectionRequiredStatusChecksPtrOutput) ToBranchProtectionRequiredStatusChecksPtrOutput() BranchProtectionRequiredStatusChecksPtrOutput { +func (o BranchProtectionRequiredPullRequestReviewArrayOutput) ToBranchProtectionRequiredPullRequestReviewArrayOutput() BranchProtectionRequiredPullRequestReviewArrayOutput { return o } -func (o BranchProtectionRequiredStatusChecksPtrOutput) ToBranchProtectionRequiredStatusChecksPtrOutputWithContext(ctx context.Context) BranchProtectionRequiredStatusChecksPtrOutput { +func (o BranchProtectionRequiredPullRequestReviewArrayOutput) ToBranchProtectionRequiredPullRequestReviewArrayOutputWithContext(ctx context.Context) BranchProtectionRequiredPullRequestReviewArrayOutput { return o } -func (o BranchProtectionRequiredStatusChecksPtrOutput) Elem() BranchProtectionRequiredStatusChecksOutput { - return o.ApplyT(func(v *BranchProtectionRequiredStatusChecks) BranchProtectionRequiredStatusChecks { return *v }).(BranchProtectionRequiredStatusChecksOutput) -} - -func (o BranchProtectionRequiredStatusChecksPtrOutput) Contexts() pulumi.StringArrayOutput { - return o.ApplyT(func(v *BranchProtectionRequiredStatusChecks) []string { - if v == nil { - return nil - } - return v.Contexts - }).(pulumi.StringArrayOutput) -} - -// Deprecated: Use enforce_admins instead -func (o BranchProtectionRequiredStatusChecksPtrOutput) IncludeAdmins() pulumi.BoolPtrOutput { - return o.ApplyT(func(v *BranchProtectionRequiredStatusChecks) *bool { - if v == nil { - return nil - } - return v.IncludeAdmins - }).(pulumi.BoolPtrOutput) -} - -func (o BranchProtectionRequiredStatusChecksPtrOutput) Strict() pulumi.BoolPtrOutput { - return o.ApplyT(func(v *BranchProtectionRequiredStatusChecks) *bool { - if v == nil { - return nil - } - return v.Strict - }).(pulumi.BoolPtrOutput) +func (o BranchProtectionRequiredPullRequestReviewArrayOutput) Index(i pulumi.IntInput) BranchProtectionRequiredPullRequestReviewOutput { + return pulumi.All(o, i).ApplyT(func(vs []interface{}) BranchProtectionRequiredPullRequestReview { + return vs[0].([]BranchProtectionRequiredPullRequestReview)[vs[1].(int)] + }).(BranchProtectionRequiredPullRequestReviewOutput) } -type BranchProtectionRestrictions struct { - Apps []string `pulumi:"apps"` - Teams []string `pulumi:"teams"` - Users []string `pulumi:"users"` +type BranchProtectionRequiredStatusCheck struct { + Contexts []string `pulumi:"contexts"` + Strict *bool `pulumi:"strict"` } -// BranchProtectionRestrictionsInput is an input type that accepts BranchProtectionRestrictionsArgs and BranchProtectionRestrictionsOutput values. -// You can construct a concrete instance of `BranchProtectionRestrictionsInput` via: +// BranchProtectionRequiredStatusCheckInput is an input type that accepts BranchProtectionRequiredStatusCheckArgs and BranchProtectionRequiredStatusCheckOutput values. +// You can construct a concrete instance of `BranchProtectionRequiredStatusCheckInput` via: // -// BranchProtectionRestrictionsArgs{...} -type BranchProtectionRestrictionsInput interface { +// BranchProtectionRequiredStatusCheckArgs{...} +type BranchProtectionRequiredStatusCheckInput interface { pulumi.Input - ToBranchProtectionRestrictionsOutput() BranchProtectionRestrictionsOutput - ToBranchProtectionRestrictionsOutputWithContext(context.Context) BranchProtectionRestrictionsOutput + ToBranchProtectionRequiredStatusCheckOutput() BranchProtectionRequiredStatusCheckOutput + ToBranchProtectionRequiredStatusCheckOutputWithContext(context.Context) BranchProtectionRequiredStatusCheckOutput } -type BranchProtectionRestrictionsArgs struct { - Apps pulumi.StringArrayInput `pulumi:"apps"` - Teams pulumi.StringArrayInput `pulumi:"teams"` - Users pulumi.StringArrayInput `pulumi:"users"` -} - -func (BranchProtectionRestrictionsArgs) ElementType() reflect.Type { - return reflect.TypeOf((*BranchProtectionRestrictions)(nil)).Elem() -} - -func (i BranchProtectionRestrictionsArgs) ToBranchProtectionRestrictionsOutput() BranchProtectionRestrictionsOutput { - return i.ToBranchProtectionRestrictionsOutputWithContext(context.Background()) +type BranchProtectionRequiredStatusCheckArgs struct { + Contexts pulumi.StringArrayInput `pulumi:"contexts"` + Strict pulumi.BoolPtrInput `pulumi:"strict"` } -func (i BranchProtectionRestrictionsArgs) ToBranchProtectionRestrictionsOutputWithContext(ctx context.Context) BranchProtectionRestrictionsOutput { - return pulumi.ToOutputWithContext(ctx, i).(BranchProtectionRestrictionsOutput) +func (BranchProtectionRequiredStatusCheckArgs) ElementType() reflect.Type { + return reflect.TypeOf((*BranchProtectionRequiredStatusCheck)(nil)).Elem() } -func (i BranchProtectionRestrictionsArgs) ToBranchProtectionRestrictionsPtrOutput() BranchProtectionRestrictionsPtrOutput { - return i.ToBranchProtectionRestrictionsPtrOutputWithContext(context.Background()) +func (i BranchProtectionRequiredStatusCheckArgs) ToBranchProtectionRequiredStatusCheckOutput() BranchProtectionRequiredStatusCheckOutput { + return i.ToBranchProtectionRequiredStatusCheckOutputWithContext(context.Background()) } -func (i BranchProtectionRestrictionsArgs) ToBranchProtectionRestrictionsPtrOutputWithContext(ctx context.Context) BranchProtectionRestrictionsPtrOutput { - return pulumi.ToOutputWithContext(ctx, i).(BranchProtectionRestrictionsOutput).ToBranchProtectionRestrictionsPtrOutputWithContext(ctx) +func (i BranchProtectionRequiredStatusCheckArgs) ToBranchProtectionRequiredStatusCheckOutputWithContext(ctx context.Context) BranchProtectionRequiredStatusCheckOutput { + return pulumi.ToOutputWithContext(ctx, i).(BranchProtectionRequiredStatusCheckOutput) } -// BranchProtectionRestrictionsPtrInput is an input type that accepts BranchProtectionRestrictionsArgs, BranchProtectionRestrictionsPtr and BranchProtectionRestrictionsPtrOutput values. -// You can construct a concrete instance of `BranchProtectionRestrictionsPtrInput` via: -// -// BranchProtectionRestrictionsArgs{...} +// BranchProtectionRequiredStatusCheckArrayInput is an input type that accepts BranchProtectionRequiredStatusCheckArray and BranchProtectionRequiredStatusCheckArrayOutput values. +// You can construct a concrete instance of `BranchProtectionRequiredStatusCheckArrayInput` via: // -// or: -// -// nil -type BranchProtectionRestrictionsPtrInput interface { +// BranchProtectionRequiredStatusCheckArray{ BranchProtectionRequiredStatusCheckArgs{...} } +type BranchProtectionRequiredStatusCheckArrayInput interface { pulumi.Input - ToBranchProtectionRestrictionsPtrOutput() BranchProtectionRestrictionsPtrOutput - ToBranchProtectionRestrictionsPtrOutputWithContext(context.Context) BranchProtectionRestrictionsPtrOutput + ToBranchProtectionRequiredStatusCheckArrayOutput() BranchProtectionRequiredStatusCheckArrayOutput + ToBranchProtectionRequiredStatusCheckArrayOutputWithContext(context.Context) BranchProtectionRequiredStatusCheckArrayOutput } -type branchProtectionRestrictionsPtrType BranchProtectionRestrictionsArgs - -func BranchProtectionRestrictionsPtr(v *BranchProtectionRestrictionsArgs) BranchProtectionRestrictionsPtrInput { - return (*branchProtectionRestrictionsPtrType)(v) -} +type BranchProtectionRequiredStatusCheckArray []BranchProtectionRequiredStatusCheckInput -func (*branchProtectionRestrictionsPtrType) ElementType() reflect.Type { - return reflect.TypeOf((**BranchProtectionRestrictions)(nil)).Elem() +func (BranchProtectionRequiredStatusCheckArray) ElementType() reflect.Type { + return reflect.TypeOf((*[]BranchProtectionRequiredStatusCheck)(nil)).Elem() } -func (i *branchProtectionRestrictionsPtrType) ToBranchProtectionRestrictionsPtrOutput() BranchProtectionRestrictionsPtrOutput { - return i.ToBranchProtectionRestrictionsPtrOutputWithContext(context.Background()) +func (i BranchProtectionRequiredStatusCheckArray) ToBranchProtectionRequiredStatusCheckArrayOutput() BranchProtectionRequiredStatusCheckArrayOutput { + return i.ToBranchProtectionRequiredStatusCheckArrayOutputWithContext(context.Background()) } -func (i *branchProtectionRestrictionsPtrType) ToBranchProtectionRestrictionsPtrOutputWithContext(ctx context.Context) BranchProtectionRestrictionsPtrOutput { - return pulumi.ToOutputWithContext(ctx, i).(BranchProtectionRestrictionsPtrOutput) +func (i BranchProtectionRequiredStatusCheckArray) ToBranchProtectionRequiredStatusCheckArrayOutputWithContext(ctx context.Context) BranchProtectionRequiredStatusCheckArrayOutput { + return pulumi.ToOutputWithContext(ctx, i).(BranchProtectionRequiredStatusCheckArrayOutput) } -type BranchProtectionRestrictionsOutput struct{ *pulumi.OutputState } +type BranchProtectionRequiredStatusCheckOutput struct{ *pulumi.OutputState } -func (BranchProtectionRestrictionsOutput) ElementType() reflect.Type { - return reflect.TypeOf((*BranchProtectionRestrictions)(nil)).Elem() +func (BranchProtectionRequiredStatusCheckOutput) ElementType() reflect.Type { + return reflect.TypeOf((*BranchProtectionRequiredStatusCheck)(nil)).Elem() } -func (o BranchProtectionRestrictionsOutput) ToBranchProtectionRestrictionsOutput() BranchProtectionRestrictionsOutput { +func (o BranchProtectionRequiredStatusCheckOutput) ToBranchProtectionRequiredStatusCheckOutput() BranchProtectionRequiredStatusCheckOutput { return o } -func (o BranchProtectionRestrictionsOutput) ToBranchProtectionRestrictionsOutputWithContext(ctx context.Context) BranchProtectionRestrictionsOutput { +func (o BranchProtectionRequiredStatusCheckOutput) ToBranchProtectionRequiredStatusCheckOutputWithContext(ctx context.Context) BranchProtectionRequiredStatusCheckOutput { return o } -func (o BranchProtectionRestrictionsOutput) ToBranchProtectionRestrictionsPtrOutput() BranchProtectionRestrictionsPtrOutput { - return o.ToBranchProtectionRestrictionsPtrOutputWithContext(context.Background()) +func (o BranchProtectionRequiredStatusCheckOutput) Contexts() pulumi.StringArrayOutput { + return o.ApplyT(func(v BranchProtectionRequiredStatusCheck) []string { return v.Contexts }).(pulumi.StringArrayOutput) } -func (o BranchProtectionRestrictionsOutput) ToBranchProtectionRestrictionsPtrOutputWithContext(ctx context.Context) BranchProtectionRestrictionsPtrOutput { - return o.ApplyT(func(v BranchProtectionRestrictions) *BranchProtectionRestrictions { - return &v - }).(BranchProtectionRestrictionsPtrOutput) -} -func (o BranchProtectionRestrictionsOutput) Apps() pulumi.StringArrayOutput { - return o.ApplyT(func(v BranchProtectionRestrictions) []string { return v.Apps }).(pulumi.StringArrayOutput) -} - -func (o BranchProtectionRestrictionsOutput) Teams() pulumi.StringArrayOutput { - return o.ApplyT(func(v BranchProtectionRestrictions) []string { return v.Teams }).(pulumi.StringArrayOutput) -} - -func (o BranchProtectionRestrictionsOutput) Users() pulumi.StringArrayOutput { - return o.ApplyT(func(v BranchProtectionRestrictions) []string { return v.Users }).(pulumi.StringArrayOutput) +func (o BranchProtectionRequiredStatusCheckOutput) Strict() pulumi.BoolPtrOutput { + return o.ApplyT(func(v BranchProtectionRequiredStatusCheck) *bool { return v.Strict }).(pulumi.BoolPtrOutput) } -type BranchProtectionRestrictionsPtrOutput struct{ *pulumi.OutputState } +type BranchProtectionRequiredStatusCheckArrayOutput struct{ *pulumi.OutputState } -func (BranchProtectionRestrictionsPtrOutput) ElementType() reflect.Type { - return reflect.TypeOf((**BranchProtectionRestrictions)(nil)).Elem() +func (BranchProtectionRequiredStatusCheckArrayOutput) ElementType() reflect.Type { + return reflect.TypeOf((*[]BranchProtectionRequiredStatusCheck)(nil)).Elem() } -func (o BranchProtectionRestrictionsPtrOutput) ToBranchProtectionRestrictionsPtrOutput() BranchProtectionRestrictionsPtrOutput { +func (o BranchProtectionRequiredStatusCheckArrayOutput) ToBranchProtectionRequiredStatusCheckArrayOutput() BranchProtectionRequiredStatusCheckArrayOutput { return o } -func (o BranchProtectionRestrictionsPtrOutput) ToBranchProtectionRestrictionsPtrOutputWithContext(ctx context.Context) BranchProtectionRestrictionsPtrOutput { +func (o BranchProtectionRequiredStatusCheckArrayOutput) ToBranchProtectionRequiredStatusCheckArrayOutputWithContext(ctx context.Context) BranchProtectionRequiredStatusCheckArrayOutput { return o } -func (o BranchProtectionRestrictionsPtrOutput) Elem() BranchProtectionRestrictionsOutput { - return o.ApplyT(func(v *BranchProtectionRestrictions) BranchProtectionRestrictions { return *v }).(BranchProtectionRestrictionsOutput) -} - -func (o BranchProtectionRestrictionsPtrOutput) Apps() pulumi.StringArrayOutput { - return o.ApplyT(func(v *BranchProtectionRestrictions) []string { - if v == nil { - return nil - } - return v.Apps - }).(pulumi.StringArrayOutput) -} - -func (o BranchProtectionRestrictionsPtrOutput) Teams() pulumi.StringArrayOutput { - return o.ApplyT(func(v *BranchProtectionRestrictions) []string { - if v == nil { - return nil - } - return v.Teams - }).(pulumi.StringArrayOutput) -} - -func (o BranchProtectionRestrictionsPtrOutput) Users() pulumi.StringArrayOutput { - return o.ApplyT(func(v *BranchProtectionRestrictions) []string { - if v == nil { - return nil - } - return v.Users - }).(pulumi.StringArrayOutput) +func (o BranchProtectionRequiredStatusCheckArrayOutput) Index(i pulumi.IntInput) BranchProtectionRequiredStatusCheckOutput { + return pulumi.All(o, i).ApplyT(func(vs []interface{}) BranchProtectionRequiredStatusCheck { + return vs[0].([]BranchProtectionRequiredStatusCheck)[vs[1].(int)] + }).(BranchProtectionRequiredStatusCheckOutput) } type OrganizationWebhookConfiguration struct { @@ -1487,12 +1176,10 @@ func (o GetOrganizationTeamSyncGroupsGroupArrayOutput) Index(i pulumi.IntInput) } func init() { - pulumi.RegisterOutputType(BranchProtectionRequiredPullRequestReviewsOutput{}) - pulumi.RegisterOutputType(BranchProtectionRequiredPullRequestReviewsPtrOutput{}) - pulumi.RegisterOutputType(BranchProtectionRequiredStatusChecksOutput{}) - pulumi.RegisterOutputType(BranchProtectionRequiredStatusChecksPtrOutput{}) - pulumi.RegisterOutputType(BranchProtectionRestrictionsOutput{}) - pulumi.RegisterOutputType(BranchProtectionRestrictionsPtrOutput{}) + pulumi.RegisterOutputType(BranchProtectionRequiredPullRequestReviewOutput{}) + pulumi.RegisterOutputType(BranchProtectionRequiredPullRequestReviewArrayOutput{}) + pulumi.RegisterOutputType(BranchProtectionRequiredStatusCheckOutput{}) + pulumi.RegisterOutputType(BranchProtectionRequiredStatusCheckArrayOutput{}) pulumi.RegisterOutputType(OrganizationWebhookConfigurationOutput{}) pulumi.RegisterOutputType(OrganizationWebhookConfigurationPtrOutput{}) pulumi.RegisterOutputType(RepositoryTemplateOutput{}) diff --git a/sdk/go/github/repository.go b/sdk/go/github/repository.go index fe2825a5..9bfb610a 100644 --- a/sdk/go/github/repository.go +++ b/sdk/go/github/repository.go @@ -48,6 +48,8 @@ type Repository struct { AllowRebaseMerge pulumi.BoolPtrOutput `pulumi:"allowRebaseMerge"` // Set to `false` to disable squash merges on the repository. AllowSquashMerge pulumi.BoolPtrOutput `pulumi:"allowSquashMerge"` + // Set to `true` to archive the repository instead of deleting on destroy. + ArchiveOnDestroy pulumi.BoolPtrOutput `pulumi:"archiveOnDestroy"` // Specifies if the repository should be archived. Defaults to `false`. **NOTE** Currently, the API does not support unarchiving. Archived pulumi.BoolPtrOutput `pulumi:"archived"` // Set to `true` to produce an initial commit in the repository. @@ -105,6 +107,8 @@ type Repository struct { Topics pulumi.StringArrayOutput `pulumi:"topics"` // Can be `public` or `private`. If your organization is associated with an enterprise account using GitHub Enterprise Cloud or GitHub Enterprise Server 2.20+, visibility can also be `internal`. The `visibility` parameter overrides the `private` parameter. Visibility pulumi.StringOutput `pulumi:"visibility"` + // Set to `true` to enable security alerts for vulnerable dependencies. Enabling requires alerts to be enabled on the owner level. (Note for importing: GitHub enables the alerts on public repos but disables them on private repos by default.) See [GitHub Documentation](https://help.github.com/en/github/managing-security-vulnerabilities/about-security-alerts-for-vulnerable-dependencies) for details. + VulnerabilityAlerts pulumi.BoolPtrOutput `pulumi:"vulnerabilityAlerts"` } // NewRepository registers a new resource with the given unique name, arguments, and options. @@ -141,6 +145,8 @@ type repositoryState struct { AllowRebaseMerge *bool `pulumi:"allowRebaseMerge"` // Set to `false` to disable squash merges on the repository. AllowSquashMerge *bool `pulumi:"allowSquashMerge"` + // Set to `true` to archive the repository instead of deleting on destroy. + ArchiveOnDestroy *bool `pulumi:"archiveOnDestroy"` // Specifies if the repository should be archived. Defaults to `false`. **NOTE** Currently, the API does not support unarchiving. Archived *bool `pulumi:"archived"` // Set to `true` to produce an initial commit in the repository. @@ -198,6 +204,8 @@ type repositoryState struct { Topics []string `pulumi:"topics"` // Can be `public` or `private`. If your organization is associated with an enterprise account using GitHub Enterprise Cloud or GitHub Enterprise Server 2.20+, visibility can also be `internal`. The `visibility` parameter overrides the `private` parameter. Visibility *string `pulumi:"visibility"` + // Set to `true` to enable security alerts for vulnerable dependencies. Enabling requires alerts to be enabled on the owner level. (Note for importing: GitHub enables the alerts on public repos but disables them on private repos by default.) See [GitHub Documentation](https://help.github.com/en/github/managing-security-vulnerabilities/about-security-alerts-for-vulnerable-dependencies) for details. + VulnerabilityAlerts *bool `pulumi:"vulnerabilityAlerts"` } type RepositoryState struct { @@ -207,6 +215,8 @@ type RepositoryState struct { AllowRebaseMerge pulumi.BoolPtrInput // Set to `false` to disable squash merges on the repository. AllowSquashMerge pulumi.BoolPtrInput + // Set to `true` to archive the repository instead of deleting on destroy. + ArchiveOnDestroy pulumi.BoolPtrInput // Specifies if the repository should be archived. Defaults to `false`. **NOTE** Currently, the API does not support unarchiving. Archived pulumi.BoolPtrInput // Set to `true` to produce an initial commit in the repository. @@ -264,6 +274,8 @@ type RepositoryState struct { Topics pulumi.StringArrayInput // Can be `public` or `private`. If your organization is associated with an enterprise account using GitHub Enterprise Cloud or GitHub Enterprise Server 2.20+, visibility can also be `internal`. The `visibility` parameter overrides the `private` parameter. Visibility pulumi.StringPtrInput + // Set to `true` to enable security alerts for vulnerable dependencies. Enabling requires alerts to be enabled on the owner level. (Note for importing: GitHub enables the alerts on public repos but disables them on private repos by default.) See [GitHub Documentation](https://help.github.com/en/github/managing-security-vulnerabilities/about-security-alerts-for-vulnerable-dependencies) for details. + VulnerabilityAlerts pulumi.BoolPtrInput } func (RepositoryState) ElementType() reflect.Type { @@ -277,6 +289,8 @@ type repositoryArgs struct { AllowRebaseMerge *bool `pulumi:"allowRebaseMerge"` // Set to `false` to disable squash merges on the repository. AllowSquashMerge *bool `pulumi:"allowSquashMerge"` + // Set to `true` to archive the repository instead of deleting on destroy. + ArchiveOnDestroy *bool `pulumi:"archiveOnDestroy"` // Specifies if the repository should be archived. Defaults to `false`. **NOTE** Currently, the API does not support unarchiving. Archived *bool `pulumi:"archived"` // Set to `true` to produce an initial commit in the repository. @@ -320,6 +334,8 @@ type repositoryArgs struct { Topics []string `pulumi:"topics"` // Can be `public` or `private`. If your organization is associated with an enterprise account using GitHub Enterprise Cloud or GitHub Enterprise Server 2.20+, visibility can also be `internal`. The `visibility` parameter overrides the `private` parameter. Visibility *string `pulumi:"visibility"` + // Set to `true` to enable security alerts for vulnerable dependencies. Enabling requires alerts to be enabled on the owner level. (Note for importing: GitHub enables the alerts on public repos but disables them on private repos by default.) See [GitHub Documentation](https://help.github.com/en/github/managing-security-vulnerabilities/about-security-alerts-for-vulnerable-dependencies) for details. + VulnerabilityAlerts *bool `pulumi:"vulnerabilityAlerts"` } // The set of arguments for constructing a Repository resource. @@ -330,6 +346,8 @@ type RepositoryArgs struct { AllowRebaseMerge pulumi.BoolPtrInput // Set to `false` to disable squash merges on the repository. AllowSquashMerge pulumi.BoolPtrInput + // Set to `true` to archive the repository instead of deleting on destroy. + ArchiveOnDestroy pulumi.BoolPtrInput // Specifies if the repository should be archived. Defaults to `false`. **NOTE** Currently, the API does not support unarchiving. Archived pulumi.BoolPtrInput // Set to `true` to produce an initial commit in the repository. @@ -373,6 +391,8 @@ type RepositoryArgs struct { Topics pulumi.StringArrayInput // Can be `public` or `private`. If your organization is associated with an enterprise account using GitHub Enterprise Cloud or GitHub Enterprise Server 2.20+, visibility can also be `internal`. The `visibility` parameter overrides the `private` parameter. Visibility pulumi.StringPtrInput + // Set to `true` to enable security alerts for vulnerable dependencies. Enabling requires alerts to be enabled on the owner level. (Note for importing: GitHub enables the alerts on public repos but disables them on private repos by default.) See [GitHub Documentation](https://help.github.com/en/github/managing-security-vulnerabilities/about-security-alerts-for-vulnerable-dependencies) for details. + VulnerabilityAlerts pulumi.BoolPtrInput } func (RepositoryArgs) ElementType() reflect.Type { diff --git a/sdk/go/github/repositoryFile.go b/sdk/go/github/repositoryFile.go index 4332c345..1a4647fc 100644 --- a/sdk/go/github/repositoryFile.go +++ b/sdk/go/github/repositoryFile.go @@ -25,10 +25,21 @@ import ( // // func main() { // pulumi.Run(func(ctx *pulumi.Context) error { -// _, err := github.NewRepositoryFile(ctx, "gitignore", &github.RepositoryFileArgs{ -// Content: pulumi.String("**/*.tfstate"), -// File: pulumi.String(".gitignore"), -// Repository: pulumi.String("example"), +// fooRepository, err := github.NewRepository(ctx, "fooRepository", &github.RepositoryArgs{ +// AutoInit: pulumi.Bool(true), +// }) +// if err != nil { +// return err +// } +// _, err = github.NewRepositoryFile(ctx, "fooRepositoryFile", &github.RepositoryFileArgs{ +// Repository: fooRepository.Name, +// Branch: pulumi.String("main"), +// File: pulumi.String(".gitignore"), +// Content: pulumi.String("**/*.tfstate"), +// CommitMessage: pulumi.String("Managed by Terraform"), +// CommitAuthor: pulumi.String("Terraform User"), +// CommitEmail: pulumi.String("terraform@example.com"), +// OverwriteOnCreate: pulumi.Bool(true), // }) // if err != nil { // return err @@ -53,6 +64,8 @@ type RepositoryFile struct { Content pulumi.StringOutput `pulumi:"content"` // The path of the file to manage. File pulumi.StringOutput `pulumi:"file"` + // Enable overwriting existing files + OverwriteOnCreate pulumi.BoolPtrOutput `pulumi:"overwriteOnCreate"` // The repository name Repository pulumi.StringOutput `pulumi:"repository"` // The SHA blob of the file. @@ -109,6 +122,8 @@ type repositoryFileState struct { Content *string `pulumi:"content"` // The path of the file to manage. File *string `pulumi:"file"` + // Enable overwriting existing files + OverwriteOnCreate *bool `pulumi:"overwriteOnCreate"` // The repository name Repository *string `pulumi:"repository"` // The SHA blob of the file. @@ -129,6 +144,8 @@ type RepositoryFileState struct { Content pulumi.StringPtrInput // The path of the file to manage. File pulumi.StringPtrInput + // Enable overwriting existing files + OverwriteOnCreate pulumi.BoolPtrInput // The repository name Repository pulumi.StringPtrInput // The SHA blob of the file. @@ -153,6 +170,8 @@ type repositoryFileArgs struct { Content string `pulumi:"content"` // The path of the file to manage. File string `pulumi:"file"` + // Enable overwriting existing files + OverwriteOnCreate *bool `pulumi:"overwriteOnCreate"` // The repository name Repository string `pulumi:"repository"` } @@ -172,6 +191,8 @@ type RepositoryFileArgs struct { Content pulumi.StringInput // The path of the file to manage. File pulumi.StringInput + // Enable overwriting existing files + OverwriteOnCreate pulumi.BoolPtrInput // The repository name Repository pulumi.StringInput } diff --git a/sdk/nodejs/branchProtection.ts b/sdk/nodejs/branchProtection.ts index bf3e0f53..b1cb147e 100644 --- a/sdk/nodejs/branchProtection.ts +++ b/sdk/nodejs/branchProtection.ts @@ -10,45 +10,6 @@ import * as utilities from "./utilities"; * Protects a GitHub branch. * * This resource allows you to configure branch protection for repositories in your organization. When applied, the branch will be protected from forced pushes and deletion. Additional constraints, such as required status checks or restrictions on users, teams, and apps, can also be configured. - * - * ## Example Usage - * - * ```typescript - * import * as pulumi from "@pulumi/pulumi"; - * import * as github from "@pulumi/github"; - * - * const exampleTeam = new github.Team("example", {}); - * // Protect the master branch of the foo repository. Additionally, require that - * // the "ci/travis" context to be passing and only allow the engineers team merge - * // to the branch. - * const exampleBranchProtection = new github.BranchProtection("example", { - * branch: "master", - * enforceAdmins: true, - * repository: github_repository_example.name, - * requiredPullRequestReviews: { - * dismissStaleReviews: true, - * dismissalTeams: [ - * exampleTeam.slug, - * github_team_second.slug, - * ], - * dismissalUsers: ["foo-user"], - * }, - * requiredStatusChecks: { - * contexts: ["ci/travis"], - * strict: false, - * }, - * restrictions: { - * apps: ["foo-app"], - * teams: [exampleTeam.slug], - * users: ["foo-user"], - * }, - * }); - * const exampleTeamRepository = new github.TeamRepository("example", { - * permission: "pull", - * repository: github_repository_example.name, - * teamId: exampleTeam.id, - * }); - * ``` */ export class BranchProtection extends pulumi.CustomResource { /** @@ -78,19 +39,22 @@ export class BranchProtection extends pulumi.CustomResource { return obj['__pulumiType'] === BranchProtection.__pulumiType; } - /** - * The Git branch to protect. - */ - public readonly branch!: pulumi.Output; /** * Boolean, setting this to `true` enforces status checks for repository administrators. */ public readonly enforceAdmins!: pulumi.Output; - public /*out*/ readonly etag!: pulumi.Output; /** - * The GitHub repository name. + * Identifies the protection rule pattern. + */ + public readonly pattern!: pulumi.Output; + /** + * The list of actor IDs that may push to the branch. */ - public readonly repository!: pulumi.Output; + public readonly pushRestrictions!: pulumi.Output; + /** + * The repository associated with this branch protection rule. + */ + public readonly repositoryId!: pulumi.Output; /** * Boolean, setting this to `true` requires all commits to be signed with GPG. */ @@ -98,15 +62,11 @@ export class BranchProtection extends pulumi.CustomResource { /** * Enforce restrictions for pull request reviews. See Required Pull Request Reviews below for details. */ - public readonly requiredPullRequestReviews!: pulumi.Output; + public readonly requiredPullRequestReviews!: pulumi.Output; /** * Enforce restrictions for required status checks. See Required Status Checks below for details. */ - public readonly requiredStatusChecks!: pulumi.Output; - /** - * Enforce restrictions for the users and teams that may push to the branch. See Restrictions below for details. - */ - public readonly restrictions!: pulumi.Output; + public readonly requiredStatusChecks!: pulumi.Output; /** * Create a BranchProtection resource with the given unique name, arguments, and options. @@ -120,30 +80,28 @@ export class BranchProtection extends pulumi.CustomResource { let inputs: pulumi.Inputs = {}; if (opts && opts.id) { const state = argsOrState as BranchProtectionState | undefined; - inputs["branch"] = state ? state.branch : undefined; inputs["enforceAdmins"] = state ? state.enforceAdmins : undefined; - inputs["etag"] = state ? state.etag : undefined; - inputs["repository"] = state ? state.repository : undefined; + inputs["pattern"] = state ? state.pattern : undefined; + inputs["pushRestrictions"] = state ? state.pushRestrictions : undefined; + inputs["repositoryId"] = state ? state.repositoryId : undefined; inputs["requireSignedCommits"] = state ? state.requireSignedCommits : undefined; inputs["requiredPullRequestReviews"] = state ? state.requiredPullRequestReviews : undefined; inputs["requiredStatusChecks"] = state ? state.requiredStatusChecks : undefined; - inputs["restrictions"] = state ? state.restrictions : undefined; } else { const args = argsOrState as BranchProtectionArgs | undefined; - if (!args || args.branch === undefined) { - throw new Error("Missing required property 'branch'"); + if (!args || args.pattern === undefined) { + throw new Error("Missing required property 'pattern'"); } - if (!args || args.repository === undefined) { - throw new Error("Missing required property 'repository'"); + if (!args || args.repositoryId === undefined) { + throw new Error("Missing required property 'repositoryId'"); } - inputs["branch"] = args ? args.branch : undefined; inputs["enforceAdmins"] = args ? args.enforceAdmins : undefined; - inputs["repository"] = args ? args.repository : undefined; + inputs["pattern"] = args ? args.pattern : undefined; + inputs["pushRestrictions"] = args ? args.pushRestrictions : undefined; + inputs["repositoryId"] = args ? args.repositoryId : undefined; inputs["requireSignedCommits"] = args ? args.requireSignedCommits : undefined; inputs["requiredPullRequestReviews"] = args ? args.requiredPullRequestReviews : undefined; inputs["requiredStatusChecks"] = args ? args.requiredStatusChecks : undefined; - inputs["restrictions"] = args ? args.restrictions : undefined; - inputs["etag"] = undefined /*out*/; } if (!opts) { opts = {} @@ -160,19 +118,22 @@ export class BranchProtection extends pulumi.CustomResource { * Input properties used for looking up and filtering BranchProtection resources. */ export interface BranchProtectionState { - /** - * The Git branch to protect. - */ - readonly branch?: pulumi.Input; /** * Boolean, setting this to `true` enforces status checks for repository administrators. */ readonly enforceAdmins?: pulumi.Input; - readonly etag?: pulumi.Input; /** - * The GitHub repository name. + * Identifies the protection rule pattern. */ - readonly repository?: pulumi.Input; + readonly pattern?: pulumi.Input; + /** + * The list of actor IDs that may push to the branch. + */ + readonly pushRestrictions?: pulumi.Input[]>; + /** + * The repository associated with this branch protection rule. + */ + readonly repositoryId?: pulumi.Input; /** * Boolean, setting this to `true` requires all commits to be signed with GPG. */ @@ -180,33 +141,33 @@ export interface BranchProtectionState { /** * Enforce restrictions for pull request reviews. See Required Pull Request Reviews below for details. */ - readonly requiredPullRequestReviews?: pulumi.Input; + readonly requiredPullRequestReviews?: pulumi.Input[]>; /** * Enforce restrictions for required status checks. See Required Status Checks below for details. */ - readonly requiredStatusChecks?: pulumi.Input; - /** - * Enforce restrictions for the users and teams that may push to the branch. See Restrictions below for details. - */ - readonly restrictions?: pulumi.Input; + readonly requiredStatusChecks?: pulumi.Input[]>; } /** * The set of arguments for constructing a BranchProtection resource. */ export interface BranchProtectionArgs { - /** - * The Git branch to protect. - */ - readonly branch: pulumi.Input; /** * Boolean, setting this to `true` enforces status checks for repository administrators. */ readonly enforceAdmins?: pulumi.Input; /** - * The GitHub repository name. + * Identifies the protection rule pattern. */ - readonly repository: pulumi.Input; + readonly pattern: pulumi.Input; + /** + * The list of actor IDs that may push to the branch. + */ + readonly pushRestrictions?: pulumi.Input[]>; + /** + * The repository associated with this branch protection rule. + */ + readonly repositoryId: pulumi.Input; /** * Boolean, setting this to `true` requires all commits to be signed with GPG. */ @@ -214,13 +175,9 @@ export interface BranchProtectionArgs { /** * Enforce restrictions for pull request reviews. See Required Pull Request Reviews below for details. */ - readonly requiredPullRequestReviews?: pulumi.Input; + readonly requiredPullRequestReviews?: pulumi.Input[]>; /** * Enforce restrictions for required status checks. See Required Status Checks below for details. */ - readonly requiredStatusChecks?: pulumi.Input; - /** - * Enforce restrictions for the users and teams that may push to the branch. See Restrictions below for details. - */ - readonly restrictions?: pulumi.Input; + readonly requiredStatusChecks?: pulumi.Input[]>; } diff --git a/sdk/nodejs/repository.ts b/sdk/nodejs/repository.ts index b3445f9c..073a06f3 100644 --- a/sdk/nodejs/repository.ts +++ b/sdk/nodejs/repository.ts @@ -66,6 +66,10 @@ export class Repository extends pulumi.CustomResource { * Set to `false` to disable squash merges on the repository. */ public readonly allowSquashMerge!: pulumi.Output; + /** + * Set to `true` to archive the repository instead of deleting on destroy. + */ + public readonly archiveOnDestroy!: pulumi.Output; /** * Specifies if the repository should be archived. Defaults to `false`. **NOTE** Currently, the API does not support unarchiving. */ @@ -171,6 +175,10 @@ export class Repository extends pulumi.CustomResource { * Can be `public` or `private`. If your organization is associated with an enterprise account using GitHub Enterprise Cloud or GitHub Enterprise Server 2.20+, visibility can also be `internal`. The `visibility` parameter overrides the `private` parameter. */ public readonly visibility!: pulumi.Output; + /** + * Set to `true` to enable security alerts for vulnerable dependencies. Enabling requires alerts to be enabled on the owner level. (Note for importing: GitHub enables the alerts on public repos but disables them on private repos by default.) See [GitHub Documentation](https://help.github.com/en/github/managing-security-vulnerabilities/about-security-alerts-for-vulnerable-dependencies) for details. + */ + public readonly vulnerabilityAlerts!: pulumi.Output; /** * Create a Repository resource with the given unique name, arguments, and options. @@ -187,6 +195,7 @@ export class Repository extends pulumi.CustomResource { inputs["allowMergeCommit"] = state ? state.allowMergeCommit : undefined; inputs["allowRebaseMerge"] = state ? state.allowRebaseMerge : undefined; inputs["allowSquashMerge"] = state ? state.allowSquashMerge : undefined; + inputs["archiveOnDestroy"] = state ? state.archiveOnDestroy : undefined; inputs["archived"] = state ? state.archived : undefined; inputs["autoInit"] = state ? state.autoInit : undefined; inputs["defaultBranch"] = state ? state.defaultBranch : undefined; @@ -213,11 +222,13 @@ export class Repository extends pulumi.CustomResource { inputs["template"] = state ? state.template : undefined; inputs["topics"] = state ? state.topics : undefined; inputs["visibility"] = state ? state.visibility : undefined; + inputs["vulnerabilityAlerts"] = state ? state.vulnerabilityAlerts : undefined; } else { const args = argsOrState as RepositoryArgs | undefined; inputs["allowMergeCommit"] = args ? args.allowMergeCommit : undefined; inputs["allowRebaseMerge"] = args ? args.allowRebaseMerge : undefined; inputs["allowSquashMerge"] = args ? args.allowSquashMerge : undefined; + inputs["archiveOnDestroy"] = args ? args.archiveOnDestroy : undefined; inputs["archived"] = args ? args.archived : undefined; inputs["autoInit"] = args ? args.autoInit : undefined; inputs["defaultBranch"] = args ? args.defaultBranch : undefined; @@ -236,6 +247,7 @@ export class Repository extends pulumi.CustomResource { inputs["template"] = args ? args.template : undefined; inputs["topics"] = args ? args.topics : undefined; inputs["visibility"] = args ? args.visibility : undefined; + inputs["vulnerabilityAlerts"] = args ? args.vulnerabilityAlerts : undefined; inputs["etag"] = undefined /*out*/; inputs["fullName"] = undefined /*out*/; inputs["gitCloneUrl"] = undefined /*out*/; @@ -272,6 +284,10 @@ export interface RepositoryState { * Set to `false` to disable squash merges on the repository. */ readonly allowSquashMerge?: pulumi.Input; + /** + * Set to `true` to archive the repository instead of deleting on destroy. + */ + readonly archiveOnDestroy?: pulumi.Input; /** * Specifies if the repository should be archived. Defaults to `false`. **NOTE** Currently, the API does not support unarchiving. */ @@ -377,6 +393,10 @@ export interface RepositoryState { * Can be `public` or `private`. If your organization is associated with an enterprise account using GitHub Enterprise Cloud or GitHub Enterprise Server 2.20+, visibility can also be `internal`. The `visibility` parameter overrides the `private` parameter. */ readonly visibility?: pulumi.Input; + /** + * Set to `true` to enable security alerts for vulnerable dependencies. Enabling requires alerts to be enabled on the owner level. (Note for importing: GitHub enables the alerts on public repos but disables them on private repos by default.) See [GitHub Documentation](https://help.github.com/en/github/managing-security-vulnerabilities/about-security-alerts-for-vulnerable-dependencies) for details. + */ + readonly vulnerabilityAlerts?: pulumi.Input; } /** @@ -395,6 +415,10 @@ export interface RepositoryArgs { * Set to `false` to disable squash merges on the repository. */ readonly allowSquashMerge?: pulumi.Input; + /** + * Set to `true` to archive the repository instead of deleting on destroy. + */ + readonly archiveOnDestroy?: pulumi.Input; /** * Specifies if the repository should be archived. Defaults to `false`. **NOTE** Currently, the API does not support unarchiving. */ @@ -474,4 +498,8 @@ export interface RepositoryArgs { * Can be `public` or `private`. If your organization is associated with an enterprise account using GitHub Enterprise Cloud or GitHub Enterprise Server 2.20+, visibility can also be `internal`. The `visibility` parameter overrides the `private` parameter. */ readonly visibility?: pulumi.Input; + /** + * Set to `true` to enable security alerts for vulnerable dependencies. Enabling requires alerts to be enabled on the owner level. (Note for importing: GitHub enables the alerts on public repos but disables them on private repos by default.) See [GitHub Documentation](https://help.github.com/en/github/managing-security-vulnerabilities/about-security-alerts-for-vulnerable-dependencies) for details. + */ + readonly vulnerabilityAlerts?: pulumi.Input; } diff --git a/sdk/nodejs/repositoryFile.ts b/sdk/nodejs/repositoryFile.ts index 32edb4d3..a8e5e6f4 100644 --- a/sdk/nodejs/repositoryFile.ts +++ b/sdk/nodejs/repositoryFile.ts @@ -14,10 +14,16 @@ import * as utilities from "./utilities"; * import * as pulumi from "@pulumi/pulumi"; * import * as github from "@pulumi/github"; * - * const gitignore = new github.RepositoryFile("gitignore", { - * content: "**/*.tfstate", + * const fooRepository = new github.Repository("fooRepository", {autoInit: true}); + * const fooRepositoryFile = new github.RepositoryFile("fooRepositoryFile", { + * repository: fooRepository.name, + * branch: "main", * file: ".gitignore", - * repository: "example", + * content: "**/*.tfstate", + * commitMessage: "Managed by Terraform", + * commitAuthor: "Terraform User", + * commitEmail: "terraform@example.com", + * overwriteOnCreate: true, * }); * ``` */ @@ -74,6 +80,10 @@ export class RepositoryFile extends pulumi.CustomResource { * The path of the file to manage. */ public readonly file!: pulumi.Output; + /** + * Enable overwriting existing files + */ + public readonly overwriteOnCreate!: pulumi.Output; /** * The repository name */ @@ -101,6 +111,7 @@ export class RepositoryFile extends pulumi.CustomResource { inputs["commitMessage"] = state ? state.commitMessage : undefined; inputs["content"] = state ? state.content : undefined; inputs["file"] = state ? state.file : undefined; + inputs["overwriteOnCreate"] = state ? state.overwriteOnCreate : undefined; inputs["repository"] = state ? state.repository : undefined; inputs["sha"] = state ? state.sha : undefined; } else { @@ -120,6 +131,7 @@ export class RepositoryFile extends pulumi.CustomResource { inputs["commitMessage"] = args ? args.commitMessage : undefined; inputs["content"] = args ? args.content : undefined; inputs["file"] = args ? args.file : undefined; + inputs["overwriteOnCreate"] = args ? args.overwriteOnCreate : undefined; inputs["repository"] = args ? args.repository : undefined; inputs["sha"] = undefined /*out*/; } @@ -163,6 +175,10 @@ export interface RepositoryFileState { * The path of the file to manage. */ readonly file?: pulumi.Input; + /** + * Enable overwriting existing files + */ + readonly overwriteOnCreate?: pulumi.Input; /** * The repository name */ @@ -202,6 +218,10 @@ export interface RepositoryFileArgs { * The path of the file to manage. */ readonly file: pulumi.Input; + /** + * Enable overwriting existing files + */ + readonly overwriteOnCreate?: pulumi.Input; /** * The repository name */ diff --git a/sdk/nodejs/types/input.ts b/sdk/nodejs/types/input.ts index cd98f062..411dfd01 100644 --- a/sdk/nodejs/types/input.ts +++ b/sdk/nodejs/types/input.ts @@ -5,33 +5,18 @@ import * as pulumi from "@pulumi/pulumi"; import * as inputs from "../types/input"; import * as outputs from "../types/output"; -export interface BranchProtectionRequiredPullRequestReviews { +export interface BranchProtectionRequiredPullRequestReview { dismissStaleReviews?: pulumi.Input; - dismissalTeams?: pulumi.Input[]>; - dismissalUsers?: pulumi.Input[]>; - /** - * @deprecated Use enforce_admins instead - */ - includeAdmins?: pulumi.Input; + dismissalRestrictions?: pulumi.Input[]>; requireCodeOwnerReviews?: pulumi.Input; requiredApprovingReviewCount?: pulumi.Input; } -export interface BranchProtectionRequiredStatusChecks { +export interface BranchProtectionRequiredStatusCheck { contexts?: pulumi.Input[]>; - /** - * @deprecated Use enforce_admins instead - */ - includeAdmins?: pulumi.Input; strict?: pulumi.Input; } -export interface BranchProtectionRestrictions { - apps?: pulumi.Input[]>; - teams?: pulumi.Input[]>; - users?: pulumi.Input[]>; -} - export interface OrganizationWebhookConfiguration { contentType?: pulumi.Input; insecureSsl?: pulumi.Input; diff --git a/sdk/nodejs/types/output.ts b/sdk/nodejs/types/output.ts index 9e1b0639..75876f82 100644 --- a/sdk/nodejs/types/output.ts +++ b/sdk/nodejs/types/output.ts @@ -5,33 +5,18 @@ import * as pulumi from "@pulumi/pulumi"; import * as inputs from "../types/input"; import * as outputs from "../types/output"; -export interface BranchProtectionRequiredPullRequestReviews { +export interface BranchProtectionRequiredPullRequestReview { dismissStaleReviews?: boolean; - dismissalTeams?: string[]; - dismissalUsers?: string[]; - /** - * @deprecated Use enforce_admins instead - */ - includeAdmins?: boolean; + dismissalRestrictions?: string[]; requireCodeOwnerReviews?: boolean; requiredApprovingReviewCount?: number; } -export interface BranchProtectionRequiredStatusChecks { +export interface BranchProtectionRequiredStatusCheck { contexts?: string[]; - /** - * @deprecated Use enforce_admins instead - */ - includeAdmins?: boolean; strict?: boolean; } -export interface BranchProtectionRestrictions { - apps?: string[]; - teams?: string[]; - users?: string[]; -} - export interface GetCollaboratorsCollaborator { /** * The GitHub API URL for the collaborator's events. diff --git a/sdk/python/pulumi_github/_inputs.py b/sdk/python/pulumi_github/_inputs.py index f7ad8417..58d801f3 100644 --- a/sdk/python/pulumi_github/_inputs.py +++ b/sdk/python/pulumi_github/_inputs.py @@ -9,9 +9,8 @@ from . import _utilities, _tables __all__ = [ - 'BranchProtectionRequiredPullRequestReviewsArgs', - 'BranchProtectionRequiredStatusChecksArgs', - 'BranchProtectionRestrictionsArgs', + 'BranchProtectionRequiredPullRequestReviewArgs', + 'BranchProtectionRequiredStatusCheckArgs', 'OrganizationWebhookConfigurationArgs', 'RepositoryTemplateArgs', 'RepositoryWebhookConfigurationArgs', @@ -19,25 +18,16 @@ ] @pulumi.input_type -class BranchProtectionRequiredPullRequestReviewsArgs: +class BranchProtectionRequiredPullRequestReviewArgs: def __init__(__self__, *, dismiss_stale_reviews: Optional[pulumi.Input[bool]] = None, - dismissal_teams: Optional[pulumi.Input[List[pulumi.Input[str]]]] = None, - dismissal_users: Optional[pulumi.Input[List[pulumi.Input[str]]]] = None, - include_admins: Optional[pulumi.Input[bool]] = None, + dismissal_restrictions: Optional[pulumi.Input[List[pulumi.Input[str]]]] = None, require_code_owner_reviews: Optional[pulumi.Input[bool]] = None, required_approving_review_count: Optional[pulumi.Input[float]] = None): if dismiss_stale_reviews is not None: pulumi.set(__self__, "dismiss_stale_reviews", dismiss_stale_reviews) - if dismissal_teams is not None: - pulumi.set(__self__, "dismissal_teams", dismissal_teams) - if dismissal_users is not None: - pulumi.set(__self__, "dismissal_users", dismissal_users) - if include_admins is not None: - warnings.warn("Use enforce_admins instead", DeprecationWarning) - pulumi.log.warn("include_admins is deprecated: Use enforce_admins instead") - if include_admins is not None: - pulumi.set(__self__, "include_admins", include_admins) + if dismissal_restrictions is not None: + pulumi.set(__self__, "dismissal_restrictions", dismissal_restrictions) if require_code_owner_reviews is not None: pulumi.set(__self__, "require_code_owner_reviews", require_code_owner_reviews) if required_approving_review_count is not None: @@ -53,31 +43,13 @@ def dismiss_stale_reviews(self, value: Optional[pulumi.Input[bool]]): pulumi.set(self, "dismiss_stale_reviews", value) @property - @pulumi.getter(name="dismissalTeams") - def dismissal_teams(self) -> Optional[pulumi.Input[List[pulumi.Input[str]]]]: - return pulumi.get(self, "dismissal_teams") + @pulumi.getter(name="dismissalRestrictions") + def dismissal_restrictions(self) -> Optional[pulumi.Input[List[pulumi.Input[str]]]]: + return pulumi.get(self, "dismissal_restrictions") - @dismissal_teams.setter - def dismissal_teams(self, value: Optional[pulumi.Input[List[pulumi.Input[str]]]]): - pulumi.set(self, "dismissal_teams", value) - - @property - @pulumi.getter(name="dismissalUsers") - def dismissal_users(self) -> Optional[pulumi.Input[List[pulumi.Input[str]]]]: - return pulumi.get(self, "dismissal_users") - - @dismissal_users.setter - def dismissal_users(self, value: Optional[pulumi.Input[List[pulumi.Input[str]]]]): - pulumi.set(self, "dismissal_users", value) - - @property - @pulumi.getter(name="includeAdmins") - def include_admins(self) -> Optional[pulumi.Input[bool]]: - return pulumi.get(self, "include_admins") - - @include_admins.setter - def include_admins(self, value: Optional[pulumi.Input[bool]]): - pulumi.set(self, "include_admins", value) + @dismissal_restrictions.setter + def dismissal_restrictions(self, value: Optional[pulumi.Input[List[pulumi.Input[str]]]]): + pulumi.set(self, "dismissal_restrictions", value) @property @pulumi.getter(name="requireCodeOwnerReviews") @@ -99,18 +71,12 @@ def required_approving_review_count(self, value: Optional[pulumi.Input[float]]): @pulumi.input_type -class BranchProtectionRequiredStatusChecksArgs: +class BranchProtectionRequiredStatusCheckArgs: def __init__(__self__, *, contexts: Optional[pulumi.Input[List[pulumi.Input[str]]]] = None, - include_admins: Optional[pulumi.Input[bool]] = None, strict: Optional[pulumi.Input[bool]] = None): if contexts is not None: pulumi.set(__self__, "contexts", contexts) - if include_admins is not None: - warnings.warn("Use enforce_admins instead", DeprecationWarning) - pulumi.log.warn("include_admins is deprecated: Use enforce_admins instead") - if include_admins is not None: - pulumi.set(__self__, "include_admins", include_admins) if strict is not None: pulumi.set(__self__, "strict", strict) @@ -123,15 +89,6 @@ def contexts(self) -> Optional[pulumi.Input[List[pulumi.Input[str]]]]: def contexts(self, value: Optional[pulumi.Input[List[pulumi.Input[str]]]]): pulumi.set(self, "contexts", value) - @property - @pulumi.getter(name="includeAdmins") - def include_admins(self) -> Optional[pulumi.Input[bool]]: - return pulumi.get(self, "include_admins") - - @include_admins.setter - def include_admins(self, value: Optional[pulumi.Input[bool]]): - pulumi.set(self, "include_admins", value) - @property @pulumi.getter def strict(self) -> Optional[pulumi.Input[bool]]: @@ -142,47 +99,6 @@ def strict(self, value: Optional[pulumi.Input[bool]]): pulumi.set(self, "strict", value) -@pulumi.input_type -class BranchProtectionRestrictionsArgs: - def __init__(__self__, *, - apps: Optional[pulumi.Input[List[pulumi.Input[str]]]] = None, - teams: Optional[pulumi.Input[List[pulumi.Input[str]]]] = None, - users: Optional[pulumi.Input[List[pulumi.Input[str]]]] = None): - if apps is not None: - pulumi.set(__self__, "apps", apps) - if teams is not None: - pulumi.set(__self__, "teams", teams) - if users is not None: - pulumi.set(__self__, "users", users) - - @property - @pulumi.getter - def apps(self) -> Optional[pulumi.Input[List[pulumi.Input[str]]]]: - return pulumi.get(self, "apps") - - @apps.setter - def apps(self, value: Optional[pulumi.Input[List[pulumi.Input[str]]]]): - pulumi.set(self, "apps", value) - - @property - @pulumi.getter - def teams(self) -> Optional[pulumi.Input[List[pulumi.Input[str]]]]: - return pulumi.get(self, "teams") - - @teams.setter - def teams(self, value: Optional[pulumi.Input[List[pulumi.Input[str]]]]): - pulumi.set(self, "teams", value) - - @property - @pulumi.getter - def users(self) -> Optional[pulumi.Input[List[pulumi.Input[str]]]]: - return pulumi.get(self, "users") - - @users.setter - def users(self, value: Optional[pulumi.Input[List[pulumi.Input[str]]]]): - pulumi.set(self, "users", value) - - @pulumi.input_type class OrganizationWebhookConfigurationArgs: def __init__(__self__, *, diff --git a/sdk/python/pulumi_github/_tables.py b/sdk/python/pulumi_github/_tables.py index 3e022d64..a2e0c7bb 100644 --- a/sdk/python/pulumi_github/_tables.py +++ b/sdk/python/pulumi_github/_tables.py @@ -6,6 +6,7 @@ "allow_merge_commit": "allowMergeCommit", "allow_rebase_merge": "allowRebaseMerge", "allow_squash_merge": "allowSquashMerge", + "archive_on_destroy": "archiveOnDestroy", "armored_public_key": "armoredPublicKey", "auto_init": "autoInit", "base_url": "baseUrl", @@ -32,10 +33,13 @@ "ldap_dn": "ldapDn", "license_template": "licenseTemplate", "node_id": "nodeId", + "overwrite_on_create": "overwriteOnCreate", "parent_team_id": "parentTeamId", "plaintext_value": "plaintextValue", "project_id": "projectId", + "push_restrictions": "pushRestrictions", "read_only": "readOnly", + "repository_id": "repositoryId", "require_signed_commits": "requireSignedCommits", "required_pull_request_reviews": "requiredPullRequestReviews", "required_status_checks": "requiredStatusChecks", @@ -47,12 +51,14 @@ "team_id": "teamId", "team_slug": "teamSlug", "updated_at": "updatedAt", + "vulnerability_alerts": "vulnerabilityAlerts", } CAMEL_TO_SNAKE_CASE_TABLE = { "allowMergeCommit": "allow_merge_commit", "allowRebaseMerge": "allow_rebase_merge", "allowSquashMerge": "allow_squash_merge", + "archiveOnDestroy": "archive_on_destroy", "armoredPublicKey": "armored_public_key", "autoInit": "auto_init", "baseUrl": "base_url", @@ -79,10 +85,13 @@ "ldapDn": "ldap_dn", "licenseTemplate": "license_template", "nodeId": "node_id", + "overwriteOnCreate": "overwrite_on_create", "parentTeamId": "parent_team_id", "plaintextValue": "plaintext_value", "projectId": "project_id", + "pushRestrictions": "push_restrictions", "readOnly": "read_only", + "repositoryId": "repository_id", "requireSignedCommits": "require_signed_commits", "requiredPullRequestReviews": "required_pull_request_reviews", "requiredStatusChecks": "required_status_checks", @@ -94,4 +103,5 @@ "teamId": "team_id", "teamSlug": "team_slug", "updatedAt": "updated_at", + "vulnerabilityAlerts": "vulnerability_alerts", } diff --git a/sdk/python/pulumi_github/branch_protection.py b/sdk/python/pulumi_github/branch_protection.py index 458114ed..cd1d9b8a 100644 --- a/sdk/python/pulumi_github/branch_protection.py +++ b/sdk/python/pulumi_github/branch_protection.py @@ -17,13 +17,13 @@ class BranchProtection(pulumi.CustomResource): def __init__(__self__, resource_name: str, opts: Optional[pulumi.ResourceOptions] = None, - branch: Optional[pulumi.Input[str]] = None, enforce_admins: Optional[pulumi.Input[bool]] = None, - repository: Optional[pulumi.Input[str]] = None, + pattern: Optional[pulumi.Input[str]] = None, + push_restrictions: Optional[pulumi.Input[List[pulumi.Input[str]]]] = None, + repository_id: Optional[pulumi.Input[str]] = None, require_signed_commits: Optional[pulumi.Input[bool]] = None, - required_pull_request_reviews: Optional[pulumi.Input[pulumi.InputType['BranchProtectionRequiredPullRequestReviewsArgs']]] = None, - required_status_checks: Optional[pulumi.Input[pulumi.InputType['BranchProtectionRequiredStatusChecksArgs']]] = None, - restrictions: Optional[pulumi.Input[pulumi.InputType['BranchProtectionRestrictionsArgs']]] = None, + required_pull_request_reviews: Optional[pulumi.Input[List[pulumi.Input[pulumi.InputType['BranchProtectionRequiredPullRequestReviewArgs']]]]] = None, + required_status_checks: Optional[pulumi.Input[List[pulumi.Input[pulumi.InputType['BranchProtectionRequiredStatusCheckArgs']]]]] = None, __props__=None, __name__=None, __opts__=None): @@ -32,52 +32,15 @@ def __init__(__self__, This resource allows you to configure branch protection for repositories in your organization. When applied, the branch will be protected from forced pushes and deletion. Additional constraints, such as required status checks or restrictions on users, teams, and apps, can also be configured. - ## Example Usage - - ```python - import pulumi - import pulumi_github as github - - example_team = github.Team("exampleTeam") - # Protect the master branch of the foo repository. Additionally, require that - # the "ci/travis" context to be passing and only allow the engineers team merge - # to the branch. - example_branch_protection = github.BranchProtection("exampleBranchProtection", - branch="master", - enforce_admins=True, - repository=github_repository["example"]["name"], - required_pull_request_reviews=github.BranchProtectionRequiredPullRequestReviewsArgs( - dismiss_stale_reviews=True, - dismissal_teams=[ - example_team.slug, - github_team["second"]["slug"], - ], - dismissal_users=["foo-user"], - ), - required_status_checks=github.BranchProtectionRequiredStatusChecksArgs( - contexts=["ci/travis"], - strict=False, - ), - restrictions=github.BranchProtectionRestrictionsArgs( - apps=["foo-app"], - teams=[example_team.slug], - users=["foo-user"], - )) - example_team_repository = github.TeamRepository("exampleTeamRepository", - permission="pull", - repository=github_repository["example"]["name"], - team_id=example_team.id) - ``` - :param str resource_name: The name of the resource. :param pulumi.ResourceOptions opts: Options for the resource. - :param pulumi.Input[str] branch: The Git branch to protect. :param pulumi.Input[bool] enforce_admins: Boolean, setting this to `true` enforces status checks for repository administrators. - :param pulumi.Input[str] repository: The GitHub repository name. + :param pulumi.Input[str] pattern: Identifies the protection rule pattern. + :param pulumi.Input[List[pulumi.Input[str]]] push_restrictions: The list of actor IDs that may push to the branch. + :param pulumi.Input[str] repository_id: The repository associated with this branch protection rule. :param pulumi.Input[bool] require_signed_commits: Boolean, setting this to `true` requires all commits to be signed with GPG. - :param pulumi.Input[pulumi.InputType['BranchProtectionRequiredPullRequestReviewsArgs']] required_pull_request_reviews: Enforce restrictions for pull request reviews. See Required Pull Request Reviews below for details. - :param pulumi.Input[pulumi.InputType['BranchProtectionRequiredStatusChecksArgs']] required_status_checks: Enforce restrictions for required status checks. See Required Status Checks below for details. - :param pulumi.Input[pulumi.InputType['BranchProtectionRestrictionsArgs']] restrictions: Enforce restrictions for the users and teams that may push to the branch. See Restrictions below for details. + :param pulumi.Input[List[pulumi.Input[pulumi.InputType['BranchProtectionRequiredPullRequestReviewArgs']]]] required_pull_request_reviews: Enforce restrictions for pull request reviews. See Required Pull Request Reviews below for details. + :param pulumi.Input[List[pulumi.Input[pulumi.InputType['BranchProtectionRequiredStatusCheckArgs']]]] required_status_checks: Enforce restrictions for required status checks. See Required Status Checks below for details. """ if __name__ is not None: warnings.warn("explicit use of __name__ is deprecated", DeprecationWarning) @@ -96,18 +59,17 @@ def __init__(__self__, raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource') __props__ = dict() - if branch is None: - raise TypeError("Missing required property 'branch'") - __props__['branch'] = branch __props__['enforce_admins'] = enforce_admins - if repository is None: - raise TypeError("Missing required property 'repository'") - __props__['repository'] = repository + if pattern is None: + raise TypeError("Missing required property 'pattern'") + __props__['pattern'] = pattern + __props__['push_restrictions'] = push_restrictions + if repository_id is None: + raise TypeError("Missing required property 'repository_id'") + __props__['repository_id'] = repository_id __props__['require_signed_commits'] = require_signed_commits __props__['required_pull_request_reviews'] = required_pull_request_reviews __props__['required_status_checks'] = required_status_checks - __props__['restrictions'] = restrictions - __props__['etag'] = None super(BranchProtection, __self__).__init__( 'github:index/branchProtection:BranchProtection', resource_name, @@ -118,14 +80,13 @@ def __init__(__self__, def get(resource_name: str, id: pulumi.Input[str], opts: Optional[pulumi.ResourceOptions] = None, - branch: Optional[pulumi.Input[str]] = None, enforce_admins: Optional[pulumi.Input[bool]] = None, - etag: Optional[pulumi.Input[str]] = None, - repository: Optional[pulumi.Input[str]] = None, + pattern: Optional[pulumi.Input[str]] = None, + push_restrictions: Optional[pulumi.Input[List[pulumi.Input[str]]]] = None, + repository_id: Optional[pulumi.Input[str]] = None, require_signed_commits: Optional[pulumi.Input[bool]] = None, - required_pull_request_reviews: Optional[pulumi.Input[pulumi.InputType['BranchProtectionRequiredPullRequestReviewsArgs']]] = None, - required_status_checks: Optional[pulumi.Input[pulumi.InputType['BranchProtectionRequiredStatusChecksArgs']]] = None, - restrictions: Optional[pulumi.Input[pulumi.InputType['BranchProtectionRestrictionsArgs']]] = None) -> 'BranchProtection': + required_pull_request_reviews: Optional[pulumi.Input[List[pulumi.Input[pulumi.InputType['BranchProtectionRequiredPullRequestReviewArgs']]]]] = None, + required_status_checks: Optional[pulumi.Input[List[pulumi.Input[pulumi.InputType['BranchProtectionRequiredStatusCheckArgs']]]]] = None) -> 'BranchProtection': """ Get an existing BranchProtection resource's state with the given name, id, and optional extra properties used to qualify the lookup. @@ -133,36 +94,27 @@ def get(resource_name: str, :param str resource_name: The unique name of the resulting resource. :param pulumi.Input[str] id: The unique provider ID of the resource to lookup. :param pulumi.ResourceOptions opts: Options for the resource. - :param pulumi.Input[str] branch: The Git branch to protect. :param pulumi.Input[bool] enforce_admins: Boolean, setting this to `true` enforces status checks for repository administrators. - :param pulumi.Input[str] repository: The GitHub repository name. + :param pulumi.Input[str] pattern: Identifies the protection rule pattern. + :param pulumi.Input[List[pulumi.Input[str]]] push_restrictions: The list of actor IDs that may push to the branch. + :param pulumi.Input[str] repository_id: The repository associated with this branch protection rule. :param pulumi.Input[bool] require_signed_commits: Boolean, setting this to `true` requires all commits to be signed with GPG. - :param pulumi.Input[pulumi.InputType['BranchProtectionRequiredPullRequestReviewsArgs']] required_pull_request_reviews: Enforce restrictions for pull request reviews. See Required Pull Request Reviews below for details. - :param pulumi.Input[pulumi.InputType['BranchProtectionRequiredStatusChecksArgs']] required_status_checks: Enforce restrictions for required status checks. See Required Status Checks below for details. - :param pulumi.Input[pulumi.InputType['BranchProtectionRestrictionsArgs']] restrictions: Enforce restrictions for the users and teams that may push to the branch. See Restrictions below for details. + :param pulumi.Input[List[pulumi.Input[pulumi.InputType['BranchProtectionRequiredPullRequestReviewArgs']]]] required_pull_request_reviews: Enforce restrictions for pull request reviews. See Required Pull Request Reviews below for details. + :param pulumi.Input[List[pulumi.Input[pulumi.InputType['BranchProtectionRequiredStatusCheckArgs']]]] required_status_checks: Enforce restrictions for required status checks. See Required Status Checks below for details. """ opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id)) __props__ = dict() - __props__["branch"] = branch __props__["enforce_admins"] = enforce_admins - __props__["etag"] = etag - __props__["repository"] = repository + __props__["pattern"] = pattern + __props__["push_restrictions"] = push_restrictions + __props__["repository_id"] = repository_id __props__["require_signed_commits"] = require_signed_commits __props__["required_pull_request_reviews"] = required_pull_request_reviews __props__["required_status_checks"] = required_status_checks - __props__["restrictions"] = restrictions return BranchProtection(resource_name, opts=opts, __props__=__props__) - @property - @pulumi.getter - def branch(self) -> pulumi.Output[str]: - """ - The Git branch to protect. - """ - return pulumi.get(self, "branch") - @property @pulumi.getter(name="enforceAdmins") def enforce_admins(self) -> pulumi.Output[Optional[bool]]: @@ -173,16 +125,27 @@ def enforce_admins(self) -> pulumi.Output[Optional[bool]]: @property @pulumi.getter - def etag(self) -> pulumi.Output[str]: - return pulumi.get(self, "etag") + def pattern(self) -> pulumi.Output[str]: + """ + Identifies the protection rule pattern. + """ + return pulumi.get(self, "pattern") @property - @pulumi.getter - def repository(self) -> pulumi.Output[str]: + @pulumi.getter(name="pushRestrictions") + def push_restrictions(self) -> pulumi.Output[Optional[List[str]]]: """ - The GitHub repository name. + The list of actor IDs that may push to the branch. """ - return pulumi.get(self, "repository") + return pulumi.get(self, "push_restrictions") + + @property + @pulumi.getter(name="repositoryId") + def repository_id(self) -> pulumi.Output[str]: + """ + The repository associated with this branch protection rule. + """ + return pulumi.get(self, "repository_id") @property @pulumi.getter(name="requireSignedCommits") @@ -194,7 +157,7 @@ def require_signed_commits(self) -> pulumi.Output[Optional[bool]]: @property @pulumi.getter(name="requiredPullRequestReviews") - def required_pull_request_reviews(self) -> pulumi.Output[Optional['outputs.BranchProtectionRequiredPullRequestReviews']]: + def required_pull_request_reviews(self) -> pulumi.Output[Optional[List['outputs.BranchProtectionRequiredPullRequestReview']]]: """ Enforce restrictions for pull request reviews. See Required Pull Request Reviews below for details. """ @@ -202,20 +165,12 @@ def required_pull_request_reviews(self) -> pulumi.Output[Optional['outputs.Branc @property @pulumi.getter(name="requiredStatusChecks") - def required_status_checks(self) -> pulumi.Output[Optional['outputs.BranchProtectionRequiredStatusChecks']]: + def required_status_checks(self) -> pulumi.Output[Optional[List['outputs.BranchProtectionRequiredStatusCheck']]]: """ Enforce restrictions for required status checks. See Required Status Checks below for details. """ return pulumi.get(self, "required_status_checks") - @property - @pulumi.getter - def restrictions(self) -> pulumi.Output[Optional['outputs.BranchProtectionRestrictions']]: - """ - Enforce restrictions for the users and teams that may push to the branch. See Restrictions below for details. - """ - return pulumi.get(self, "restrictions") - def translate_output_property(self, prop): return _tables.CAMEL_TO_SNAKE_CASE_TABLE.get(prop) or prop diff --git a/sdk/python/pulumi_github/outputs.py b/sdk/python/pulumi_github/outputs.py index 02932d36..2580b835 100644 --- a/sdk/python/pulumi_github/outputs.py +++ b/sdk/python/pulumi_github/outputs.py @@ -9,9 +9,8 @@ from . import _utilities, _tables __all__ = [ - 'BranchProtectionRequiredPullRequestReviews', - 'BranchProtectionRequiredStatusChecks', - 'BranchProtectionRestrictions', + 'BranchProtectionRequiredPullRequestReview', + 'BranchProtectionRequiredStatusCheck', 'OrganizationWebhookConfiguration', 'RepositoryTemplate', 'RepositoryWebhookConfiguration', @@ -21,22 +20,16 @@ ] @pulumi.output_type -class BranchProtectionRequiredPullRequestReviews(dict): +class BranchProtectionRequiredPullRequestReview(dict): def __init__(__self__, *, dismiss_stale_reviews: Optional[bool] = None, - dismissal_teams: Optional[List[str]] = None, - dismissal_users: Optional[List[str]] = None, - include_admins: Optional[bool] = None, + dismissal_restrictions: Optional[List[str]] = None, require_code_owner_reviews: Optional[bool] = None, required_approving_review_count: Optional[float] = None): if dismiss_stale_reviews is not None: pulumi.set(__self__, "dismiss_stale_reviews", dismiss_stale_reviews) - if dismissal_teams is not None: - pulumi.set(__self__, "dismissal_teams", dismissal_teams) - if dismissal_users is not None: - pulumi.set(__self__, "dismissal_users", dismissal_users) - if include_admins is not None: - pulumi.set(__self__, "include_admins", include_admins) + if dismissal_restrictions is not None: + pulumi.set(__self__, "dismissal_restrictions", dismissal_restrictions) if require_code_owner_reviews is not None: pulumi.set(__self__, "require_code_owner_reviews", require_code_owner_reviews) if required_approving_review_count is not None: @@ -48,19 +41,9 @@ def dismiss_stale_reviews(self) -> Optional[bool]: return pulumi.get(self, "dismiss_stale_reviews") @property - @pulumi.getter(name="dismissalTeams") - def dismissal_teams(self) -> Optional[List[str]]: - return pulumi.get(self, "dismissal_teams") - - @property - @pulumi.getter(name="dismissalUsers") - def dismissal_users(self) -> Optional[List[str]]: - return pulumi.get(self, "dismissal_users") - - @property - @pulumi.getter(name="includeAdmins") - def include_admins(self) -> Optional[bool]: - return pulumi.get(self, "include_admins") + @pulumi.getter(name="dismissalRestrictions") + def dismissal_restrictions(self) -> Optional[List[str]]: + return pulumi.get(self, "dismissal_restrictions") @property @pulumi.getter(name="requireCodeOwnerReviews") @@ -77,15 +60,12 @@ def _translate_property(self, prop): @pulumi.output_type -class BranchProtectionRequiredStatusChecks(dict): +class BranchProtectionRequiredStatusCheck(dict): def __init__(__self__, *, contexts: Optional[List[str]] = None, - include_admins: Optional[bool] = None, strict: Optional[bool] = None): if contexts is not None: pulumi.set(__self__, "contexts", contexts) - if include_admins is not None: - pulumi.set(__self__, "include_admins", include_admins) if strict is not None: pulumi.set(__self__, "strict", strict) @@ -94,11 +74,6 @@ def __init__(__self__, *, def contexts(self) -> Optional[List[str]]: return pulumi.get(self, "contexts") - @property - @pulumi.getter(name="includeAdmins") - def include_admins(self) -> Optional[bool]: - return pulumi.get(self, "include_admins") - @property @pulumi.getter def strict(self) -> Optional[bool]: @@ -108,38 +83,6 @@ def _translate_property(self, prop): return _tables.CAMEL_TO_SNAKE_CASE_TABLE.get(prop) or prop -@pulumi.output_type -class BranchProtectionRestrictions(dict): - def __init__(__self__, *, - apps: Optional[List[str]] = None, - teams: Optional[List[str]] = None, - users: Optional[List[str]] = None): - if apps is not None: - pulumi.set(__self__, "apps", apps) - if teams is not None: - pulumi.set(__self__, "teams", teams) - if users is not None: - pulumi.set(__self__, "users", users) - - @property - @pulumi.getter - def apps(self) -> Optional[List[str]]: - return pulumi.get(self, "apps") - - @property - @pulumi.getter - def teams(self) -> Optional[List[str]]: - return pulumi.get(self, "teams") - - @property - @pulumi.getter - def users(self) -> Optional[List[str]]: - return pulumi.get(self, "users") - - def _translate_property(self, prop): - return _tables.CAMEL_TO_SNAKE_CASE_TABLE.get(prop) or prop - - @pulumi.output_type class OrganizationWebhookConfiguration(dict): def __init__(__self__, *, diff --git a/sdk/python/pulumi_github/repository.py b/sdk/python/pulumi_github/repository.py index ba0d060c..1dad4367 100644 --- a/sdk/python/pulumi_github/repository.py +++ b/sdk/python/pulumi_github/repository.py @@ -20,6 +20,7 @@ def __init__(__self__, allow_merge_commit: Optional[pulumi.Input[bool]] = None, allow_rebase_merge: Optional[pulumi.Input[bool]] = None, allow_squash_merge: Optional[pulumi.Input[bool]] = None, + archive_on_destroy: Optional[pulumi.Input[bool]] = None, archived: Optional[pulumi.Input[bool]] = None, auto_init: Optional[pulumi.Input[bool]] = None, default_branch: Optional[pulumi.Input[str]] = None, @@ -38,6 +39,7 @@ def __init__(__self__, template: Optional[pulumi.Input[pulumi.InputType['RepositoryTemplateArgs']]] = None, topics: Optional[pulumi.Input[List[pulumi.Input[str]]]] = None, visibility: Optional[pulumi.Input[str]] = None, + vulnerability_alerts: Optional[pulumi.Input[bool]] = None, __props__=None, __name__=None, __opts__=None): @@ -65,6 +67,7 @@ def __init__(__self__, :param pulumi.Input[bool] allow_merge_commit: Set to `false` to disable merge commits on the repository. :param pulumi.Input[bool] allow_rebase_merge: Set to `false` to disable rebase merges on the repository. :param pulumi.Input[bool] allow_squash_merge: Set to `false` to disable squash merges on the repository. + :param pulumi.Input[bool] archive_on_destroy: Set to `true` to archive the repository instead of deleting on destroy. :param pulumi.Input[bool] archived: Specifies if the repository should be archived. Defaults to `false`. **NOTE** Currently, the API does not support unarchiving. :param pulumi.Input[bool] auto_init: Set to `true` to produce an initial commit in the repository. :param pulumi.Input[str] default_branch: The name of the default branch of the repository. **NOTE:** This can only be set after a repository has already been created, @@ -88,6 +91,7 @@ def __init__(__self__, :param pulumi.Input[pulumi.InputType['RepositoryTemplateArgs']] template: Use a template repository to create this resource. See Template Repositories below for details. :param pulumi.Input[List[pulumi.Input[str]]] topics: The list of topics of the repository. :param pulumi.Input[str] visibility: Can be `public` or `private`. If your organization is associated with an enterprise account using GitHub Enterprise Cloud or GitHub Enterprise Server 2.20+, visibility can also be `internal`. The `visibility` parameter overrides the `private` parameter. + :param pulumi.Input[bool] vulnerability_alerts: Set to `true` to enable security alerts for vulnerable dependencies. Enabling requires alerts to be enabled on the owner level. (Note for importing: GitHub enables the alerts on public repos but disables them on private repos by default.) See [GitHub Documentation](https://help.github.com/en/github/managing-security-vulnerabilities/about-security-alerts-for-vulnerable-dependencies) for details. """ if __name__ is not None: warnings.warn("explicit use of __name__ is deprecated", DeprecationWarning) @@ -109,6 +113,7 @@ def __init__(__self__, __props__['allow_merge_commit'] = allow_merge_commit __props__['allow_rebase_merge'] = allow_rebase_merge __props__['allow_squash_merge'] = allow_squash_merge + __props__['archive_on_destroy'] = archive_on_destroy __props__['archived'] = archived __props__['auto_init'] = auto_init __props__['default_branch'] = default_branch @@ -130,6 +135,7 @@ def __init__(__self__, __props__['template'] = template __props__['topics'] = topics __props__['visibility'] = visibility + __props__['vulnerability_alerts'] = vulnerability_alerts __props__['etag'] = None __props__['full_name'] = None __props__['git_clone_url'] = None @@ -151,6 +157,7 @@ def get(resource_name: str, allow_merge_commit: Optional[pulumi.Input[bool]] = None, allow_rebase_merge: Optional[pulumi.Input[bool]] = None, allow_squash_merge: Optional[pulumi.Input[bool]] = None, + archive_on_destroy: Optional[pulumi.Input[bool]] = None, archived: Optional[pulumi.Input[bool]] = None, auto_init: Optional[pulumi.Input[bool]] = None, default_branch: Optional[pulumi.Input[str]] = None, @@ -176,7 +183,8 @@ def get(resource_name: str, svn_url: Optional[pulumi.Input[str]] = None, template: Optional[pulumi.Input[pulumi.InputType['RepositoryTemplateArgs']]] = None, topics: Optional[pulumi.Input[List[pulumi.Input[str]]]] = None, - visibility: Optional[pulumi.Input[str]] = None) -> 'Repository': + visibility: Optional[pulumi.Input[str]] = None, + vulnerability_alerts: Optional[pulumi.Input[bool]] = None) -> 'Repository': """ Get an existing Repository resource's state with the given name, id, and optional extra properties used to qualify the lookup. @@ -187,6 +195,7 @@ def get(resource_name: str, :param pulumi.Input[bool] allow_merge_commit: Set to `false` to disable merge commits on the repository. :param pulumi.Input[bool] allow_rebase_merge: Set to `false` to disable rebase merges on the repository. :param pulumi.Input[bool] allow_squash_merge: Set to `false` to disable squash merges on the repository. + :param pulumi.Input[bool] archive_on_destroy: Set to `true` to archive the repository instead of deleting on destroy. :param pulumi.Input[bool] archived: Specifies if the repository should be archived. Defaults to `false`. **NOTE** Currently, the API does not support unarchiving. :param pulumi.Input[bool] auto_init: Set to `true` to produce an initial commit in the repository. :param pulumi.Input[str] default_branch: The name of the default branch of the repository. **NOTE:** This can only be set after a repository has already been created, @@ -216,6 +225,7 @@ def get(resource_name: str, :param pulumi.Input[pulumi.InputType['RepositoryTemplateArgs']] template: Use a template repository to create this resource. See Template Repositories below for details. :param pulumi.Input[List[pulumi.Input[str]]] topics: The list of topics of the repository. :param pulumi.Input[str] visibility: Can be `public` or `private`. If your organization is associated with an enterprise account using GitHub Enterprise Cloud or GitHub Enterprise Server 2.20+, visibility can also be `internal`. The `visibility` parameter overrides the `private` parameter. + :param pulumi.Input[bool] vulnerability_alerts: Set to `true` to enable security alerts for vulnerable dependencies. Enabling requires alerts to be enabled on the owner level. (Note for importing: GitHub enables the alerts on public repos but disables them on private repos by default.) See [GitHub Documentation](https://help.github.com/en/github/managing-security-vulnerabilities/about-security-alerts-for-vulnerable-dependencies) for details. """ opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id)) @@ -224,6 +234,7 @@ def get(resource_name: str, __props__["allow_merge_commit"] = allow_merge_commit __props__["allow_rebase_merge"] = allow_rebase_merge __props__["allow_squash_merge"] = allow_squash_merge + __props__["archive_on_destroy"] = archive_on_destroy __props__["archived"] = archived __props__["auto_init"] = auto_init __props__["default_branch"] = default_branch @@ -250,6 +261,7 @@ def get(resource_name: str, __props__["template"] = template __props__["topics"] = topics __props__["visibility"] = visibility + __props__["vulnerability_alerts"] = vulnerability_alerts return Repository(resource_name, opts=opts, __props__=__props__) @property @@ -276,6 +288,14 @@ def allow_squash_merge(self) -> pulumi.Output[Optional[bool]]: """ return pulumi.get(self, "allow_squash_merge") + @property + @pulumi.getter(name="archiveOnDestroy") + def archive_on_destroy(self) -> pulumi.Output[Optional[bool]]: + """ + Set to `true` to archive the repository instead of deleting on destroy. + """ + return pulumi.get(self, "archive_on_destroy") + @property @pulumi.getter def archived(self) -> pulumi.Output[Optional[bool]]: @@ -483,6 +503,14 @@ def visibility(self) -> pulumi.Output[str]: """ return pulumi.get(self, "visibility") + @property + @pulumi.getter(name="vulnerabilityAlerts") + def vulnerability_alerts(self) -> pulumi.Output[Optional[bool]]: + """ + Set to `true` to enable security alerts for vulnerable dependencies. Enabling requires alerts to be enabled on the owner level. (Note for importing: GitHub enables the alerts on public repos but disables them on private repos by default.) See [GitHub Documentation](https://help.github.com/en/github/managing-security-vulnerabilities/about-security-alerts-for-vulnerable-dependencies) for details. + """ + return pulumi.get(self, "vulnerability_alerts") + def translate_output_property(self, prop): return _tables.CAMEL_TO_SNAKE_CASE_TABLE.get(prop) or prop diff --git a/sdk/python/pulumi_github/repository_file.py b/sdk/python/pulumi_github/repository_file.py index 9ee35fa8..fb8d1252 100644 --- a/sdk/python/pulumi_github/repository_file.py +++ b/sdk/python/pulumi_github/repository_file.py @@ -21,6 +21,7 @@ def __init__(__self__, commit_message: Optional[pulumi.Input[str]] = None, content: Optional[pulumi.Input[str]] = None, file: Optional[pulumi.Input[str]] = None, + overwrite_on_create: Optional[pulumi.Input[bool]] = None, repository: Optional[pulumi.Input[str]] = None, __props__=None, __name__=None, @@ -35,10 +36,16 @@ def __init__(__self__, import pulumi import pulumi_github as github - gitignore = github.RepositoryFile("gitignore", - content="**/*.tfstate", + foo_repository = github.Repository("fooRepository", auto_init=True) + foo_repository_file = github.RepositoryFile("fooRepositoryFile", + repository=foo_repository.name, + branch="main", file=".gitignore", - repository="example") + content="**/*.tfstate", + commit_message="Managed by Terraform", + commit_author="Terraform User", + commit_email="terraform@example.com", + overwrite_on_create=True) ``` :param str resource_name: The name of the resource. @@ -50,6 +57,7 @@ def __init__(__self__, :param pulumi.Input[str] commit_message: Commit message when adding or updating the managed file. :param pulumi.Input[str] content: The file content. :param pulumi.Input[str] file: The path of the file to manage. + :param pulumi.Input[bool] overwrite_on_create: Enable overwriting existing files :param pulumi.Input[str] repository: The repository name """ if __name__ is not None: @@ -79,6 +87,7 @@ def __init__(__self__, if file is None: raise TypeError("Missing required property 'file'") __props__['file'] = file + __props__['overwrite_on_create'] = overwrite_on_create if repository is None: raise TypeError("Missing required property 'repository'") __props__['repository'] = repository @@ -99,6 +108,7 @@ def get(resource_name: str, commit_message: Optional[pulumi.Input[str]] = None, content: Optional[pulumi.Input[str]] = None, file: Optional[pulumi.Input[str]] = None, + overwrite_on_create: Optional[pulumi.Input[bool]] = None, repository: Optional[pulumi.Input[str]] = None, sha: Optional[pulumi.Input[str]] = None) -> 'RepositoryFile': """ @@ -115,6 +125,7 @@ def get(resource_name: str, :param pulumi.Input[str] commit_message: Commit message when adding or updating the managed file. :param pulumi.Input[str] content: The file content. :param pulumi.Input[str] file: The path of the file to manage. + :param pulumi.Input[bool] overwrite_on_create: Enable overwriting existing files :param pulumi.Input[str] repository: The repository name :param pulumi.Input[str] sha: The SHA blob of the file. """ @@ -128,6 +139,7 @@ def get(resource_name: str, __props__["commit_message"] = commit_message __props__["content"] = content __props__["file"] = file + __props__["overwrite_on_create"] = overwrite_on_create __props__["repository"] = repository __props__["sha"] = sha return RepositoryFile(resource_name, opts=opts, __props__=__props__) @@ -181,6 +193,14 @@ def file(self) -> pulumi.Output[str]: """ return pulumi.get(self, "file") + @property + @pulumi.getter(name="overwriteOnCreate") + def overwrite_on_create(self) -> pulumi.Output[Optional[bool]]: + """ + Enable overwriting existing files + """ + return pulumi.get(self, "overwrite_on_create") + @property @pulumi.getter def repository(self) -> pulumi.Output[str]: