diff --git a/provider/cmd/pulumi-resource-github/bridge-metadata.json b/provider/cmd/pulumi-resource-github/bridge-metadata.json index f8c2fbfd..7a92795d 100644 --- a/provider/cmd/pulumi-resource-github/bridge-metadata.json +++ b/provider/cmd/pulumi-resource-github/bridge-metadata.json @@ -462,6 +462,16 @@ "pull_request": { "maxItemsOne": true }, + "required_code_scanning": { + "maxItemsOne": true, + "elem": { + "fields": { + "required_code_scanning_tool": { + "maxItemsOne": false + } + } + } + }, "required_status_checks": { "maxItemsOne": true, "elem": { @@ -685,6 +695,16 @@ "pull_request": { "maxItemsOne": true }, + "required_code_scanning": { + "maxItemsOne": true, + "elem": { + "fields": { + "required_code_scanning_tool": { + "maxItemsOne": false + } + } + } + }, "required_deployments": { "maxItemsOne": true, "elem": { @@ -713,10 +733,6 @@ } } }, - "github_repository_tag_protection": { - "current": "github:index/repositoryTagProtection:RepositoryTagProtection", - "majorVersion": 6 - }, "github_repository_topics": { "current": "github:index/repositoryTopics:RepositoryTopics", "majorVersion": 6, diff --git a/provider/cmd/pulumi-resource-github/schema.json b/provider/cmd/pulumi-resource-github/schema.json index d3e5e793..f92be86d 100644 --- a/provider/cmd/pulumi-resource-github/schema.json +++ b/provider/cmd/pulumi-resource-github/schema.json @@ -606,6 +606,10 @@ "$ref": "#/types/github:index/OrganizationRulesetRulesPullRequest:OrganizationRulesetRulesPullRequest", "description": "(Block List, Max: 1) Require all commits be made to a non-target branch and submitted via a pull request before they can be merged. (see below for nested schema)\n" }, + "requiredCodeScanning": { + "$ref": "#/types/github:index/OrganizationRulesetRulesRequiredCodeScanning:OrganizationRulesetRulesRequiredCodeScanning", + "description": "(Block List, Max: 1) Define which tools must provide code scanning results before the reference is updated. When configured, code scanning must be enabled and have results for both the commit and the reference being updated. Multiple code scanning tools can be specified. (see below for nested schema)\n" + }, "requiredLinearHistory": { "type": "boolean", "description": "(Boolean) Prevent merge commits from being pushed to matching branches.\n" @@ -758,6 +762,43 @@ }, "type": "object" }, + "github:index/OrganizationRulesetRulesRequiredCodeScanning:OrganizationRulesetRulesRequiredCodeScanning": { + "properties": { + "requiredCodeScanningTools": { + "type": "array", + "items": { + "$ref": "#/types/github:index/OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningTool:OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningTool" + }, + "description": "Tools that must provide code scanning results for this rule to pass.\n" + } + }, + "type": "object", + "required": [ + "requiredCodeScanningTools" + ] + }, + "github:index/OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningTool:OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningTool": { + "properties": { + "alertsThreshold": { + "type": "string", + "description": "The severity level at which code scanning results that raise alerts block a reference update. Can be one of: `none`, `errors`, `errors_and_warnings`, `all`.\n" + }, + "securityAlertsThreshold": { + "type": "string", + "description": "The severity level at which code scanning results that raise security alerts block a reference update. Can be one of: `none`, `critical`, `high_or_higher`, `medium_or_higher`, `all`.\n" + }, + "tool": { + "type": "string", + "description": "The name of a code scanning tool.\n" + } + }, + "type": "object", + "required": [ + "alertsThreshold", + "securityAlertsThreshold", + "tool" + ] + }, "github:index/OrganizationRulesetRulesRequiredStatusChecks:OrganizationRulesetRulesRequiredStatusChecks": { "properties": { "requiredChecks": { @@ -1125,6 +1166,10 @@ "$ref": "#/types/github:index/RepositoryRulesetRulesPullRequest:RepositoryRulesetRulesPullRequest", "description": "(Block List, Max: 1) Require all commits be made to a non-target branch and submitted via a pull request before they can be merged. (see below for nested schema)\n" }, + "requiredCodeScanning": { + "$ref": "#/types/github:index/RepositoryRulesetRulesRequiredCodeScanning:RepositoryRulesetRulesRequiredCodeScanning", + "description": "(Block List, Max: 1) Define which tools must provide code scanning results before the reference is updated. When configured, code scanning must be enabled and have results for both the commit and the reference being updated. Multiple code scanning tools can be specified. (see below for nested schema)\n" + }, "requiredDeployments": { "$ref": "#/types/github:index/RepositoryRulesetRulesRequiredDeployments:RepositoryRulesetRulesRequiredDeployments", "description": "(Block List, Max: 1) Choose which environments must be successfully deployed to before branches can be merged into a branch that matches this rule. (see below for nested schema)\n" @@ -1281,6 +1326,43 @@ }, "type": "object" }, + "github:index/RepositoryRulesetRulesRequiredCodeScanning:RepositoryRulesetRulesRequiredCodeScanning": { + "properties": { + "requiredCodeScanningTools": { + "type": "array", + "items": { + "$ref": "#/types/github:index/RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningTool:RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningTool" + }, + "description": "Tools that must provide code scanning results for this rule to pass.\n" + } + }, + "type": "object", + "required": [ + "requiredCodeScanningTools" + ] + }, + "github:index/RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningTool:RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningTool": { + "properties": { + "alertsThreshold": { + "type": "string", + "description": "The severity level at which code scanning results that raise alerts block a reference update. Can be one of: `none`, `errors`, `errors_and_warnings`, `all`.\n" + }, + "securityAlertsThreshold": { + "type": "string", + "description": "The severity level at which code scanning results that raise security alerts block a reference update. Can be one of: `none`, `critical`, `high_or_higher`, `medium_or_higher`, `all`.\n" + }, + "tool": { + "type": "string", + "description": "The name of a code scanning tool\n" + } + }, + "type": "object", + "required": [ + "alertsThreshold", + "securityAlertsThreshold", + "tool" + ] + }, "github:index/RepositoryRulesetRulesRequiredDeployments:RepositoryRulesetRulesRequiredDeployments": { "properties": { "requiredDeploymentEnvironments": { @@ -8418,11 +8500,11 @@ } }, "github:index/repositoryEnvironmentDeploymentPolicy:RepositoryEnvironmentDeploymentPolicy": { - "description": "This resource allows you to create and manage environment deployment branch policies for a GitHub repository.\n\n## Example Usage\n\n\u003c!--Start PulumiCodeChooser --\u003e\n```typescript\nimport * as pulumi from \"@pulumi/pulumi\";\nimport * as github from \"@pulumi/github\";\n\nconst current = github.getUser({\n username: \"\",\n});\nconst test = new github.Repository(\"test\", {name: \"tf-acc-test-%s\"});\nconst testRepositoryEnvironment = new github.RepositoryEnvironment(\"test\", {\n repository: test.name,\n environment: \"environment/test\",\n waitTimer: 10000,\n reviewers: [{\n users: [current.then(current =\u003e current.id)],\n }],\n deploymentBranchPolicy: {\n protectedBranches: false,\n customBranchPolicies: true,\n },\n});\nconst testRepositoryEnvironmentDeploymentPolicy = new github.RepositoryEnvironmentDeploymentPolicy(\"test\", {\n repository: test.name,\n environment: testRepositoryEnvironment.environment,\n branchPattern: \"releases/*\",\n});\n```\n```python\nimport pulumi\nimport pulumi_github as github\n\ncurrent = github.get_user(username=\"\")\ntest = github.Repository(\"test\", name=\"tf-acc-test-%s\")\ntest_repository_environment = github.RepositoryEnvironment(\"test\",\n repository=test.name,\n environment=\"environment/test\",\n wait_timer=10000,\n reviewers=[{\n \"users\": [current.id],\n }],\n deployment_branch_policy={\n \"protected_branches\": False,\n \"custom_branch_policies\": True,\n })\ntest_repository_environment_deployment_policy = github.RepositoryEnvironmentDeploymentPolicy(\"test\",\n repository=test.name,\n environment=test_repository_environment.environment,\n branch_pattern=\"releases/*\")\n```\n```csharp\nusing System.Collections.Generic;\nusing System.Linq;\nusing Pulumi;\nusing Github = Pulumi.Github;\n\nreturn await Deployment.RunAsync(() =\u003e \n{\n var current = Github.GetUser.Invoke(new()\n {\n Username = \"\",\n });\n\n var test = new Github.Repository(\"test\", new()\n {\n Name = \"tf-acc-test-%s\",\n });\n\n var testRepositoryEnvironment = new Github.RepositoryEnvironment(\"test\", new()\n {\n Repository = test.Name,\n Environment = \"environment/test\",\n WaitTimer = 10000,\n Reviewers = new[]\n {\n new Github.Inputs.RepositoryEnvironmentReviewerArgs\n {\n Users = new[]\n {\n current.Apply(getUserResult =\u003e getUserResult.Id),\n },\n },\n },\n DeploymentBranchPolicy = new Github.Inputs.RepositoryEnvironmentDeploymentBranchPolicyArgs\n {\n ProtectedBranches = false,\n CustomBranchPolicies = true,\n },\n });\n\n var testRepositoryEnvironmentDeploymentPolicy = new Github.RepositoryEnvironmentDeploymentPolicy(\"test\", new()\n {\n Repository = test.Name,\n Environment = testRepositoryEnvironment.Environment,\n BranchPattern = \"releases/*\",\n });\n\n});\n```\n```go\npackage main\n\nimport (\n\t\"github.com/pulumi/pulumi-github/sdk/v6/go/github\"\n\t\"github.com/pulumi/pulumi/sdk/v3/go/pulumi\"\n)\n\nfunc main() {\n\tpulumi.Run(func(ctx *pulumi.Context) error {\n\t\tcurrent, err := github.GetUser(ctx, \u0026github.GetUserArgs{\n\t\t\tUsername: \"\",\n\t\t}, nil)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\ttest, err := github.NewRepository(ctx, \"test\", \u0026github.RepositoryArgs{\n\t\t\tName: pulumi.String(\"tf-acc-test-%s\"),\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\ttestRepositoryEnvironment, err := github.NewRepositoryEnvironment(ctx, \"test\", \u0026github.RepositoryEnvironmentArgs{\n\t\t\tRepository: test.Name,\n\t\t\tEnvironment: pulumi.String(\"environment/test\"),\n\t\t\tWaitTimer: pulumi.Int(10000),\n\t\t\tReviewers: github.RepositoryEnvironmentReviewerArray{\n\t\t\t\t\u0026github.RepositoryEnvironmentReviewerArgs{\n\t\t\t\t\tUsers: pulumi.IntArray{\n\t\t\t\t\t\tpulumi.String(current.Id),\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\tDeploymentBranchPolicy: \u0026github.RepositoryEnvironmentDeploymentBranchPolicyArgs{\n\t\t\t\tProtectedBranches: pulumi.Bool(false),\n\t\t\t\tCustomBranchPolicies: pulumi.Bool(true),\n\t\t\t},\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\t_, err = github.NewRepositoryEnvironmentDeploymentPolicy(ctx, \"test\", \u0026github.RepositoryEnvironmentDeploymentPolicyArgs{\n\t\t\tRepository: test.Name,\n\t\t\tEnvironment: testRepositoryEnvironment.Environment,\n\t\t\tBranchPattern: pulumi.String(\"releases/*\"),\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```java\npackage generated_program;\n\nimport com.pulumi.Context;\nimport com.pulumi.Pulumi;\nimport com.pulumi.core.Output;\nimport com.pulumi.github.GithubFunctions;\nimport com.pulumi.github.inputs.GetUserArgs;\nimport com.pulumi.github.Repository;\nimport com.pulumi.github.RepositoryArgs;\nimport com.pulumi.github.RepositoryEnvironment;\nimport com.pulumi.github.RepositoryEnvironmentArgs;\nimport com.pulumi.github.inputs.RepositoryEnvironmentReviewerArgs;\nimport com.pulumi.github.inputs.RepositoryEnvironmentDeploymentBranchPolicyArgs;\nimport com.pulumi.github.RepositoryEnvironmentDeploymentPolicy;\nimport com.pulumi.github.RepositoryEnvironmentDeploymentPolicyArgs;\nimport java.util.List;\nimport java.util.ArrayList;\nimport java.util.Map;\nimport java.io.File;\nimport java.nio.file.Files;\nimport java.nio.file.Paths;\n\npublic class App {\n public static void main(String[] args) {\n Pulumi.run(App::stack);\n }\n\n public static void stack(Context ctx) {\n final var current = GithubFunctions.getUser(GetUserArgs.builder()\n .username(\"\")\n .build());\n\n var test = new Repository(\"test\", RepositoryArgs.builder()\n .name(\"tf-acc-test-%s\")\n .build());\n\n var testRepositoryEnvironment = new RepositoryEnvironment(\"testRepositoryEnvironment\", RepositoryEnvironmentArgs.builder()\n .repository(test.name())\n .environment(\"environment/test\")\n .waitTimer(10000)\n .reviewers(RepositoryEnvironmentReviewerArgs.builder()\n .users(current.applyValue(getUserResult -\u003e getUserResult.id()))\n .build())\n .deploymentBranchPolicy(RepositoryEnvironmentDeploymentBranchPolicyArgs.builder()\n .protectedBranches(false)\n .customBranchPolicies(true)\n .build())\n .build());\n\n var testRepositoryEnvironmentDeploymentPolicy = new RepositoryEnvironmentDeploymentPolicy(\"testRepositoryEnvironmentDeploymentPolicy\", RepositoryEnvironmentDeploymentPolicyArgs.builder()\n .repository(test.name())\n .environment(testRepositoryEnvironment.environment())\n .branchPattern(\"releases/*\")\n .build());\n\n }\n}\n```\n```yaml\nresources:\n test:\n type: github:Repository\n properties:\n name: tf-acc-test-%s\n testRepositoryEnvironment:\n type: github:RepositoryEnvironment\n name: test\n properties:\n repository: ${test.name}\n environment: environment/test\n waitTimer: 10000\n reviewers:\n - users:\n - ${current.id}\n deploymentBranchPolicy:\n protectedBranches: false\n customBranchPolicies: true\n testRepositoryEnvironmentDeploymentPolicy:\n type: github:RepositoryEnvironmentDeploymentPolicy\n name: test\n properties:\n repository: ${test.name}\n environment: ${testRepositoryEnvironment.environment}\n branchPattern: releases/*\nvariables:\n current:\n fn::invoke:\n Function: github:getUser\n Arguments:\n username:\n```\n\u003c!--End PulumiCodeChooser --\u003e\n\n## Import\n\nGitHub Repository Environment Deployment Policy can be imported using an ID made up of `name` of the repository combined with the `environment` name of the environment with the `Id` of the deployment policy, separated by a `:` character, e.g.\n\n```sh\n$ pulumi import github:index/repositoryEnvironmentDeploymentPolicy:RepositoryEnvironmentDeploymentPolicy daily terraform:daily:123456\n```\n", + "description": "This resource allows you to create and manage environment deployment branch policies for a GitHub repository.\n\n## Example Usage\n\nCreate a branch-based deployment policy:\n\n\u003c!--Start PulumiCodeChooser --\u003e\n```typescript\nimport * as pulumi from \"@pulumi/pulumi\";\nimport * as github from \"@pulumi/github\";\n\nconst current = github.getUser({\n username: \"\",\n});\nconst test = new github.Repository(\"test\", {name: \"tf-acc-test-%s\"});\nconst testRepositoryEnvironment = new github.RepositoryEnvironment(\"test\", {\n repository: test.name,\n environment: \"environment/test\",\n waitTimer: 10000,\n reviewers: [{\n users: [current.then(current =\u003e current.id)],\n }],\n deploymentBranchPolicy: {\n protectedBranches: false,\n customBranchPolicies: true,\n },\n});\nconst testRepositoryEnvironmentDeploymentPolicy = new github.RepositoryEnvironmentDeploymentPolicy(\"test\", {\n repository: test.name,\n environment: testRepositoryEnvironment.environment,\n branchPattern: \"releases/*\",\n});\n```\n```python\nimport pulumi\nimport pulumi_github as github\n\ncurrent = github.get_user(username=\"\")\ntest = github.Repository(\"test\", name=\"tf-acc-test-%s\")\ntest_repository_environment = github.RepositoryEnvironment(\"test\",\n repository=test.name,\n environment=\"environment/test\",\n wait_timer=10000,\n reviewers=[{\n \"users\": [current.id],\n }],\n deployment_branch_policy={\n \"protected_branches\": False,\n \"custom_branch_policies\": True,\n })\ntest_repository_environment_deployment_policy = github.RepositoryEnvironmentDeploymentPolicy(\"test\",\n repository=test.name,\n environment=test_repository_environment.environment,\n branch_pattern=\"releases/*\")\n```\n```csharp\nusing System.Collections.Generic;\nusing System.Linq;\nusing Pulumi;\nusing Github = Pulumi.Github;\n\nreturn await Deployment.RunAsync(() =\u003e \n{\n var current = Github.GetUser.Invoke(new()\n {\n Username = \"\",\n });\n\n var test = new Github.Repository(\"test\", new()\n {\n Name = \"tf-acc-test-%s\",\n });\n\n var testRepositoryEnvironment = new Github.RepositoryEnvironment(\"test\", new()\n {\n Repository = test.Name,\n Environment = \"environment/test\",\n WaitTimer = 10000,\n Reviewers = new[]\n {\n new Github.Inputs.RepositoryEnvironmentReviewerArgs\n {\n Users = new[]\n {\n current.Apply(getUserResult =\u003e getUserResult.Id),\n },\n },\n },\n DeploymentBranchPolicy = new Github.Inputs.RepositoryEnvironmentDeploymentBranchPolicyArgs\n {\n ProtectedBranches = false,\n CustomBranchPolicies = true,\n },\n });\n\n var testRepositoryEnvironmentDeploymentPolicy = new Github.RepositoryEnvironmentDeploymentPolicy(\"test\", new()\n {\n Repository = test.Name,\n Environment = testRepositoryEnvironment.Environment,\n BranchPattern = \"releases/*\",\n });\n\n});\n```\n```go\npackage main\n\nimport (\n\t\"github.com/pulumi/pulumi-github/sdk/v6/go/github\"\n\t\"github.com/pulumi/pulumi/sdk/v3/go/pulumi\"\n)\n\nfunc main() {\n\tpulumi.Run(func(ctx *pulumi.Context) error {\n\t\tcurrent, err := github.GetUser(ctx, \u0026github.GetUserArgs{\n\t\t\tUsername: \"\",\n\t\t}, nil)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\ttest, err := github.NewRepository(ctx, \"test\", \u0026github.RepositoryArgs{\n\t\t\tName: pulumi.String(\"tf-acc-test-%s\"),\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\ttestRepositoryEnvironment, err := github.NewRepositoryEnvironment(ctx, \"test\", \u0026github.RepositoryEnvironmentArgs{\n\t\t\tRepository: test.Name,\n\t\t\tEnvironment: pulumi.String(\"environment/test\"),\n\t\t\tWaitTimer: pulumi.Int(10000),\n\t\t\tReviewers: github.RepositoryEnvironmentReviewerArray{\n\t\t\t\t\u0026github.RepositoryEnvironmentReviewerArgs{\n\t\t\t\t\tUsers: pulumi.IntArray{\n\t\t\t\t\t\tpulumi.String(current.Id),\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\tDeploymentBranchPolicy: \u0026github.RepositoryEnvironmentDeploymentBranchPolicyArgs{\n\t\t\t\tProtectedBranches: pulumi.Bool(false),\n\t\t\t\tCustomBranchPolicies: pulumi.Bool(true),\n\t\t\t},\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\t_, err = github.NewRepositoryEnvironmentDeploymentPolicy(ctx, \"test\", \u0026github.RepositoryEnvironmentDeploymentPolicyArgs{\n\t\t\tRepository: test.Name,\n\t\t\tEnvironment: testRepositoryEnvironment.Environment,\n\t\t\tBranchPattern: pulumi.String(\"releases/*\"),\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```java\npackage generated_program;\n\nimport com.pulumi.Context;\nimport com.pulumi.Pulumi;\nimport com.pulumi.core.Output;\nimport com.pulumi.github.GithubFunctions;\nimport com.pulumi.github.inputs.GetUserArgs;\nimport com.pulumi.github.Repository;\nimport com.pulumi.github.RepositoryArgs;\nimport com.pulumi.github.RepositoryEnvironment;\nimport com.pulumi.github.RepositoryEnvironmentArgs;\nimport com.pulumi.github.inputs.RepositoryEnvironmentReviewerArgs;\nimport com.pulumi.github.inputs.RepositoryEnvironmentDeploymentBranchPolicyArgs;\nimport com.pulumi.github.RepositoryEnvironmentDeploymentPolicy;\nimport com.pulumi.github.RepositoryEnvironmentDeploymentPolicyArgs;\nimport java.util.List;\nimport java.util.ArrayList;\nimport java.util.Map;\nimport java.io.File;\nimport java.nio.file.Files;\nimport java.nio.file.Paths;\n\npublic class App {\n public static void main(String[] args) {\n Pulumi.run(App::stack);\n }\n\n public static void stack(Context ctx) {\n final var current = GithubFunctions.getUser(GetUserArgs.builder()\n .username(\"\")\n .build());\n\n var test = new Repository(\"test\", RepositoryArgs.builder()\n .name(\"tf-acc-test-%s\")\n .build());\n\n var testRepositoryEnvironment = new RepositoryEnvironment(\"testRepositoryEnvironment\", RepositoryEnvironmentArgs.builder()\n .repository(test.name())\n .environment(\"environment/test\")\n .waitTimer(10000)\n .reviewers(RepositoryEnvironmentReviewerArgs.builder()\n .users(current.applyValue(getUserResult -\u003e getUserResult.id()))\n .build())\n .deploymentBranchPolicy(RepositoryEnvironmentDeploymentBranchPolicyArgs.builder()\n .protectedBranches(false)\n .customBranchPolicies(true)\n .build())\n .build());\n\n var testRepositoryEnvironmentDeploymentPolicy = new RepositoryEnvironmentDeploymentPolicy(\"testRepositoryEnvironmentDeploymentPolicy\", RepositoryEnvironmentDeploymentPolicyArgs.builder()\n .repository(test.name())\n .environment(testRepositoryEnvironment.environment())\n .branchPattern(\"releases/*\")\n .build());\n\n }\n}\n```\n```yaml\nresources:\n test:\n type: github:Repository\n properties:\n name: tf-acc-test-%s\n testRepositoryEnvironment:\n type: github:RepositoryEnvironment\n name: test\n properties:\n repository: ${test.name}\n environment: environment/test\n waitTimer: 10000\n reviewers:\n - users:\n - ${current.id}\n deploymentBranchPolicy:\n protectedBranches: false\n customBranchPolicies: true\n testRepositoryEnvironmentDeploymentPolicy:\n type: github:RepositoryEnvironmentDeploymentPolicy\n name: test\n properties:\n repository: ${test.name}\n environment: ${testRepositoryEnvironment.environment}\n branchPattern: releases/*\nvariables:\n current:\n fn::invoke:\n Function: github:getUser\n Arguments:\n username:\n```\n\u003c!--End PulumiCodeChooser --\u003e\n\nCreate a tag-based deployment policy:\n\n\u003c!--Start PulumiCodeChooser --\u003e\n```typescript\nimport * as pulumi from \"@pulumi/pulumi\";\nimport * as github from \"@pulumi/github\";\n\nconst current = github.getUser({\n username: \"\",\n});\nconst test = new github.Repository(\"test\", {name: \"tf-acc-test-%s\"});\nconst testRepositoryEnvironment = new github.RepositoryEnvironment(\"test\", {\n repository: test.name,\n environment: \"environment/test\",\n waitTimer: 10000,\n reviewers: [{\n users: [current.then(current =\u003e current.id)],\n }],\n deploymentBranchPolicy: {\n protectedBranches: false,\n customBranchPolicies: true,\n },\n});\nconst testRepositoryEnvironmentDeploymentPolicy = new github.RepositoryEnvironmentDeploymentPolicy(\"test\", {\n repository: test.name,\n environment: testRepositoryEnvironment.environment,\n tagPattern: \"v*\",\n});\n```\n```python\nimport pulumi\nimport pulumi_github as github\n\ncurrent = github.get_user(username=\"\")\ntest = github.Repository(\"test\", name=\"tf-acc-test-%s\")\ntest_repository_environment = github.RepositoryEnvironment(\"test\",\n repository=test.name,\n environment=\"environment/test\",\n wait_timer=10000,\n reviewers=[{\n \"users\": [current.id],\n }],\n deployment_branch_policy={\n \"protected_branches\": False,\n \"custom_branch_policies\": True,\n })\ntest_repository_environment_deployment_policy = github.RepositoryEnvironmentDeploymentPolicy(\"test\",\n repository=test.name,\n environment=test_repository_environment.environment,\n tag_pattern=\"v*\")\n```\n```csharp\nusing System.Collections.Generic;\nusing System.Linq;\nusing Pulumi;\nusing Github = Pulumi.Github;\n\nreturn await Deployment.RunAsync(() =\u003e \n{\n var current = Github.GetUser.Invoke(new()\n {\n Username = \"\",\n });\n\n var test = new Github.Repository(\"test\", new()\n {\n Name = \"tf-acc-test-%s\",\n });\n\n var testRepositoryEnvironment = new Github.RepositoryEnvironment(\"test\", new()\n {\n Repository = test.Name,\n Environment = \"environment/test\",\n WaitTimer = 10000,\n Reviewers = new[]\n {\n new Github.Inputs.RepositoryEnvironmentReviewerArgs\n {\n Users = new[]\n {\n current.Apply(getUserResult =\u003e getUserResult.Id),\n },\n },\n },\n DeploymentBranchPolicy = new Github.Inputs.RepositoryEnvironmentDeploymentBranchPolicyArgs\n {\n ProtectedBranches = false,\n CustomBranchPolicies = true,\n },\n });\n\n var testRepositoryEnvironmentDeploymentPolicy = new Github.RepositoryEnvironmentDeploymentPolicy(\"test\", new()\n {\n Repository = test.Name,\n Environment = testRepositoryEnvironment.Environment,\n TagPattern = \"v*\",\n });\n\n});\n```\n```go\npackage main\n\nimport (\n\t\"github.com/pulumi/pulumi-github/sdk/v6/go/github\"\n\t\"github.com/pulumi/pulumi/sdk/v3/go/pulumi\"\n)\n\nfunc main() {\n\tpulumi.Run(func(ctx *pulumi.Context) error {\n\t\tcurrent, err := github.GetUser(ctx, \u0026github.GetUserArgs{\n\t\t\tUsername: \"\",\n\t\t}, nil)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\ttest, err := github.NewRepository(ctx, \"test\", \u0026github.RepositoryArgs{\n\t\t\tName: pulumi.String(\"tf-acc-test-%s\"),\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\ttestRepositoryEnvironment, err := github.NewRepositoryEnvironment(ctx, \"test\", \u0026github.RepositoryEnvironmentArgs{\n\t\t\tRepository: test.Name,\n\t\t\tEnvironment: pulumi.String(\"environment/test\"),\n\t\t\tWaitTimer: pulumi.Int(10000),\n\t\t\tReviewers: github.RepositoryEnvironmentReviewerArray{\n\t\t\t\t\u0026github.RepositoryEnvironmentReviewerArgs{\n\t\t\t\t\tUsers: pulumi.IntArray{\n\t\t\t\t\t\tpulumi.String(current.Id),\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\tDeploymentBranchPolicy: \u0026github.RepositoryEnvironmentDeploymentBranchPolicyArgs{\n\t\t\t\tProtectedBranches: pulumi.Bool(false),\n\t\t\t\tCustomBranchPolicies: pulumi.Bool(true),\n\t\t\t},\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\t_, err = github.NewRepositoryEnvironmentDeploymentPolicy(ctx, \"test\", \u0026github.RepositoryEnvironmentDeploymentPolicyArgs{\n\t\t\tRepository: test.Name,\n\t\t\tEnvironment: testRepositoryEnvironment.Environment,\n\t\t\tTagPattern: pulumi.String(\"v*\"),\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```java\npackage generated_program;\n\nimport com.pulumi.Context;\nimport com.pulumi.Pulumi;\nimport com.pulumi.core.Output;\nimport com.pulumi.github.GithubFunctions;\nimport com.pulumi.github.inputs.GetUserArgs;\nimport com.pulumi.github.Repository;\nimport com.pulumi.github.RepositoryArgs;\nimport com.pulumi.github.RepositoryEnvironment;\nimport com.pulumi.github.RepositoryEnvironmentArgs;\nimport com.pulumi.github.inputs.RepositoryEnvironmentReviewerArgs;\nimport com.pulumi.github.inputs.RepositoryEnvironmentDeploymentBranchPolicyArgs;\nimport com.pulumi.github.RepositoryEnvironmentDeploymentPolicy;\nimport com.pulumi.github.RepositoryEnvironmentDeploymentPolicyArgs;\nimport java.util.List;\nimport java.util.ArrayList;\nimport java.util.Map;\nimport java.io.File;\nimport java.nio.file.Files;\nimport java.nio.file.Paths;\n\npublic class App {\n public static void main(String[] args) {\n Pulumi.run(App::stack);\n }\n\n public static void stack(Context ctx) {\n final var current = GithubFunctions.getUser(GetUserArgs.builder()\n .username(\"\")\n .build());\n\n var test = new Repository(\"test\", RepositoryArgs.builder()\n .name(\"tf-acc-test-%s\")\n .build());\n\n var testRepositoryEnvironment = new RepositoryEnvironment(\"testRepositoryEnvironment\", RepositoryEnvironmentArgs.builder()\n .repository(test.name())\n .environment(\"environment/test\")\n .waitTimer(10000)\n .reviewers(RepositoryEnvironmentReviewerArgs.builder()\n .users(current.applyValue(getUserResult -\u003e getUserResult.id()))\n .build())\n .deploymentBranchPolicy(RepositoryEnvironmentDeploymentBranchPolicyArgs.builder()\n .protectedBranches(false)\n .customBranchPolicies(true)\n .build())\n .build());\n\n var testRepositoryEnvironmentDeploymentPolicy = new RepositoryEnvironmentDeploymentPolicy(\"testRepositoryEnvironmentDeploymentPolicy\", RepositoryEnvironmentDeploymentPolicyArgs.builder()\n .repository(test.name())\n .environment(testRepositoryEnvironment.environment())\n .tagPattern(\"v*\")\n .build());\n\n }\n}\n```\n```yaml\nresources:\n test:\n type: github:Repository\n properties:\n name: tf-acc-test-%s\n testRepositoryEnvironment:\n type: github:RepositoryEnvironment\n name: test\n properties:\n repository: ${test.name}\n environment: environment/test\n waitTimer: 10000\n reviewers:\n - users:\n - ${current.id}\n deploymentBranchPolicy:\n protectedBranches: false\n customBranchPolicies: true\n testRepositoryEnvironmentDeploymentPolicy:\n type: github:RepositoryEnvironmentDeploymentPolicy\n name: test\n properties:\n repository: ${test.name}\n environment: ${testRepositoryEnvironment.environment}\n tagPattern: v*\nvariables:\n current:\n fn::invoke:\n Function: github:getUser\n Arguments:\n username:\n```\n\u003c!--End PulumiCodeChooser --\u003e\n\n## Import\n\nGitHub Repository Environment Deployment Policy can be imported using an ID made up of `name` of the repository combined with the `environment` name of the environment with the `Id` of the deployment policy, separated by a `:` character, e.g.\n\n```sh\n$ pulumi import github:index/repositoryEnvironmentDeploymentPolicy:RepositoryEnvironmentDeploymentPolicy daily terraform:daily:123456\n```\n", "properties": { "branchPattern": { "type": "string", - "description": "The name pattern that branches must match in order to deploy to the environment.\n" + "description": "The name pattern that branches must match in order to deploy to the environment. If not specified, `tag_pattern` must be specified.\n" }, "environment": { "type": "string", @@ -8431,17 +8513,20 @@ "repository": { "type": "string", "description": "The repository of the environment.\n" + }, + "tagPattern": { + "type": "string", + "description": "The name pattern that tags must match in order to deploy to the environment. If not specified, `branch_pattern` must be specified.\n" } }, "required": [ - "branchPattern", "environment", "repository" ], "inputProperties": { "branchPattern": { "type": "string", - "description": "The name pattern that branches must match in order to deploy to the environment.\n" + "description": "The name pattern that branches must match in order to deploy to the environment. If not specified, `tag_pattern` must be specified.\n" }, "environment": { "type": "string", @@ -8452,10 +8537,13 @@ "type": "string", "description": "The repository of the environment.\n", "willReplaceOnChanges": true + }, + "tagPattern": { + "type": "string", + "description": "The name pattern that tags must match in order to deploy to the environment. If not specified, `branch_pattern` must be specified.\n" } }, "requiredInputs": [ - "branchPattern", "environment", "repository" ], @@ -8464,7 +8552,7 @@ "properties": { "branchPattern": { "type": "string", - "description": "The name pattern that branches must match in order to deploy to the environment.\n" + "description": "The name pattern that branches must match in order to deploy to the environment. If not specified, `tag_pattern` must be specified.\n" }, "environment": { "type": "string", @@ -8475,6 +8563,10 @@ "type": "string", "description": "The repository of the environment.\n", "willReplaceOnChanges": true + }, + "tagPattern": { + "type": "string", + "description": "The name pattern that tags must match in order to deploy to the environment. If not specified, `branch_pattern` must be specified.\n" } }, "type": "object" @@ -9195,64 +9287,6 @@ "type": "object" } }, - "github:index/repositoryTagProtection:RepositoryTagProtection": { - "description": "This resource allows you to create and manage a repository tag protection for repositories within your GitHub organization or personal account.\n\n## Example Usage\n\n\u003c!--Start PulumiCodeChooser --\u003e\n```typescript\nimport * as pulumi from \"@pulumi/pulumi\";\nimport * as github from \"@pulumi/github\";\n\nconst example = new github.RepositoryTagProtection(\"example\", {\n repository: \"example-repository\",\n pattern: \"v*\",\n});\n```\n```python\nimport pulumi\nimport pulumi_github as github\n\nexample = github.RepositoryTagProtection(\"example\",\n repository=\"example-repository\",\n pattern=\"v*\")\n```\n```csharp\nusing System.Collections.Generic;\nusing System.Linq;\nusing Pulumi;\nusing Github = Pulumi.Github;\n\nreturn await Deployment.RunAsync(() =\u003e \n{\n var example = new Github.RepositoryTagProtection(\"example\", new()\n {\n Repository = \"example-repository\",\n Pattern = \"v*\",\n });\n\n});\n```\n```go\npackage main\n\nimport (\n\t\"github.com/pulumi/pulumi-github/sdk/v6/go/github\"\n\t\"github.com/pulumi/pulumi/sdk/v3/go/pulumi\"\n)\n\nfunc main() {\n\tpulumi.Run(func(ctx *pulumi.Context) error {\n\t\t_, err := github.NewRepositoryTagProtection(ctx, \"example\", \u0026github.RepositoryTagProtectionArgs{\n\t\t\tRepository: pulumi.String(\"example-repository\"),\n\t\t\tPattern: pulumi.String(\"v*\"),\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```java\npackage generated_program;\n\nimport com.pulumi.Context;\nimport com.pulumi.Pulumi;\nimport com.pulumi.core.Output;\nimport com.pulumi.github.RepositoryTagProtection;\nimport com.pulumi.github.RepositoryTagProtectionArgs;\nimport java.util.List;\nimport java.util.ArrayList;\nimport java.util.Map;\nimport java.io.File;\nimport java.nio.file.Files;\nimport java.nio.file.Paths;\n\npublic class App {\n public static void main(String[] args) {\n Pulumi.run(App::stack);\n }\n\n public static void stack(Context ctx) {\n var example = new RepositoryTagProtection(\"example\", RepositoryTagProtectionArgs.builder()\n .repository(\"example-repository\")\n .pattern(\"v*\")\n .build());\n\n }\n}\n```\n```yaml\nresources:\n example:\n type: github:RepositoryTagProtection\n properties:\n repository: example-repository\n pattern: v*\n```\n\u003c!--End PulumiCodeChooser --\u003e\n\n## Import\n\nRepository tag protections can be imported using the `name` of the repository, combined with the `id` of the tag protection, separated by a `/` character.\nThe `id` of the tag protection can be found using the [GitHub API](https://docs.github.com/en/rest/repos/tags#list-tag-protection-states-for-a-repository).\n\nImporting uses the name of the repository, as well as the ID of the tag protection, e.g.\n\n```sh\n$ pulumi import github:index/repositoryTagProtection:RepositoryTagProtection terraform my-repo/31077\n```\n", - "properties": { - "pattern": { - "type": "string", - "description": "The pattern of the tag to protect.\n" - }, - "repository": { - "type": "string", - "description": "Name of the repository to add the tag protection to.\n" - }, - "tagProtectionId": { - "type": "integer", - "description": "The ID of the tag protection.\n" - } - }, - "required": [ - "pattern", - "repository", - "tagProtectionId" - ], - "inputProperties": { - "pattern": { - "type": "string", - "description": "The pattern of the tag to protect.\n", - "willReplaceOnChanges": true - }, - "repository": { - "type": "string", - "description": "Name of the repository to add the tag protection to.\n", - "willReplaceOnChanges": true - } - }, - "requiredInputs": [ - "pattern", - "repository" - ], - "stateInputs": { - "description": "Input properties used for looking up and filtering RepositoryTagProtection resources.\n", - "properties": { - "pattern": { - "type": "string", - "description": "The pattern of the tag to protect.\n", - "willReplaceOnChanges": true - }, - "repository": { - "type": "string", - "description": "Name of the repository to add the tag protection to.\n", - "willReplaceOnChanges": true - }, - "tagProtectionId": { - "type": "integer", - "description": "The ID of the tag protection.\n" - } - }, - "type": "object" - } - }, "github:index/repositoryTopics:RepositoryTopics": { "description": "## Example Usage\n\n\u003c!--Start PulumiCodeChooser --\u003e\n```typescript\nimport * as pulumi from \"@pulumi/pulumi\";\nimport * as github from \"@pulumi/github\";\n\nconst test = github.getRepository({\n name: \"test\",\n});\nconst testRepositoryTopics = new github.RepositoryTopics(\"test\", {\n repository: testGithubRepository.name,\n topics: [\n \"topic-1\",\n \"topic-2\",\n ],\n});\n```\n```python\nimport pulumi\nimport pulumi_github as github\n\ntest = github.get_repository(name=\"test\")\ntest_repository_topics = github.RepositoryTopics(\"test\",\n repository=test_github_repository[\"name\"],\n topics=[\n \"topic-1\",\n \"topic-2\",\n ])\n```\n```csharp\nusing System.Collections.Generic;\nusing System.Linq;\nusing Pulumi;\nusing Github = Pulumi.Github;\n\nreturn await Deployment.RunAsync(() =\u003e \n{\n var test = Github.GetRepository.Invoke(new()\n {\n Name = \"test\",\n });\n\n var testRepositoryTopics = new Github.RepositoryTopics(\"test\", new()\n {\n Repository = testGithubRepository.Name,\n Topics = new[]\n {\n \"topic-1\",\n \"topic-2\",\n },\n });\n\n});\n```\n```go\npackage main\n\nimport (\n\t\"github.com/pulumi/pulumi-github/sdk/v6/go/github\"\n\t\"github.com/pulumi/pulumi/sdk/v3/go/pulumi\"\n)\n\nfunc main() {\n\tpulumi.Run(func(ctx *pulumi.Context) error {\n\t\t_, err := github.LookupRepository(ctx, \u0026github.LookupRepositoryArgs{\n\t\t\tName: pulumi.StringRef(\"test\"),\n\t\t}, nil)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\t_, err = github.NewRepositoryTopics(ctx, \"test\", \u0026github.RepositoryTopicsArgs{\n\t\t\tRepository: pulumi.Any(testGithubRepository.Name),\n\t\t\tTopics: pulumi.StringArray{\n\t\t\t\tpulumi.String(\"topic-1\"),\n\t\t\t\tpulumi.String(\"topic-2\"),\n\t\t\t},\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```java\npackage generated_program;\n\nimport com.pulumi.Context;\nimport com.pulumi.Pulumi;\nimport com.pulumi.core.Output;\nimport com.pulumi.github.GithubFunctions;\nimport com.pulumi.github.inputs.GetRepositoryArgs;\nimport com.pulumi.github.RepositoryTopics;\nimport com.pulumi.github.RepositoryTopicsArgs;\nimport java.util.List;\nimport java.util.ArrayList;\nimport java.util.Map;\nimport java.io.File;\nimport java.nio.file.Files;\nimport java.nio.file.Paths;\n\npublic class App {\n public static void main(String[] args) {\n Pulumi.run(App::stack);\n }\n\n public static void stack(Context ctx) {\n final var test = GithubFunctions.getRepository(GetRepositoryArgs.builder()\n .name(\"test\")\n .build());\n\n var testRepositoryTopics = new RepositoryTopics(\"testRepositoryTopics\", RepositoryTopicsArgs.builder()\n .repository(testGithubRepository.name())\n .topics( \n \"topic-1\",\n \"topic-2\")\n .build());\n\n }\n}\n```\n```yaml\nresources:\n testRepositoryTopics:\n type: github:RepositoryTopics\n name: test\n properties:\n repository: ${testGithubRepository.name}\n topics:\n - topic-1\n - topic-2\nvariables:\n test:\n fn::invoke:\n Function: github:getRepository\n Arguments:\n name: test\n```\n\u003c!--End PulumiCodeChooser --\u003e\n\n## Import\n\nRepository topics can be imported using the `name` of the repository.\n\n```sh\n$ pulumi import github:index/repositoryTopics:RepositoryTopics terraform terraform\n```\n", "properties": { @@ -9606,7 +9640,7 @@ } }, "github:index/teamMembership:TeamMembership": { - "description": "Provides a GitHub team membership resource.\n\nThis resource allows you to add/remove users from teams in your organization. When applied,\nthe user will be added to the team. If the user hasn't accepted their invitation to the\norganization, they won't be part of the team until they do. When\ndestroyed, the user will be removed from the team.\n\n\u003e **Note** This resource is not compatible with `github.TeamMembers`. Use either `github.TeamMembers` or `github.TeamMembership`.\n\n\u003e **Note** Organization owners may not be set as \"members\" of a team; they may only be set as \"maintainers\". Attempting to set organization an owner to \"member\" of a may result in a `pulumi preview` diff that changes their status back to \"maintainer\".\n\n## Example Usage\n\n\u003c!--Start PulumiCodeChooser --\u003e\n```typescript\nimport * as pulumi from \"@pulumi/pulumi\";\nimport * as github from \"@pulumi/github\";\n\n// Add a user to the organization\nconst membershipForSomeUser = new github.Membership(\"membership_for_some_user\", {\n username: \"SomeUser\",\n role: \"member\",\n});\nconst someTeam = new github.Team(\"some_team\", {\n name: \"SomeTeam\",\n description: \"Some cool team\",\n});\nconst someTeamMembership = new github.TeamMembership(\"some_team_membership\", {\n teamId: someTeam.id,\n username: \"SomeUser\",\n role: \"member\",\n});\n```\n```python\nimport pulumi\nimport pulumi_github as github\n\n# Add a user to the organization\nmembership_for_some_user = github.Membership(\"membership_for_some_user\",\n username=\"SomeUser\",\n role=\"member\")\nsome_team = github.Team(\"some_team\",\n name=\"SomeTeam\",\n description=\"Some cool team\")\nsome_team_membership = github.TeamMembership(\"some_team_membership\",\n team_id=some_team.id,\n username=\"SomeUser\",\n role=\"member\")\n```\n```csharp\nusing System.Collections.Generic;\nusing System.Linq;\nusing Pulumi;\nusing Github = Pulumi.Github;\n\nreturn await Deployment.RunAsync(() =\u003e \n{\n // Add a user to the organization\n var membershipForSomeUser = new Github.Membership(\"membership_for_some_user\", new()\n {\n Username = \"SomeUser\",\n Role = \"member\",\n });\n\n var someTeam = new Github.Team(\"some_team\", new()\n {\n Name = \"SomeTeam\",\n Description = \"Some cool team\",\n });\n\n var someTeamMembership = new Github.TeamMembership(\"some_team_membership\", new()\n {\n TeamId = someTeam.Id,\n Username = \"SomeUser\",\n Role = \"member\",\n });\n\n});\n```\n```go\npackage main\n\nimport (\n\t\"github.com/pulumi/pulumi-github/sdk/v6/go/github\"\n\t\"github.com/pulumi/pulumi/sdk/v3/go/pulumi\"\n)\n\nfunc main() {\n\tpulumi.Run(func(ctx *pulumi.Context) error {\n\t\t// Add a user to the organization\n\t\t_, err := github.NewMembership(ctx, \"membership_for_some_user\", \u0026github.MembershipArgs{\n\t\t\tUsername: pulumi.String(\"SomeUser\"),\n\t\t\tRole: pulumi.String(\"member\"),\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tsomeTeam, err := github.NewTeam(ctx, \"some_team\", \u0026github.TeamArgs{\n\t\t\tName: pulumi.String(\"SomeTeam\"),\n\t\t\tDescription: pulumi.String(\"Some cool team\"),\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\t_, err = github.NewTeamMembership(ctx, \"some_team_membership\", \u0026github.TeamMembershipArgs{\n\t\t\tTeamId: someTeam.ID(),\n\t\t\tUsername: pulumi.String(\"SomeUser\"),\n\t\t\tRole: pulumi.String(\"member\"),\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```java\npackage generated_program;\n\nimport com.pulumi.Context;\nimport com.pulumi.Pulumi;\nimport com.pulumi.core.Output;\nimport com.pulumi.github.Membership;\nimport com.pulumi.github.MembershipArgs;\nimport com.pulumi.github.Team;\nimport com.pulumi.github.TeamArgs;\nimport com.pulumi.github.TeamMembership;\nimport com.pulumi.github.TeamMembershipArgs;\nimport java.util.List;\nimport java.util.ArrayList;\nimport java.util.Map;\nimport java.io.File;\nimport java.nio.file.Files;\nimport java.nio.file.Paths;\n\npublic class App {\n public static void main(String[] args) {\n Pulumi.run(App::stack);\n }\n\n public static void stack(Context ctx) {\n // Add a user to the organization\n var membershipForSomeUser = new Membership(\"membershipForSomeUser\", MembershipArgs.builder()\n .username(\"SomeUser\")\n .role(\"member\")\n .build());\n\n var someTeam = new Team(\"someTeam\", TeamArgs.builder()\n .name(\"SomeTeam\")\n .description(\"Some cool team\")\n .build());\n\n var someTeamMembership = new TeamMembership(\"someTeamMembership\", TeamMembershipArgs.builder()\n .teamId(someTeam.id())\n .username(\"SomeUser\")\n .role(\"member\")\n .build());\n\n }\n}\n```\n```yaml\nresources:\n # Add a user to the organization\n membershipForSomeUser:\n type: github:Membership\n name: membership_for_some_user\n properties:\n username: SomeUser\n role: member\n someTeam:\n type: github:Team\n name: some_team\n properties:\n name: SomeTeam\n description: Some cool team\n someTeamMembership:\n type: github:TeamMembership\n name: some_team_membership\n properties:\n teamId: ${someTeam.id}\n username: SomeUser\n role: member\n```\n\u003c!--End PulumiCodeChooser --\u003e\n\n## Import\n\nGitHub Team Membership can be imported using an ID made up of `teamid:username` or `teamname:username`, e.g.\n\n```sh\n$ pulumi import github:index/teamMembership:TeamMembership member 1234567:someuser\n```\n\n```sh\n$ pulumi import github:index/teamMembership:TeamMembership member Administrators:someuser\n```\n\n", + "description": "Provides a GitHub team membership resource.\n\nThis resource allows you to add/remove users from teams in your organization. When applied,\nthe user will be added to the team. If the user hasn't accepted their invitation to the\norganization, they won't be part of the team until they do. When\ndestroyed, the user will be removed from the team.\n\n\u003e **Note** This resource is not compatible with `github.TeamMembers`. Use either `github.TeamMembers` or `github.TeamMembership`.\n\n\u003e **Note** Organization owners may not be set as \"members\" of a team; they may only be set as \"maintainers\". Attempting to set an organization owner as a \"member\" of a team may result in a `pulumi preview` diff that changes their status back to \"maintainer\".\n\n## Example Usage\n\n\u003c!--Start PulumiCodeChooser --\u003e\n```typescript\nimport * as pulumi from \"@pulumi/pulumi\";\nimport * as github from \"@pulumi/github\";\n\n// Add a user to the organization\nconst membershipForSomeUser = new github.Membership(\"membership_for_some_user\", {\n username: \"SomeUser\",\n role: \"member\",\n});\nconst someTeam = new github.Team(\"some_team\", {\n name: \"SomeTeam\",\n description: \"Some cool team\",\n});\nconst someTeamMembership = new github.TeamMembership(\"some_team_membership\", {\n teamId: someTeam.id,\n username: \"SomeUser\",\n role: \"member\",\n});\n```\n```python\nimport pulumi\nimport pulumi_github as github\n\n# Add a user to the organization\nmembership_for_some_user = github.Membership(\"membership_for_some_user\",\n username=\"SomeUser\",\n role=\"member\")\nsome_team = github.Team(\"some_team\",\n name=\"SomeTeam\",\n description=\"Some cool team\")\nsome_team_membership = github.TeamMembership(\"some_team_membership\",\n team_id=some_team.id,\n username=\"SomeUser\",\n role=\"member\")\n```\n```csharp\nusing System.Collections.Generic;\nusing System.Linq;\nusing Pulumi;\nusing Github = Pulumi.Github;\n\nreturn await Deployment.RunAsync(() =\u003e \n{\n // Add a user to the organization\n var membershipForSomeUser = new Github.Membership(\"membership_for_some_user\", new()\n {\n Username = \"SomeUser\",\n Role = \"member\",\n });\n\n var someTeam = new Github.Team(\"some_team\", new()\n {\n Name = \"SomeTeam\",\n Description = \"Some cool team\",\n });\n\n var someTeamMembership = new Github.TeamMembership(\"some_team_membership\", new()\n {\n TeamId = someTeam.Id,\n Username = \"SomeUser\",\n Role = \"member\",\n });\n\n});\n```\n```go\npackage main\n\nimport (\n\t\"github.com/pulumi/pulumi-github/sdk/v6/go/github\"\n\t\"github.com/pulumi/pulumi/sdk/v3/go/pulumi\"\n)\n\nfunc main() {\n\tpulumi.Run(func(ctx *pulumi.Context) error {\n\t\t// Add a user to the organization\n\t\t_, err := github.NewMembership(ctx, \"membership_for_some_user\", \u0026github.MembershipArgs{\n\t\t\tUsername: pulumi.String(\"SomeUser\"),\n\t\t\tRole: pulumi.String(\"member\"),\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tsomeTeam, err := github.NewTeam(ctx, \"some_team\", \u0026github.TeamArgs{\n\t\t\tName: pulumi.String(\"SomeTeam\"),\n\t\t\tDescription: pulumi.String(\"Some cool team\"),\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\t_, err = github.NewTeamMembership(ctx, \"some_team_membership\", \u0026github.TeamMembershipArgs{\n\t\t\tTeamId: someTeam.ID(),\n\t\t\tUsername: pulumi.String(\"SomeUser\"),\n\t\t\tRole: pulumi.String(\"member\"),\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```java\npackage generated_program;\n\nimport com.pulumi.Context;\nimport com.pulumi.Pulumi;\nimport com.pulumi.core.Output;\nimport com.pulumi.github.Membership;\nimport com.pulumi.github.MembershipArgs;\nimport com.pulumi.github.Team;\nimport com.pulumi.github.TeamArgs;\nimport com.pulumi.github.TeamMembership;\nimport com.pulumi.github.TeamMembershipArgs;\nimport java.util.List;\nimport java.util.ArrayList;\nimport java.util.Map;\nimport java.io.File;\nimport java.nio.file.Files;\nimport java.nio.file.Paths;\n\npublic class App {\n public static void main(String[] args) {\n Pulumi.run(App::stack);\n }\n\n public static void stack(Context ctx) {\n // Add a user to the organization\n var membershipForSomeUser = new Membership(\"membershipForSomeUser\", MembershipArgs.builder()\n .username(\"SomeUser\")\n .role(\"member\")\n .build());\n\n var someTeam = new Team(\"someTeam\", TeamArgs.builder()\n .name(\"SomeTeam\")\n .description(\"Some cool team\")\n .build());\n\n var someTeamMembership = new TeamMembership(\"someTeamMembership\", TeamMembershipArgs.builder()\n .teamId(someTeam.id())\n .username(\"SomeUser\")\n .role(\"member\")\n .build());\n\n }\n}\n```\n```yaml\nresources:\n # Add a user to the organization\n membershipForSomeUser:\n type: github:Membership\n name: membership_for_some_user\n properties:\n username: SomeUser\n role: member\n someTeam:\n type: github:Team\n name: some_team\n properties:\n name: SomeTeam\n description: Some cool team\n someTeamMembership:\n type: github:TeamMembership\n name: some_team_membership\n properties:\n teamId: ${someTeam.id}\n username: SomeUser\n role: member\n```\n\u003c!--End PulumiCodeChooser --\u003e\n\n## Import\n\nGitHub Team Membership can be imported using an ID made up of `teamid:username` or `teamname:username`, e.g.\n\n```sh\n$ pulumi import github:index/teamMembership:TeamMembership member 1234567:someuser\n```\n\n```sh\n$ pulumi import github:index/teamMembership:TeamMembership member Administrators:someuser\n```\n\n", "properties": { "etag": { "type": "string" diff --git a/provider/go.mod b/provider/go.mod index 024984e6..cc8ad4e7 100644 --- a/provider/go.mod +++ b/provider/go.mod @@ -77,7 +77,7 @@ require ( github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golang/protobuf v1.5.4 // indirect github.com/google/go-cmp v0.6.0 // indirect - github.com/google/go-github/v65 v65.0.0 // indirect + github.com/google/go-github/v66 v66.0.1-0.20241027130611-9e5757d5a766 // indirect github.com/google/go-querystring v1.1.0 // indirect github.com/google/s2a-go v0.1.7 // indirect github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect diff --git a/provider/go.sum b/provider/go.sum index 284b4771..59c89ed3 100644 --- a/provider/go.sum +++ b/provider/go.sum @@ -1498,8 +1498,8 @@ github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeN github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/go-github/v65 v65.0.0 h1:pQ7BmO3DZivvFk92geC0jB0q2m3gyn8vnYPgV7GSLhQ= -github.com/google/go-github/v65 v65.0.0/go.mod h1:DvrqWo5hvsdhJvHd4WyVF9ttANN3BniqjP8uTFMNb60= +github.com/google/go-github/v66 v66.0.1-0.20241027130611-9e5757d5a766 h1:Ne77zoI0NHPnZ/GPRzTVsedUUrkrI2UcnS821dfqp28= +github.com/google/go-github/v66 v66.0.1-0.20241027130611-9e5757d5a766/go.mod h1:+4SO9Zkuyf8ytMj0csN1NR/5OTR+MfqPp8P8dVlcvY4= github.com/google/go-pkcs11 v0.2.0/go.mod h1:6eQoGcuNJpa7jnd5pMGdkSaQpNDYvPlXWMcjXXThLlY= github.com/google/go-pkcs11 v0.2.1-0.20230907215043-c6f79328ddf9/go.mod h1:6eQoGcuNJpa7jnd5pMGdkSaQpNDYvPlXWMcjXXThLlY= github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= diff --git a/provider/resources.go b/provider/resources.go index 2ee0d739..c667e57d 100644 --- a/provider/resources.go +++ b/provider/resources.go @@ -177,13 +177,12 @@ func Provider() tfbridge.ProviderInfo { Tok: makeResource(mainMod, "RepositoryDeployKey"), DeleteBeforeReplace: true, }, - "github_repository_environment": {Tok: makeResource(mainMod, "RepositoryEnvironment")}, - "github_repository_file": {Tok: makeResource(mainMod, "RepositoryFile")}, - "github_repository_pull_request": {Tok: makeResource(mainMod, "RepositoryPullRequest")}, - "github_repository_project": {Tok: makeResource(mainMod, "RepositoryProject")}, - "github_repository_tag_protection": {Tok: makeResource(mainMod, "RepositoryTagProtection")}, - "github_repository_webhook": {Tok: makeResource(mainMod, "RepositoryWebhook")}, - "github_repository_milestone": {Tok: makeResource(mainMod, "RepositoryMilestone")}, + "github_repository_environment": {Tok: makeResource(mainMod, "RepositoryEnvironment")}, + "github_repository_file": {Tok: makeResource(mainMod, "RepositoryFile")}, + "github_repository_pull_request": {Tok: makeResource(mainMod, "RepositoryPullRequest")}, + "github_repository_project": {Tok: makeResource(mainMod, "RepositoryProject")}, + "github_repository_webhook": {Tok: makeResource(mainMod, "RepositoryWebhook")}, + "github_repository_milestone": {Tok: makeResource(mainMod, "RepositoryMilestone")}, "github_repository_autolink_reference": { Tok: makeResource(mainMod, "RepositoryAutolinkReference"), DeleteBeforeReplace: true, diff --git a/sdk/dotnet/Inputs/OrganizationRulesetRulesArgs.cs b/sdk/dotnet/Inputs/OrganizationRulesetRulesArgs.cs index f8faefb9..b57ce362 100644 --- a/sdk/dotnet/Inputs/OrganizationRulesetRulesArgs.cs +++ b/sdk/dotnet/Inputs/OrganizationRulesetRulesArgs.cs @@ -60,6 +60,12 @@ public sealed class OrganizationRulesetRulesArgs : global::Pulumi.ResourceArgs [Input("pullRequest")] public Input? PullRequest { get; set; } + /// + /// (Block List, Max: 1) Define which tools must provide code scanning results before the reference is updated. When configured, code scanning must be enabled and have results for both the commit and the reference being updated. Multiple code scanning tools can be specified. (see below for nested schema) + /// + [Input("requiredCodeScanning")] + public Input? RequiredCodeScanning { get; set; } + /// /// (Boolean) Prevent merge commits from being pushed to matching branches. /// diff --git a/sdk/dotnet/Inputs/OrganizationRulesetRulesGetArgs.cs b/sdk/dotnet/Inputs/OrganizationRulesetRulesGetArgs.cs index afc4b4c1..43e15c46 100644 --- a/sdk/dotnet/Inputs/OrganizationRulesetRulesGetArgs.cs +++ b/sdk/dotnet/Inputs/OrganizationRulesetRulesGetArgs.cs @@ -60,6 +60,12 @@ public sealed class OrganizationRulesetRulesGetArgs : global::Pulumi.ResourceArg [Input("pullRequest")] public Input? PullRequest { get; set; } + /// + /// (Block List, Max: 1) Define which tools must provide code scanning results before the reference is updated. When configured, code scanning must be enabled and have results for both the commit and the reference being updated. Multiple code scanning tools can be specified. (see below for nested schema) + /// + [Input("requiredCodeScanning")] + public Input? RequiredCodeScanning { get; set; } + /// /// (Boolean) Prevent merge commits from being pushed to matching branches. /// diff --git a/sdk/dotnet/Inputs/OrganizationRulesetRulesRequiredCodeScanningArgs.cs b/sdk/dotnet/Inputs/OrganizationRulesetRulesRequiredCodeScanningArgs.cs new file mode 100644 index 00000000..93a549f5 --- /dev/null +++ b/sdk/dotnet/Inputs/OrganizationRulesetRulesRequiredCodeScanningArgs.cs @@ -0,0 +1,32 @@ +// *** 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 OrganizationRulesetRulesRequiredCodeScanningArgs : global::Pulumi.ResourceArgs + { + [Input("requiredCodeScanningTools", required: true)] + private InputList? _requiredCodeScanningTools; + + /// + /// Tools that must provide code scanning results for this rule to pass. + /// + public InputList RequiredCodeScanningTools + { + get => _requiredCodeScanningTools ?? (_requiredCodeScanningTools = new InputList()); + set => _requiredCodeScanningTools = value; + } + + public OrganizationRulesetRulesRequiredCodeScanningArgs() + { + } + public static new OrganizationRulesetRulesRequiredCodeScanningArgs Empty => new OrganizationRulesetRulesRequiredCodeScanningArgs(); + } +} diff --git a/sdk/dotnet/Inputs/OrganizationRulesetRulesRequiredCodeScanningGetArgs.cs b/sdk/dotnet/Inputs/OrganizationRulesetRulesRequiredCodeScanningGetArgs.cs new file mode 100644 index 00000000..14d14eee --- /dev/null +++ b/sdk/dotnet/Inputs/OrganizationRulesetRulesRequiredCodeScanningGetArgs.cs @@ -0,0 +1,32 @@ +// *** 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 OrganizationRulesetRulesRequiredCodeScanningGetArgs : global::Pulumi.ResourceArgs + { + [Input("requiredCodeScanningTools", required: true)] + private InputList? _requiredCodeScanningTools; + + /// + /// Tools that must provide code scanning results for this rule to pass. + /// + public InputList RequiredCodeScanningTools + { + get => _requiredCodeScanningTools ?? (_requiredCodeScanningTools = new InputList()); + set => _requiredCodeScanningTools = value; + } + + public OrganizationRulesetRulesRequiredCodeScanningGetArgs() + { + } + public static new OrganizationRulesetRulesRequiredCodeScanningGetArgs Empty => new OrganizationRulesetRulesRequiredCodeScanningGetArgs(); + } +} diff --git a/sdk/dotnet/Inputs/OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArgs.cs b/sdk/dotnet/Inputs/OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArgs.cs new file mode 100644 index 00000000..866beb60 --- /dev/null +++ b/sdk/dotnet/Inputs/OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArgs.cs @@ -0,0 +1,38 @@ +// *** 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 OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArgs : global::Pulumi.ResourceArgs + { + /// + /// The severity level at which code scanning results that raise alerts block a reference update. Can be one of: `none`, `errors`, `errors_and_warnings`, `all`. + /// + [Input("alertsThreshold", required: true)] + public Input AlertsThreshold { get; set; } = null!; + + /// + /// The severity level at which code scanning results that raise security alerts block a reference update. Can be one of: `none`, `critical`, `high_or_higher`, `medium_or_higher`, `all`. + /// + [Input("securityAlertsThreshold", required: true)] + public Input SecurityAlertsThreshold { get; set; } = null!; + + /// + /// The name of a code scanning tool. + /// + [Input("tool", required: true)] + public Input Tool { get; set; } = null!; + + public OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArgs() + { + } + public static new OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArgs Empty => new OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArgs(); + } +} diff --git a/sdk/dotnet/Inputs/OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningToolGetArgs.cs b/sdk/dotnet/Inputs/OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningToolGetArgs.cs new file mode 100644 index 00000000..3cb0af82 --- /dev/null +++ b/sdk/dotnet/Inputs/OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningToolGetArgs.cs @@ -0,0 +1,38 @@ +// *** 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 OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningToolGetArgs : global::Pulumi.ResourceArgs + { + /// + /// The severity level at which code scanning results that raise alerts block a reference update. Can be one of: `none`, `errors`, `errors_and_warnings`, `all`. + /// + [Input("alertsThreshold", required: true)] + public Input AlertsThreshold { get; set; } = null!; + + /// + /// The severity level at which code scanning results that raise security alerts block a reference update. Can be one of: `none`, `critical`, `high_or_higher`, `medium_or_higher`, `all`. + /// + [Input("securityAlertsThreshold", required: true)] + public Input SecurityAlertsThreshold { get; set; } = null!; + + /// + /// The name of a code scanning tool. + /// + [Input("tool", required: true)] + public Input Tool { get; set; } = null!; + + public OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningToolGetArgs() + { + } + public static new OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningToolGetArgs Empty => new OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningToolGetArgs(); + } +} diff --git a/sdk/dotnet/Inputs/RepositoryRulesetRulesArgs.cs b/sdk/dotnet/Inputs/RepositoryRulesetRulesArgs.cs index 417c150f..be633447 100644 --- a/sdk/dotnet/Inputs/RepositoryRulesetRulesArgs.cs +++ b/sdk/dotnet/Inputs/RepositoryRulesetRulesArgs.cs @@ -60,6 +60,12 @@ public sealed class RepositoryRulesetRulesArgs : global::Pulumi.ResourceArgs [Input("pullRequest")] public Input? PullRequest { get; set; } + /// + /// (Block List, Max: 1) Define which tools must provide code scanning results before the reference is updated. When configured, code scanning must be enabled and have results for both the commit and the reference being updated. Multiple code scanning tools can be specified. (see below for nested schema) + /// + [Input("requiredCodeScanning")] + public Input? RequiredCodeScanning { get; set; } + /// /// (Block List, Max: 1) Choose which environments must be successfully deployed to before branches can be merged into a branch that matches this rule. (see below for nested schema) /// diff --git a/sdk/dotnet/Inputs/RepositoryRulesetRulesGetArgs.cs b/sdk/dotnet/Inputs/RepositoryRulesetRulesGetArgs.cs index 2951adc1..266a240d 100644 --- a/sdk/dotnet/Inputs/RepositoryRulesetRulesGetArgs.cs +++ b/sdk/dotnet/Inputs/RepositoryRulesetRulesGetArgs.cs @@ -60,6 +60,12 @@ public sealed class RepositoryRulesetRulesGetArgs : global::Pulumi.ResourceArgs [Input("pullRequest")] public Input? PullRequest { get; set; } + /// + /// (Block List, Max: 1) Define which tools must provide code scanning results before the reference is updated. When configured, code scanning must be enabled and have results for both the commit and the reference being updated. Multiple code scanning tools can be specified. (see below for nested schema) + /// + [Input("requiredCodeScanning")] + public Input? RequiredCodeScanning { get; set; } + /// /// (Block List, Max: 1) Choose which environments must be successfully deployed to before branches can be merged into a branch that matches this rule. (see below for nested schema) /// diff --git a/sdk/dotnet/Inputs/RepositoryRulesetRulesRequiredCodeScanningArgs.cs b/sdk/dotnet/Inputs/RepositoryRulesetRulesRequiredCodeScanningArgs.cs new file mode 100644 index 00000000..4660bc15 --- /dev/null +++ b/sdk/dotnet/Inputs/RepositoryRulesetRulesRequiredCodeScanningArgs.cs @@ -0,0 +1,32 @@ +// *** 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 RepositoryRulesetRulesRequiredCodeScanningArgs : global::Pulumi.ResourceArgs + { + [Input("requiredCodeScanningTools", required: true)] + private InputList? _requiredCodeScanningTools; + + /// + /// Tools that must provide code scanning results for this rule to pass. + /// + public InputList RequiredCodeScanningTools + { + get => _requiredCodeScanningTools ?? (_requiredCodeScanningTools = new InputList()); + set => _requiredCodeScanningTools = value; + } + + public RepositoryRulesetRulesRequiredCodeScanningArgs() + { + } + public static new RepositoryRulesetRulesRequiredCodeScanningArgs Empty => new RepositoryRulesetRulesRequiredCodeScanningArgs(); + } +} diff --git a/sdk/dotnet/Inputs/RepositoryRulesetRulesRequiredCodeScanningGetArgs.cs b/sdk/dotnet/Inputs/RepositoryRulesetRulesRequiredCodeScanningGetArgs.cs new file mode 100644 index 00000000..0b279dfb --- /dev/null +++ b/sdk/dotnet/Inputs/RepositoryRulesetRulesRequiredCodeScanningGetArgs.cs @@ -0,0 +1,32 @@ +// *** 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 RepositoryRulesetRulesRequiredCodeScanningGetArgs : global::Pulumi.ResourceArgs + { + [Input("requiredCodeScanningTools", required: true)] + private InputList? _requiredCodeScanningTools; + + /// + /// Tools that must provide code scanning results for this rule to pass. + /// + public InputList RequiredCodeScanningTools + { + get => _requiredCodeScanningTools ?? (_requiredCodeScanningTools = new InputList()); + set => _requiredCodeScanningTools = value; + } + + public RepositoryRulesetRulesRequiredCodeScanningGetArgs() + { + } + public static new RepositoryRulesetRulesRequiredCodeScanningGetArgs Empty => new RepositoryRulesetRulesRequiredCodeScanningGetArgs(); + } +} diff --git a/sdk/dotnet/Inputs/RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArgs.cs b/sdk/dotnet/Inputs/RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArgs.cs new file mode 100644 index 00000000..41362f43 --- /dev/null +++ b/sdk/dotnet/Inputs/RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArgs.cs @@ -0,0 +1,38 @@ +// *** 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 RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArgs : global::Pulumi.ResourceArgs + { + /// + /// The severity level at which code scanning results that raise alerts block a reference update. Can be one of: `none`, `errors`, `errors_and_warnings`, `all`. + /// + [Input("alertsThreshold", required: true)] + public Input AlertsThreshold { get; set; } = null!; + + /// + /// The severity level at which code scanning results that raise security alerts block a reference update. Can be one of: `none`, `critical`, `high_or_higher`, `medium_or_higher`, `all`. + /// + [Input("securityAlertsThreshold", required: true)] + public Input SecurityAlertsThreshold { get; set; } = null!; + + /// + /// The name of a code scanning tool + /// + [Input("tool", required: true)] + public Input Tool { get; set; } = null!; + + public RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArgs() + { + } + public static new RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArgs Empty => new RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArgs(); + } +} diff --git a/sdk/dotnet/Inputs/RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningToolGetArgs.cs b/sdk/dotnet/Inputs/RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningToolGetArgs.cs new file mode 100644 index 00000000..86959375 --- /dev/null +++ b/sdk/dotnet/Inputs/RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningToolGetArgs.cs @@ -0,0 +1,38 @@ +// *** 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 RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningToolGetArgs : global::Pulumi.ResourceArgs + { + /// + /// The severity level at which code scanning results that raise alerts block a reference update. Can be one of: `none`, `errors`, `errors_and_warnings`, `all`. + /// + [Input("alertsThreshold", required: true)] + public Input AlertsThreshold { get; set; } = null!; + + /// + /// The severity level at which code scanning results that raise security alerts block a reference update. Can be one of: `none`, `critical`, `high_or_higher`, `medium_or_higher`, `all`. + /// + [Input("securityAlertsThreshold", required: true)] + public Input SecurityAlertsThreshold { get; set; } = null!; + + /// + /// The name of a code scanning tool + /// + [Input("tool", required: true)] + public Input Tool { get; set; } = null!; + + public RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningToolGetArgs() + { + } + public static new RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningToolGetArgs Empty => new RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningToolGetArgs(); + } +} diff --git a/sdk/dotnet/Outputs/OrganizationRulesetRules.cs b/sdk/dotnet/Outputs/OrganizationRulesetRules.cs index 241ab16f..0bfc8c4c 100644 --- a/sdk/dotnet/Outputs/OrganizationRulesetRules.cs +++ b/sdk/dotnet/Outputs/OrganizationRulesetRules.cs @@ -46,6 +46,10 @@ public sealed class OrganizationRulesetRules /// public readonly Outputs.OrganizationRulesetRulesPullRequest? PullRequest; /// + /// (Block List, Max: 1) Define which tools must provide code scanning results before the reference is updated. When configured, code scanning must be enabled and have results for both the commit and the reference being updated. Multiple code scanning tools can be specified. (see below for nested schema) + /// + public readonly Outputs.OrganizationRulesetRulesRequiredCodeScanning? RequiredCodeScanning; + /// /// (Boolean) Prevent merge commits from being pushed to matching branches. /// public readonly bool? RequiredLinearHistory; @@ -88,6 +92,8 @@ private OrganizationRulesetRules( Outputs.OrganizationRulesetRulesPullRequest? pullRequest, + Outputs.OrganizationRulesetRulesRequiredCodeScanning? requiredCodeScanning, + bool? requiredLinearHistory, bool? requiredSignatures, @@ -108,6 +114,7 @@ private OrganizationRulesetRules( Deletion = deletion; NonFastForward = nonFastForward; PullRequest = pullRequest; + RequiredCodeScanning = requiredCodeScanning; RequiredLinearHistory = requiredLinearHistory; RequiredSignatures = requiredSignatures; RequiredStatusChecks = requiredStatusChecks; diff --git a/sdk/dotnet/Outputs/OrganizationRulesetRulesRequiredCodeScanning.cs b/sdk/dotnet/Outputs/OrganizationRulesetRulesRequiredCodeScanning.cs new file mode 100644 index 00000000..f79ff6d9 --- /dev/null +++ b/sdk/dotnet/Outputs/OrganizationRulesetRulesRequiredCodeScanning.cs @@ -0,0 +1,27 @@ +// *** 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 OrganizationRulesetRulesRequiredCodeScanning + { + /// + /// Tools that must provide code scanning results for this rule to pass. + /// + public readonly ImmutableArray RequiredCodeScanningTools; + + [OutputConstructor] + private OrganizationRulesetRulesRequiredCodeScanning(ImmutableArray requiredCodeScanningTools) + { + RequiredCodeScanningTools = requiredCodeScanningTools; + } + } +} diff --git a/sdk/dotnet/Outputs/OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningTool.cs b/sdk/dotnet/Outputs/OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningTool.cs new file mode 100644 index 00000000..79c1ca25 --- /dev/null +++ b/sdk/dotnet/Outputs/OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningTool.cs @@ -0,0 +1,42 @@ +// *** 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 OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningTool + { + /// + /// The severity level at which code scanning results that raise alerts block a reference update. Can be one of: `none`, `errors`, `errors_and_warnings`, `all`. + /// + public readonly string AlertsThreshold; + /// + /// The severity level at which code scanning results that raise security alerts block a reference update. Can be one of: `none`, `critical`, `high_or_higher`, `medium_or_higher`, `all`. + /// + public readonly string SecurityAlertsThreshold; + /// + /// The name of a code scanning tool. + /// + public readonly string Tool; + + [OutputConstructor] + private OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningTool( + string alertsThreshold, + + string securityAlertsThreshold, + + string tool) + { + AlertsThreshold = alertsThreshold; + SecurityAlertsThreshold = securityAlertsThreshold; + Tool = tool; + } + } +} diff --git a/sdk/dotnet/Outputs/RepositoryRulesetRules.cs b/sdk/dotnet/Outputs/RepositoryRulesetRules.cs index 63fd6270..e1be135d 100644 --- a/sdk/dotnet/Outputs/RepositoryRulesetRules.cs +++ b/sdk/dotnet/Outputs/RepositoryRulesetRules.cs @@ -46,6 +46,10 @@ public sealed class RepositoryRulesetRules /// public readonly Outputs.RepositoryRulesetRulesPullRequest? PullRequest; /// + /// (Block List, Max: 1) Define which tools must provide code scanning results before the reference is updated. When configured, code scanning must be enabled and have results for both the commit and the reference being updated. Multiple code scanning tools can be specified. (see below for nested schema) + /// + public readonly Outputs.RepositoryRulesetRulesRequiredCodeScanning? RequiredCodeScanning; + /// /// (Block List, Max: 1) Choose which environments must be successfully deployed to before branches can be merged into a branch that matches this rule. (see below for nested schema) /// public readonly Outputs.RepositoryRulesetRulesRequiredDeployments? RequiredDeployments; @@ -92,6 +96,8 @@ private RepositoryRulesetRules( Outputs.RepositoryRulesetRulesPullRequest? pullRequest, + Outputs.RepositoryRulesetRulesRequiredCodeScanning? requiredCodeScanning, + Outputs.RepositoryRulesetRulesRequiredDeployments? requiredDeployments, bool? requiredLinearHistory, @@ -114,6 +120,7 @@ private RepositoryRulesetRules( Deletion = deletion; NonFastForward = nonFastForward; PullRequest = pullRequest; + RequiredCodeScanning = requiredCodeScanning; RequiredDeployments = requiredDeployments; RequiredLinearHistory = requiredLinearHistory; RequiredSignatures = requiredSignatures; diff --git a/sdk/dotnet/Outputs/RepositoryRulesetRulesRequiredCodeScanning.cs b/sdk/dotnet/Outputs/RepositoryRulesetRulesRequiredCodeScanning.cs new file mode 100644 index 00000000..bf8f8c48 --- /dev/null +++ b/sdk/dotnet/Outputs/RepositoryRulesetRulesRequiredCodeScanning.cs @@ -0,0 +1,27 @@ +// *** 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 RepositoryRulesetRulesRequiredCodeScanning + { + /// + /// Tools that must provide code scanning results for this rule to pass. + /// + public readonly ImmutableArray RequiredCodeScanningTools; + + [OutputConstructor] + private RepositoryRulesetRulesRequiredCodeScanning(ImmutableArray requiredCodeScanningTools) + { + RequiredCodeScanningTools = requiredCodeScanningTools; + } + } +} diff --git a/sdk/dotnet/Outputs/RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningTool.cs b/sdk/dotnet/Outputs/RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningTool.cs new file mode 100644 index 00000000..b1a3b690 --- /dev/null +++ b/sdk/dotnet/Outputs/RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningTool.cs @@ -0,0 +1,42 @@ +// *** 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 RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningTool + { + /// + /// The severity level at which code scanning results that raise alerts block a reference update. Can be one of: `none`, `errors`, `errors_and_warnings`, `all`. + /// + public readonly string AlertsThreshold; + /// + /// The severity level at which code scanning results that raise security alerts block a reference update. Can be one of: `none`, `critical`, `high_or_higher`, `medium_or_higher`, `all`. + /// + public readonly string SecurityAlertsThreshold; + /// + /// The name of a code scanning tool + /// + public readonly string Tool; + + [OutputConstructor] + private RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningTool( + string alertsThreshold, + + string securityAlertsThreshold, + + string tool) + { + AlertsThreshold = alertsThreshold; + SecurityAlertsThreshold = securityAlertsThreshold; + Tool = tool; + } + } +} diff --git a/sdk/dotnet/RepositoryEnvironmentDeploymentPolicy.cs b/sdk/dotnet/RepositoryEnvironmentDeploymentPolicy.cs index a7bcb425..14257478 100644 --- a/sdk/dotnet/RepositoryEnvironmentDeploymentPolicy.cs +++ b/sdk/dotnet/RepositoryEnvironmentDeploymentPolicy.cs @@ -14,6 +14,8 @@ namespace Pulumi.Github /// /// ## Example Usage /// + /// Create a branch-based deployment policy: + /// /// ```csharp /// using System.Collections.Generic; /// using System.Linq; @@ -64,6 +66,58 @@ namespace Pulumi.Github /// }); /// ``` /// + /// Create a tag-based deployment policy: + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var current = Github.GetUser.Invoke(new() + /// { + /// Username = "", + /// }); + /// + /// var test = new Github.Repository("test", new() + /// { + /// Name = "tf-acc-test-%s", + /// }); + /// + /// var testRepositoryEnvironment = new Github.RepositoryEnvironment("test", new() + /// { + /// Repository = test.Name, + /// Environment = "environment/test", + /// WaitTimer = 10000, + /// Reviewers = new[] + /// { + /// new Github.Inputs.RepositoryEnvironmentReviewerArgs + /// { + /// Users = new[] + /// { + /// current.Apply(getUserResult => getUserResult.Id), + /// }, + /// }, + /// }, + /// DeploymentBranchPolicy = new Github.Inputs.RepositoryEnvironmentDeploymentBranchPolicyArgs + /// { + /// ProtectedBranches = false, + /// CustomBranchPolicies = true, + /// }, + /// }); + /// + /// var testRepositoryEnvironmentDeploymentPolicy = new Github.RepositoryEnvironmentDeploymentPolicy("test", new() + /// { + /// Repository = test.Name, + /// Environment = testRepositoryEnvironment.Environment, + /// TagPattern = "v*", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// GitHub Repository Environment Deployment Policy can be imported using an ID made up of `name` of the repository combined with the `environment` name of the environment with the `Id` of the deployment policy, separated by a `:` character, e.g. @@ -76,10 +130,10 @@ namespace Pulumi.Github public partial class RepositoryEnvironmentDeploymentPolicy : global::Pulumi.CustomResource { /// - /// The name pattern that branches must match in order to deploy to the environment. + /// The name pattern that branches must match in order to deploy to the environment. If not specified, `tag_pattern` must be specified. /// [Output("branchPattern")] - public Output BranchPattern { get; private set; } = null!; + public Output BranchPattern { get; private set; } = null!; /// /// The name of the environment. @@ -93,6 +147,12 @@ public partial class RepositoryEnvironmentDeploymentPolicy : global::Pulumi.Cust [Output("repository")] public Output Repository { get; private set; } = null!; + /// + /// The name pattern that tags must match in order to deploy to the environment. If not specified, `branch_pattern` must be specified. + /// + [Output("tagPattern")] + public Output TagPattern { get; private set; } = null!; + /// /// Create a RepositoryEnvironmentDeploymentPolicy resource with the given unique name, arguments, and options. @@ -140,10 +200,10 @@ public static RepositoryEnvironmentDeploymentPolicy Get(string name, Input - /// The name pattern that branches must match in order to deploy to the environment. + /// The name pattern that branches must match in order to deploy to the environment. If not specified, `tag_pattern` must be specified. /// - [Input("branchPattern", required: true)] - public Input BranchPattern { get; set; } = null!; + [Input("branchPattern")] + public Input? BranchPattern { get; set; } /// /// The name of the environment. @@ -157,6 +217,12 @@ public sealed class RepositoryEnvironmentDeploymentPolicyArgs : global::Pulumi.R [Input("repository", required: true)] public Input Repository { get; set; } = null!; + /// + /// The name pattern that tags must match in order to deploy to the environment. If not specified, `branch_pattern` must be specified. + /// + [Input("tagPattern")] + public Input? TagPattern { get; set; } + public RepositoryEnvironmentDeploymentPolicyArgs() { } @@ -166,7 +232,7 @@ public RepositoryEnvironmentDeploymentPolicyArgs() public sealed class RepositoryEnvironmentDeploymentPolicyState : global::Pulumi.ResourceArgs { /// - /// The name pattern that branches must match in order to deploy to the environment. + /// The name pattern that branches must match in order to deploy to the environment. If not specified, `tag_pattern` must be specified. /// [Input("branchPattern")] public Input? BranchPattern { get; set; } @@ -183,6 +249,12 @@ public sealed class RepositoryEnvironmentDeploymentPolicyState : global::Pulumi. [Input("repository")] public Input? Repository { get; set; } + /// + /// The name pattern that tags must match in order to deploy to the environment. If not specified, `branch_pattern` must be specified. + /// + [Input("tagPattern")] + public Input? TagPattern { get; set; } + public RepositoryEnvironmentDeploymentPolicyState() { } diff --git a/sdk/dotnet/RepositoryTagProtection.cs b/sdk/dotnet/RepositoryTagProtection.cs deleted file mode 100644 index 60c16024..00000000 --- a/sdk/dotnet/RepositoryTagProtection.cs +++ /dev/null @@ -1,155 +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 -{ - /// - /// This resource allows you to create and manage a repository tag protection for repositories within your GitHub organization or personal account. - /// - /// ## Example Usage - /// - /// ```csharp - /// using System.Collections.Generic; - /// using System.Linq; - /// using Pulumi; - /// using Github = Pulumi.Github; - /// - /// return await Deployment.RunAsync(() => - /// { - /// var example = new Github.RepositoryTagProtection("example", new() - /// { - /// Repository = "example-repository", - /// Pattern = "v*", - /// }); - /// - /// }); - /// ``` - /// - /// ## Import - /// - /// Repository tag protections can be imported using the `name` of the repository, combined with the `id` of the tag protection, separated by a `/` character. - /// The `id` of the tag protection can be found using the [GitHub API](https://docs.github.com/en/rest/repos/tags#list-tag-protection-states-for-a-repository). - /// - /// Importing uses the name of the repository, as well as the ID of the tag protection, e.g. - /// - /// ```sh - /// $ pulumi import github:index/repositoryTagProtection:RepositoryTagProtection terraform my-repo/31077 - /// ``` - /// - [GithubResourceType("github:index/repositoryTagProtection:RepositoryTagProtection")] - public partial class RepositoryTagProtection : global::Pulumi.CustomResource - { - /// - /// The pattern of the tag to protect. - /// - [Output("pattern")] - public Output Pattern { get; private set; } = null!; - - /// - /// Name of the repository to add the tag protection to. - /// - [Output("repository")] - public Output Repository { get; private set; } = null!; - - /// - /// The ID of the tag protection. - /// - [Output("tagProtectionId")] - public Output TagProtectionId { get; private set; } = null!; - - - /// - /// Create a RepositoryTagProtection resource with the given unique name, arguments, and options. - /// - /// - /// The unique name of the resource - /// The arguments used to populate this resource's properties - /// A bag of options that control this resource's behavior - public RepositoryTagProtection(string name, RepositoryTagProtectionArgs args, CustomResourceOptions? options = null) - : base("github:index/repositoryTagProtection:RepositoryTagProtection", name, args ?? new RepositoryTagProtectionArgs(), MakeResourceOptions(options, "")) - { - } - - private RepositoryTagProtection(string name, Input id, RepositoryTagProtectionState? state = null, CustomResourceOptions? options = null) - : base("github:index/repositoryTagProtection:RepositoryTagProtection", name, state, MakeResourceOptions(options, id)) - { - } - - private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions? options, Input? id) - { - var defaultOptions = new CustomResourceOptions - { - Version = Utilities.Version, - }; - var merged = CustomResourceOptions.Merge(defaultOptions, options); - // Override the ID if one was specified for consistency with other language SDKs. - merged.Id = id ?? merged.Id; - return merged; - } - /// - /// Get an existing RepositoryTagProtection resource's state with the given name, ID, and optional extra - /// properties used to qualify the lookup. - /// - /// - /// The unique name of the resulting resource. - /// The unique provider ID of the resource to lookup. - /// Any extra arguments used during the lookup. - /// A bag of options that control this resource's behavior - public static RepositoryTagProtection Get(string name, Input id, RepositoryTagProtectionState? state = null, CustomResourceOptions? options = null) - { - return new RepositoryTagProtection(name, id, state, options); - } - } - - public sealed class RepositoryTagProtectionArgs : global::Pulumi.ResourceArgs - { - /// - /// The pattern of the tag to protect. - /// - [Input("pattern", required: true)] - public Input Pattern { get; set; } = null!; - - /// - /// Name of the repository to add the tag protection to. - /// - [Input("repository", required: true)] - public Input Repository { get; set; } = null!; - - public RepositoryTagProtectionArgs() - { - } - public static new RepositoryTagProtectionArgs Empty => new RepositoryTagProtectionArgs(); - } - - public sealed class RepositoryTagProtectionState : global::Pulumi.ResourceArgs - { - /// - /// The pattern of the tag to protect. - /// - [Input("pattern")] - public Input? Pattern { get; set; } - - /// - /// Name of the repository to add the tag protection to. - /// - [Input("repository")] - public Input? Repository { get; set; } - - /// - /// The ID of the tag protection. - /// - [Input("tagProtectionId")] - public Input? TagProtectionId { get; set; } - - public RepositoryTagProtectionState() - { - } - public static new RepositoryTagProtectionState Empty => new RepositoryTagProtectionState(); - } -} diff --git a/sdk/dotnet/TeamMembership.cs b/sdk/dotnet/TeamMembership.cs index 5405b492..e2e59573 100644 --- a/sdk/dotnet/TeamMembership.cs +++ b/sdk/dotnet/TeamMembership.cs @@ -19,7 +19,7 @@ namespace Pulumi.Github /// /// > **Note** This resource is not compatible with `github.TeamMembers`. Use either `github.TeamMembers` or `github.TeamMembership`. /// - /// > **Note** Organization owners may not be set as "members" of a team; they may only be set as "maintainers". Attempting to set organization an owner to "member" of a may result in a `pulumi preview` diff that changes their status back to "maintainer". + /// > **Note** Organization owners may not be set as "members" of a team; they may only be set as "maintainers". Attempting to set an organization owner as a "member" of a team may result in a `pulumi preview` diff that changes their status back to "maintainer". /// /// ## Example Usage /// diff --git a/sdk/go/github/init.go b/sdk/go/github/init.go index 4a6863cc..4d8a5222 100644 --- a/sdk/go/github/init.go +++ b/sdk/go/github/init.go @@ -137,8 +137,6 @@ func (m *module) Construct(ctx *pulumi.Context, name, typ, urn string) (r pulumi r = &RepositoryPullRequest{} case "github:index/repositoryRuleset:RepositoryRuleset": r = &RepositoryRuleset{} - case "github:index/repositoryTagProtection:RepositoryTagProtection": - r = &RepositoryTagProtection{} case "github:index/repositoryTopics:RepositoryTopics": r = &RepositoryTopics{} case "github:index/repositoryWebhook:RepositoryWebhook": @@ -482,11 +480,6 @@ func init() { "index/repositoryRuleset", &module{version}, ) - pulumi.RegisterResourceModule( - "github", - "index/repositoryTagProtection", - &module{version}, - ) pulumi.RegisterResourceModule( "github", "index/repositoryTopics", diff --git a/sdk/go/github/pulumiTypes.go b/sdk/go/github/pulumiTypes.go index 511cb936..e073f4ef 100644 --- a/sdk/go/github/pulumiTypes.go +++ b/sdk/go/github/pulumiTypes.go @@ -2865,6 +2865,8 @@ type OrganizationRulesetRules struct { NonFastForward *bool `pulumi:"nonFastForward"` // (Block List, Max: 1) Require all commits be made to a non-target branch and submitted via a pull request before they can be merged. (see below for nested schema) PullRequest *OrganizationRulesetRulesPullRequest `pulumi:"pullRequest"` + // (Block List, Max: 1) Define which tools must provide code scanning results before the reference is updated. When configured, code scanning must be enabled and have results for both the commit and the reference being updated. Multiple code scanning tools can be specified. (see below for nested schema) + RequiredCodeScanning *OrganizationRulesetRulesRequiredCodeScanning `pulumi:"requiredCodeScanning"` // (Boolean) Prevent merge commits from being pushed to matching branches. RequiredLinearHistory *bool `pulumi:"requiredLinearHistory"` // (Boolean) Commits pushed to matching branches must have verified signatures. @@ -2907,6 +2909,8 @@ type OrganizationRulesetRulesArgs struct { NonFastForward pulumi.BoolPtrInput `pulumi:"nonFastForward"` // (Block List, Max: 1) Require all commits be made to a non-target branch and submitted via a pull request before they can be merged. (see below for nested schema) PullRequest OrganizationRulesetRulesPullRequestPtrInput `pulumi:"pullRequest"` + // (Block List, Max: 1) Define which tools must provide code scanning results before the reference is updated. When configured, code scanning must be enabled and have results for both the commit and the reference being updated. Multiple code scanning tools can be specified. (see below for nested schema) + RequiredCodeScanning OrganizationRulesetRulesRequiredCodeScanningPtrInput `pulumi:"requiredCodeScanning"` // (Boolean) Prevent merge commits from being pushed to matching branches. RequiredLinearHistory pulumi.BoolPtrInput `pulumi:"requiredLinearHistory"` // (Boolean) Commits pushed to matching branches must have verified signatures. @@ -3046,6 +3050,13 @@ func (o OrganizationRulesetRulesOutput) PullRequest() OrganizationRulesetRulesPu return o.ApplyT(func(v OrganizationRulesetRules) *OrganizationRulesetRulesPullRequest { return v.PullRequest }).(OrganizationRulesetRulesPullRequestPtrOutput) } +// (Block List, Max: 1) Define which tools must provide code scanning results before the reference is updated. When configured, code scanning must be enabled and have results for both the commit and the reference being updated. Multiple code scanning tools can be specified. (see below for nested schema) +func (o OrganizationRulesetRulesOutput) RequiredCodeScanning() OrganizationRulesetRulesRequiredCodeScanningPtrOutput { + return o.ApplyT(func(v OrganizationRulesetRules) *OrganizationRulesetRulesRequiredCodeScanning { + return v.RequiredCodeScanning + }).(OrganizationRulesetRulesRequiredCodeScanningPtrOutput) +} + // (Boolean) Prevent merge commits from being pushed to matching branches. func (o OrganizationRulesetRulesOutput) RequiredLinearHistory() pulumi.BoolPtrOutput { return o.ApplyT(func(v OrganizationRulesetRules) *bool { return v.RequiredLinearHistory }).(pulumi.BoolPtrOutput) @@ -3184,6 +3195,16 @@ func (o OrganizationRulesetRulesPtrOutput) PullRequest() OrganizationRulesetRule }).(OrganizationRulesetRulesPullRequestPtrOutput) } +// (Block List, Max: 1) Define which tools must provide code scanning results before the reference is updated. When configured, code scanning must be enabled and have results for both the commit and the reference being updated. Multiple code scanning tools can be specified. (see below for nested schema) +func (o OrganizationRulesetRulesPtrOutput) RequiredCodeScanning() OrganizationRulesetRulesRequiredCodeScanningPtrOutput { + return o.ApplyT(func(v *OrganizationRulesetRules) *OrganizationRulesetRulesRequiredCodeScanning { + if v == nil { + return nil + } + return v.RequiredCodeScanning + }).(OrganizationRulesetRulesRequiredCodeScanningPtrOutput) +} + // (Boolean) Prevent merge commits from being pushed to matching branches. func (o OrganizationRulesetRulesPtrOutput) RequiredLinearHistory() pulumi.BoolPtrOutput { return o.ApplyT(func(v *OrganizationRulesetRules) *bool { @@ -4233,6 +4254,264 @@ func (o OrganizationRulesetRulesPullRequestPtrOutput) RequiredReviewThreadResolu }).(pulumi.BoolPtrOutput) } +type OrganizationRulesetRulesRequiredCodeScanning struct { + // Tools that must provide code scanning results for this rule to pass. + RequiredCodeScanningTools []OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningTool `pulumi:"requiredCodeScanningTools"` +} + +// OrganizationRulesetRulesRequiredCodeScanningInput is an input type that accepts OrganizationRulesetRulesRequiredCodeScanningArgs and OrganizationRulesetRulesRequiredCodeScanningOutput values. +// You can construct a concrete instance of `OrganizationRulesetRulesRequiredCodeScanningInput` via: +// +// OrganizationRulesetRulesRequiredCodeScanningArgs{...} +type OrganizationRulesetRulesRequiredCodeScanningInput interface { + pulumi.Input + + ToOrganizationRulesetRulesRequiredCodeScanningOutput() OrganizationRulesetRulesRequiredCodeScanningOutput + ToOrganizationRulesetRulesRequiredCodeScanningOutputWithContext(context.Context) OrganizationRulesetRulesRequiredCodeScanningOutput +} + +type OrganizationRulesetRulesRequiredCodeScanningArgs struct { + // Tools that must provide code scanning results for this rule to pass. + RequiredCodeScanningTools OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArrayInput `pulumi:"requiredCodeScanningTools"` +} + +func (OrganizationRulesetRulesRequiredCodeScanningArgs) ElementType() reflect.Type { + return reflect.TypeOf((*OrganizationRulesetRulesRequiredCodeScanning)(nil)).Elem() +} + +func (i OrganizationRulesetRulesRequiredCodeScanningArgs) ToOrganizationRulesetRulesRequiredCodeScanningOutput() OrganizationRulesetRulesRequiredCodeScanningOutput { + return i.ToOrganizationRulesetRulesRequiredCodeScanningOutputWithContext(context.Background()) +} + +func (i OrganizationRulesetRulesRequiredCodeScanningArgs) ToOrganizationRulesetRulesRequiredCodeScanningOutputWithContext(ctx context.Context) OrganizationRulesetRulesRequiredCodeScanningOutput { + return pulumi.ToOutputWithContext(ctx, i).(OrganizationRulesetRulesRequiredCodeScanningOutput) +} + +func (i OrganizationRulesetRulesRequiredCodeScanningArgs) ToOrganizationRulesetRulesRequiredCodeScanningPtrOutput() OrganizationRulesetRulesRequiredCodeScanningPtrOutput { + return i.ToOrganizationRulesetRulesRequiredCodeScanningPtrOutputWithContext(context.Background()) +} + +func (i OrganizationRulesetRulesRequiredCodeScanningArgs) ToOrganizationRulesetRulesRequiredCodeScanningPtrOutputWithContext(ctx context.Context) OrganizationRulesetRulesRequiredCodeScanningPtrOutput { + return pulumi.ToOutputWithContext(ctx, i).(OrganizationRulesetRulesRequiredCodeScanningOutput).ToOrganizationRulesetRulesRequiredCodeScanningPtrOutputWithContext(ctx) +} + +// OrganizationRulesetRulesRequiredCodeScanningPtrInput is an input type that accepts OrganizationRulesetRulesRequiredCodeScanningArgs, OrganizationRulesetRulesRequiredCodeScanningPtr and OrganizationRulesetRulesRequiredCodeScanningPtrOutput values. +// You can construct a concrete instance of `OrganizationRulesetRulesRequiredCodeScanningPtrInput` via: +// +// OrganizationRulesetRulesRequiredCodeScanningArgs{...} +// +// or: +// +// nil +type OrganizationRulesetRulesRequiredCodeScanningPtrInput interface { + pulumi.Input + + ToOrganizationRulesetRulesRequiredCodeScanningPtrOutput() OrganizationRulesetRulesRequiredCodeScanningPtrOutput + ToOrganizationRulesetRulesRequiredCodeScanningPtrOutputWithContext(context.Context) OrganizationRulesetRulesRequiredCodeScanningPtrOutput +} + +type organizationRulesetRulesRequiredCodeScanningPtrType OrganizationRulesetRulesRequiredCodeScanningArgs + +func OrganizationRulesetRulesRequiredCodeScanningPtr(v *OrganizationRulesetRulesRequiredCodeScanningArgs) OrganizationRulesetRulesRequiredCodeScanningPtrInput { + return (*organizationRulesetRulesRequiredCodeScanningPtrType)(v) +} + +func (*organizationRulesetRulesRequiredCodeScanningPtrType) ElementType() reflect.Type { + return reflect.TypeOf((**OrganizationRulesetRulesRequiredCodeScanning)(nil)).Elem() +} + +func (i *organizationRulesetRulesRequiredCodeScanningPtrType) ToOrganizationRulesetRulesRequiredCodeScanningPtrOutput() OrganizationRulesetRulesRequiredCodeScanningPtrOutput { + return i.ToOrganizationRulesetRulesRequiredCodeScanningPtrOutputWithContext(context.Background()) +} + +func (i *organizationRulesetRulesRequiredCodeScanningPtrType) ToOrganizationRulesetRulesRequiredCodeScanningPtrOutputWithContext(ctx context.Context) OrganizationRulesetRulesRequiredCodeScanningPtrOutput { + return pulumi.ToOutputWithContext(ctx, i).(OrganizationRulesetRulesRequiredCodeScanningPtrOutput) +} + +type OrganizationRulesetRulesRequiredCodeScanningOutput struct{ *pulumi.OutputState } + +func (OrganizationRulesetRulesRequiredCodeScanningOutput) ElementType() reflect.Type { + return reflect.TypeOf((*OrganizationRulesetRulesRequiredCodeScanning)(nil)).Elem() +} + +func (o OrganizationRulesetRulesRequiredCodeScanningOutput) ToOrganizationRulesetRulesRequiredCodeScanningOutput() OrganizationRulesetRulesRequiredCodeScanningOutput { + return o +} + +func (o OrganizationRulesetRulesRequiredCodeScanningOutput) ToOrganizationRulesetRulesRequiredCodeScanningOutputWithContext(ctx context.Context) OrganizationRulesetRulesRequiredCodeScanningOutput { + return o +} + +func (o OrganizationRulesetRulesRequiredCodeScanningOutput) ToOrganizationRulesetRulesRequiredCodeScanningPtrOutput() OrganizationRulesetRulesRequiredCodeScanningPtrOutput { + return o.ToOrganizationRulesetRulesRequiredCodeScanningPtrOutputWithContext(context.Background()) +} + +func (o OrganizationRulesetRulesRequiredCodeScanningOutput) ToOrganizationRulesetRulesRequiredCodeScanningPtrOutputWithContext(ctx context.Context) OrganizationRulesetRulesRequiredCodeScanningPtrOutput { + return o.ApplyTWithContext(ctx, func(_ context.Context, v OrganizationRulesetRulesRequiredCodeScanning) *OrganizationRulesetRulesRequiredCodeScanning { + return &v + }).(OrganizationRulesetRulesRequiredCodeScanningPtrOutput) +} + +// Tools that must provide code scanning results for this rule to pass. +func (o OrganizationRulesetRulesRequiredCodeScanningOutput) RequiredCodeScanningTools() OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArrayOutput { + return o.ApplyT(func(v OrganizationRulesetRulesRequiredCodeScanning) []OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningTool { + return v.RequiredCodeScanningTools + }).(OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArrayOutput) +} + +type OrganizationRulesetRulesRequiredCodeScanningPtrOutput struct{ *pulumi.OutputState } + +func (OrganizationRulesetRulesRequiredCodeScanningPtrOutput) ElementType() reflect.Type { + return reflect.TypeOf((**OrganizationRulesetRulesRequiredCodeScanning)(nil)).Elem() +} + +func (o OrganizationRulesetRulesRequiredCodeScanningPtrOutput) ToOrganizationRulesetRulesRequiredCodeScanningPtrOutput() OrganizationRulesetRulesRequiredCodeScanningPtrOutput { + return o +} + +func (o OrganizationRulesetRulesRequiredCodeScanningPtrOutput) ToOrganizationRulesetRulesRequiredCodeScanningPtrOutputWithContext(ctx context.Context) OrganizationRulesetRulesRequiredCodeScanningPtrOutput { + return o +} + +func (o OrganizationRulesetRulesRequiredCodeScanningPtrOutput) Elem() OrganizationRulesetRulesRequiredCodeScanningOutput { + return o.ApplyT(func(v *OrganizationRulesetRulesRequiredCodeScanning) OrganizationRulesetRulesRequiredCodeScanning { + if v != nil { + return *v + } + var ret OrganizationRulesetRulesRequiredCodeScanning + return ret + }).(OrganizationRulesetRulesRequiredCodeScanningOutput) +} + +// Tools that must provide code scanning results for this rule to pass. +func (o OrganizationRulesetRulesRequiredCodeScanningPtrOutput) RequiredCodeScanningTools() OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArrayOutput { + return o.ApplyT(func(v *OrganizationRulesetRulesRequiredCodeScanning) []OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningTool { + if v == nil { + return nil + } + return v.RequiredCodeScanningTools + }).(OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArrayOutput) +} + +type OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningTool struct { + // The severity level at which code scanning results that raise alerts block a reference update. Can be one of: `none`, `errors`, `errorsAndWarnings`, `all`. + AlertsThreshold string `pulumi:"alertsThreshold"` + // The severity level at which code scanning results that raise security alerts block a reference update. Can be one of: `none`, `critical`, `highOrHigher`, `mediumOrHigher`, `all`. + SecurityAlertsThreshold string `pulumi:"securityAlertsThreshold"` + // The name of a code scanning tool. + Tool string `pulumi:"tool"` +} + +// OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningToolInput is an input type that accepts OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArgs and OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningToolOutput values. +// You can construct a concrete instance of `OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningToolInput` via: +// +// OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArgs{...} +type OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningToolInput interface { + pulumi.Input + + ToOrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningToolOutput() OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningToolOutput + ToOrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningToolOutputWithContext(context.Context) OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningToolOutput +} + +type OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArgs struct { + // The severity level at which code scanning results that raise alerts block a reference update. Can be one of: `none`, `errors`, `errorsAndWarnings`, `all`. + AlertsThreshold pulumi.StringInput `pulumi:"alertsThreshold"` + // The severity level at which code scanning results that raise security alerts block a reference update. Can be one of: `none`, `critical`, `highOrHigher`, `mediumOrHigher`, `all`. + SecurityAlertsThreshold pulumi.StringInput `pulumi:"securityAlertsThreshold"` + // The name of a code scanning tool. + Tool pulumi.StringInput `pulumi:"tool"` +} + +func (OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArgs) ElementType() reflect.Type { + return reflect.TypeOf((*OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningTool)(nil)).Elem() +} + +func (i OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArgs) ToOrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningToolOutput() OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningToolOutput { + return i.ToOrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningToolOutputWithContext(context.Background()) +} + +func (i OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArgs) ToOrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningToolOutputWithContext(ctx context.Context) OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningToolOutput { + return pulumi.ToOutputWithContext(ctx, i).(OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningToolOutput) +} + +// OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArrayInput is an input type that accepts OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArray and OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArrayOutput values. +// You can construct a concrete instance of `OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArrayInput` via: +// +// OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArray{ OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArgs{...} } +type OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArrayInput interface { + pulumi.Input + + ToOrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArrayOutput() OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArrayOutput + ToOrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArrayOutputWithContext(context.Context) OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArrayOutput +} + +type OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArray []OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningToolInput + +func (OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArray) ElementType() reflect.Type { + return reflect.TypeOf((*[]OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningTool)(nil)).Elem() +} + +func (i OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArray) ToOrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArrayOutput() OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArrayOutput { + return i.ToOrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArrayOutputWithContext(context.Background()) +} + +func (i OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArray) ToOrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArrayOutputWithContext(ctx context.Context) OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArrayOutput { + return pulumi.ToOutputWithContext(ctx, i).(OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArrayOutput) +} + +type OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningToolOutput struct{ *pulumi.OutputState } + +func (OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningToolOutput) ElementType() reflect.Type { + return reflect.TypeOf((*OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningTool)(nil)).Elem() +} + +func (o OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningToolOutput) ToOrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningToolOutput() OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningToolOutput { + return o +} + +func (o OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningToolOutput) ToOrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningToolOutputWithContext(ctx context.Context) OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningToolOutput { + return o +} + +// The severity level at which code scanning results that raise alerts block a reference update. Can be one of: `none`, `errors`, `errorsAndWarnings`, `all`. +func (o OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningToolOutput) AlertsThreshold() pulumi.StringOutput { + return o.ApplyT(func(v OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningTool) string { + return v.AlertsThreshold + }).(pulumi.StringOutput) +} + +// The severity level at which code scanning results that raise security alerts block a reference update. Can be one of: `none`, `critical`, `highOrHigher`, `mediumOrHigher`, `all`. +func (o OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningToolOutput) SecurityAlertsThreshold() pulumi.StringOutput { + return o.ApplyT(func(v OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningTool) string { + return v.SecurityAlertsThreshold + }).(pulumi.StringOutput) +} + +// The name of a code scanning tool. +func (o OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningToolOutput) Tool() pulumi.StringOutput { + return o.ApplyT(func(v OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningTool) string { return v.Tool }).(pulumi.StringOutput) +} + +type OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArrayOutput struct{ *pulumi.OutputState } + +func (OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArrayOutput) ElementType() reflect.Type { + return reflect.TypeOf((*[]OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningTool)(nil)).Elem() +} + +func (o OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArrayOutput) ToOrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArrayOutput() OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArrayOutput { + return o +} + +func (o OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArrayOutput) ToOrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArrayOutputWithContext(ctx context.Context) OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArrayOutput { + return o +} + +func (o OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArrayOutput) Index(i pulumi.IntInput) OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningToolOutput { + return pulumi.All(o, i).ApplyT(func(vs []interface{}) OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningTool { + return vs[0].([]OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningTool)[vs[1].(int)] + }).(OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningToolOutput) +} + type OrganizationRulesetRulesRequiredStatusChecks struct { // Status checks that are required. Several can be defined. RequiredChecks []OrganizationRulesetRulesRequiredStatusChecksRequiredCheck `pulumi:"requiredChecks"` @@ -6640,6 +6919,8 @@ type RepositoryRulesetRules struct { NonFastForward *bool `pulumi:"nonFastForward"` // (Block List, Max: 1) Require all commits be made to a non-target branch and submitted via a pull request before they can be merged. (see below for nested schema) PullRequest *RepositoryRulesetRulesPullRequest `pulumi:"pullRequest"` + // (Block List, Max: 1) Define which tools must provide code scanning results before the reference is updated. When configured, code scanning must be enabled and have results for both the commit and the reference being updated. Multiple code scanning tools can be specified. (see below for nested schema) + RequiredCodeScanning *RepositoryRulesetRulesRequiredCodeScanning `pulumi:"requiredCodeScanning"` // (Block List, Max: 1) Choose which environments must be successfully deployed to before branches can be merged into a branch that matches this rule. (see below for nested schema) RequiredDeployments *RepositoryRulesetRulesRequiredDeployments `pulumi:"requiredDeployments"` // (Boolean) Prevent merge commits from being pushed to matching branches. @@ -6684,6 +6965,8 @@ type RepositoryRulesetRulesArgs struct { NonFastForward pulumi.BoolPtrInput `pulumi:"nonFastForward"` // (Block List, Max: 1) Require all commits be made to a non-target branch and submitted via a pull request before they can be merged. (see below for nested schema) PullRequest RepositoryRulesetRulesPullRequestPtrInput `pulumi:"pullRequest"` + // (Block List, Max: 1) Define which tools must provide code scanning results before the reference is updated. When configured, code scanning must be enabled and have results for both the commit and the reference being updated. Multiple code scanning tools can be specified. (see below for nested schema) + RequiredCodeScanning RepositoryRulesetRulesRequiredCodeScanningPtrInput `pulumi:"requiredCodeScanning"` // (Block List, Max: 1) Choose which environments must be successfully deployed to before branches can be merged into a branch that matches this rule. (see below for nested schema) RequiredDeployments RepositoryRulesetRulesRequiredDeploymentsPtrInput `pulumi:"requiredDeployments"` // (Boolean) Prevent merge commits from being pushed to matching branches. @@ -6823,6 +7106,13 @@ func (o RepositoryRulesetRulesOutput) PullRequest() RepositoryRulesetRulesPullRe return o.ApplyT(func(v RepositoryRulesetRules) *RepositoryRulesetRulesPullRequest { return v.PullRequest }).(RepositoryRulesetRulesPullRequestPtrOutput) } +// (Block List, Max: 1) Define which tools must provide code scanning results before the reference is updated. When configured, code scanning must be enabled and have results for both the commit and the reference being updated. Multiple code scanning tools can be specified. (see below for nested schema) +func (o RepositoryRulesetRulesOutput) RequiredCodeScanning() RepositoryRulesetRulesRequiredCodeScanningPtrOutput { + return o.ApplyT(func(v RepositoryRulesetRules) *RepositoryRulesetRulesRequiredCodeScanning { + return v.RequiredCodeScanning + }).(RepositoryRulesetRulesRequiredCodeScanningPtrOutput) +} + // (Block List, Max: 1) Choose which environments must be successfully deployed to before branches can be merged into a branch that matches this rule. (see below for nested schema) func (o RepositoryRulesetRulesOutput) RequiredDeployments() RepositoryRulesetRulesRequiredDeploymentsPtrOutput { return o.ApplyT(func(v RepositoryRulesetRules) *RepositoryRulesetRulesRequiredDeployments { @@ -6966,6 +7256,16 @@ func (o RepositoryRulesetRulesPtrOutput) PullRequest() RepositoryRulesetRulesPul }).(RepositoryRulesetRulesPullRequestPtrOutput) } +// (Block List, Max: 1) Define which tools must provide code scanning results before the reference is updated. When configured, code scanning must be enabled and have results for both the commit and the reference being updated. Multiple code scanning tools can be specified. (see below for nested schema) +func (o RepositoryRulesetRulesPtrOutput) RequiredCodeScanning() RepositoryRulesetRulesRequiredCodeScanningPtrOutput { + return o.ApplyT(func(v *RepositoryRulesetRules) *RepositoryRulesetRulesRequiredCodeScanning { + if v == nil { + return nil + } + return v.RequiredCodeScanning + }).(RepositoryRulesetRulesRequiredCodeScanningPtrOutput) +} + // (Block List, Max: 1) Choose which environments must be successfully deployed to before branches can be merged into a branch that matches this rule. (see below for nested schema) func (o RepositoryRulesetRulesPtrOutput) RequiredDeployments() RepositoryRulesetRulesRequiredDeploymentsPtrOutput { return o.ApplyT(func(v *RepositoryRulesetRules) *RepositoryRulesetRulesRequiredDeployments { @@ -8025,6 +8325,264 @@ func (o RepositoryRulesetRulesPullRequestPtrOutput) RequiredReviewThreadResoluti }).(pulumi.BoolPtrOutput) } +type RepositoryRulesetRulesRequiredCodeScanning struct { + // Tools that must provide code scanning results for this rule to pass. + RequiredCodeScanningTools []RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningTool `pulumi:"requiredCodeScanningTools"` +} + +// RepositoryRulesetRulesRequiredCodeScanningInput is an input type that accepts RepositoryRulesetRulesRequiredCodeScanningArgs and RepositoryRulesetRulesRequiredCodeScanningOutput values. +// You can construct a concrete instance of `RepositoryRulesetRulesRequiredCodeScanningInput` via: +// +// RepositoryRulesetRulesRequiredCodeScanningArgs{...} +type RepositoryRulesetRulesRequiredCodeScanningInput interface { + pulumi.Input + + ToRepositoryRulesetRulesRequiredCodeScanningOutput() RepositoryRulesetRulesRequiredCodeScanningOutput + ToRepositoryRulesetRulesRequiredCodeScanningOutputWithContext(context.Context) RepositoryRulesetRulesRequiredCodeScanningOutput +} + +type RepositoryRulesetRulesRequiredCodeScanningArgs struct { + // Tools that must provide code scanning results for this rule to pass. + RequiredCodeScanningTools RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArrayInput `pulumi:"requiredCodeScanningTools"` +} + +func (RepositoryRulesetRulesRequiredCodeScanningArgs) ElementType() reflect.Type { + return reflect.TypeOf((*RepositoryRulesetRulesRequiredCodeScanning)(nil)).Elem() +} + +func (i RepositoryRulesetRulesRequiredCodeScanningArgs) ToRepositoryRulesetRulesRequiredCodeScanningOutput() RepositoryRulesetRulesRequiredCodeScanningOutput { + return i.ToRepositoryRulesetRulesRequiredCodeScanningOutputWithContext(context.Background()) +} + +func (i RepositoryRulesetRulesRequiredCodeScanningArgs) ToRepositoryRulesetRulesRequiredCodeScanningOutputWithContext(ctx context.Context) RepositoryRulesetRulesRequiredCodeScanningOutput { + return pulumi.ToOutputWithContext(ctx, i).(RepositoryRulesetRulesRequiredCodeScanningOutput) +} + +func (i RepositoryRulesetRulesRequiredCodeScanningArgs) ToRepositoryRulesetRulesRequiredCodeScanningPtrOutput() RepositoryRulesetRulesRequiredCodeScanningPtrOutput { + return i.ToRepositoryRulesetRulesRequiredCodeScanningPtrOutputWithContext(context.Background()) +} + +func (i RepositoryRulesetRulesRequiredCodeScanningArgs) ToRepositoryRulesetRulesRequiredCodeScanningPtrOutputWithContext(ctx context.Context) RepositoryRulesetRulesRequiredCodeScanningPtrOutput { + return pulumi.ToOutputWithContext(ctx, i).(RepositoryRulesetRulesRequiredCodeScanningOutput).ToRepositoryRulesetRulesRequiredCodeScanningPtrOutputWithContext(ctx) +} + +// RepositoryRulesetRulesRequiredCodeScanningPtrInput is an input type that accepts RepositoryRulesetRulesRequiredCodeScanningArgs, RepositoryRulesetRulesRequiredCodeScanningPtr and RepositoryRulesetRulesRequiredCodeScanningPtrOutput values. +// You can construct a concrete instance of `RepositoryRulesetRulesRequiredCodeScanningPtrInput` via: +// +// RepositoryRulesetRulesRequiredCodeScanningArgs{...} +// +// or: +// +// nil +type RepositoryRulesetRulesRequiredCodeScanningPtrInput interface { + pulumi.Input + + ToRepositoryRulesetRulesRequiredCodeScanningPtrOutput() RepositoryRulesetRulesRequiredCodeScanningPtrOutput + ToRepositoryRulesetRulesRequiredCodeScanningPtrOutputWithContext(context.Context) RepositoryRulesetRulesRequiredCodeScanningPtrOutput +} + +type repositoryRulesetRulesRequiredCodeScanningPtrType RepositoryRulesetRulesRequiredCodeScanningArgs + +func RepositoryRulesetRulesRequiredCodeScanningPtr(v *RepositoryRulesetRulesRequiredCodeScanningArgs) RepositoryRulesetRulesRequiredCodeScanningPtrInput { + return (*repositoryRulesetRulesRequiredCodeScanningPtrType)(v) +} + +func (*repositoryRulesetRulesRequiredCodeScanningPtrType) ElementType() reflect.Type { + return reflect.TypeOf((**RepositoryRulesetRulesRequiredCodeScanning)(nil)).Elem() +} + +func (i *repositoryRulesetRulesRequiredCodeScanningPtrType) ToRepositoryRulesetRulesRequiredCodeScanningPtrOutput() RepositoryRulesetRulesRequiredCodeScanningPtrOutput { + return i.ToRepositoryRulesetRulesRequiredCodeScanningPtrOutputWithContext(context.Background()) +} + +func (i *repositoryRulesetRulesRequiredCodeScanningPtrType) ToRepositoryRulesetRulesRequiredCodeScanningPtrOutputWithContext(ctx context.Context) RepositoryRulesetRulesRequiredCodeScanningPtrOutput { + return pulumi.ToOutputWithContext(ctx, i).(RepositoryRulesetRulesRequiredCodeScanningPtrOutput) +} + +type RepositoryRulesetRulesRequiredCodeScanningOutput struct{ *pulumi.OutputState } + +func (RepositoryRulesetRulesRequiredCodeScanningOutput) ElementType() reflect.Type { + return reflect.TypeOf((*RepositoryRulesetRulesRequiredCodeScanning)(nil)).Elem() +} + +func (o RepositoryRulesetRulesRequiredCodeScanningOutput) ToRepositoryRulesetRulesRequiredCodeScanningOutput() RepositoryRulesetRulesRequiredCodeScanningOutput { + return o +} + +func (o RepositoryRulesetRulesRequiredCodeScanningOutput) ToRepositoryRulesetRulesRequiredCodeScanningOutputWithContext(ctx context.Context) RepositoryRulesetRulesRequiredCodeScanningOutput { + return o +} + +func (o RepositoryRulesetRulesRequiredCodeScanningOutput) ToRepositoryRulesetRulesRequiredCodeScanningPtrOutput() RepositoryRulesetRulesRequiredCodeScanningPtrOutput { + return o.ToRepositoryRulesetRulesRequiredCodeScanningPtrOutputWithContext(context.Background()) +} + +func (o RepositoryRulesetRulesRequiredCodeScanningOutput) ToRepositoryRulesetRulesRequiredCodeScanningPtrOutputWithContext(ctx context.Context) RepositoryRulesetRulesRequiredCodeScanningPtrOutput { + return o.ApplyTWithContext(ctx, func(_ context.Context, v RepositoryRulesetRulesRequiredCodeScanning) *RepositoryRulesetRulesRequiredCodeScanning { + return &v + }).(RepositoryRulesetRulesRequiredCodeScanningPtrOutput) +} + +// Tools that must provide code scanning results for this rule to pass. +func (o RepositoryRulesetRulesRequiredCodeScanningOutput) RequiredCodeScanningTools() RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArrayOutput { + return o.ApplyT(func(v RepositoryRulesetRulesRequiredCodeScanning) []RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningTool { + return v.RequiredCodeScanningTools + }).(RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArrayOutput) +} + +type RepositoryRulesetRulesRequiredCodeScanningPtrOutput struct{ *pulumi.OutputState } + +func (RepositoryRulesetRulesRequiredCodeScanningPtrOutput) ElementType() reflect.Type { + return reflect.TypeOf((**RepositoryRulesetRulesRequiredCodeScanning)(nil)).Elem() +} + +func (o RepositoryRulesetRulesRequiredCodeScanningPtrOutput) ToRepositoryRulesetRulesRequiredCodeScanningPtrOutput() RepositoryRulesetRulesRequiredCodeScanningPtrOutput { + return o +} + +func (o RepositoryRulesetRulesRequiredCodeScanningPtrOutput) ToRepositoryRulesetRulesRequiredCodeScanningPtrOutputWithContext(ctx context.Context) RepositoryRulesetRulesRequiredCodeScanningPtrOutput { + return o +} + +func (o RepositoryRulesetRulesRequiredCodeScanningPtrOutput) Elem() RepositoryRulesetRulesRequiredCodeScanningOutput { + return o.ApplyT(func(v *RepositoryRulesetRulesRequiredCodeScanning) RepositoryRulesetRulesRequiredCodeScanning { + if v != nil { + return *v + } + var ret RepositoryRulesetRulesRequiredCodeScanning + return ret + }).(RepositoryRulesetRulesRequiredCodeScanningOutput) +} + +// Tools that must provide code scanning results for this rule to pass. +func (o RepositoryRulesetRulesRequiredCodeScanningPtrOutput) RequiredCodeScanningTools() RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArrayOutput { + return o.ApplyT(func(v *RepositoryRulesetRulesRequiredCodeScanning) []RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningTool { + if v == nil { + return nil + } + return v.RequiredCodeScanningTools + }).(RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArrayOutput) +} + +type RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningTool struct { + // The severity level at which code scanning results that raise alerts block a reference update. Can be one of: `none`, `errors`, `errorsAndWarnings`, `all`. + AlertsThreshold string `pulumi:"alertsThreshold"` + // The severity level at which code scanning results that raise security alerts block a reference update. Can be one of: `none`, `critical`, `highOrHigher`, `mediumOrHigher`, `all`. + SecurityAlertsThreshold string `pulumi:"securityAlertsThreshold"` + // The name of a code scanning tool + Tool string `pulumi:"tool"` +} + +// RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningToolInput is an input type that accepts RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArgs and RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningToolOutput values. +// You can construct a concrete instance of `RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningToolInput` via: +// +// RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArgs{...} +type RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningToolInput interface { + pulumi.Input + + ToRepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningToolOutput() RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningToolOutput + ToRepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningToolOutputWithContext(context.Context) RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningToolOutput +} + +type RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArgs struct { + // The severity level at which code scanning results that raise alerts block a reference update. Can be one of: `none`, `errors`, `errorsAndWarnings`, `all`. + AlertsThreshold pulumi.StringInput `pulumi:"alertsThreshold"` + // The severity level at which code scanning results that raise security alerts block a reference update. Can be one of: `none`, `critical`, `highOrHigher`, `mediumOrHigher`, `all`. + SecurityAlertsThreshold pulumi.StringInput `pulumi:"securityAlertsThreshold"` + // The name of a code scanning tool + Tool pulumi.StringInput `pulumi:"tool"` +} + +func (RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArgs) ElementType() reflect.Type { + return reflect.TypeOf((*RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningTool)(nil)).Elem() +} + +func (i RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArgs) ToRepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningToolOutput() RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningToolOutput { + return i.ToRepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningToolOutputWithContext(context.Background()) +} + +func (i RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArgs) ToRepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningToolOutputWithContext(ctx context.Context) RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningToolOutput { + return pulumi.ToOutputWithContext(ctx, i).(RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningToolOutput) +} + +// RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArrayInput is an input type that accepts RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArray and RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArrayOutput values. +// You can construct a concrete instance of `RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArrayInput` via: +// +// RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArray{ RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArgs{...} } +type RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArrayInput interface { + pulumi.Input + + ToRepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArrayOutput() RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArrayOutput + ToRepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArrayOutputWithContext(context.Context) RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArrayOutput +} + +type RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArray []RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningToolInput + +func (RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArray) ElementType() reflect.Type { + return reflect.TypeOf((*[]RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningTool)(nil)).Elem() +} + +func (i RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArray) ToRepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArrayOutput() RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArrayOutput { + return i.ToRepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArrayOutputWithContext(context.Background()) +} + +func (i RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArray) ToRepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArrayOutputWithContext(ctx context.Context) RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArrayOutput { + return pulumi.ToOutputWithContext(ctx, i).(RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArrayOutput) +} + +type RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningToolOutput struct{ *pulumi.OutputState } + +func (RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningToolOutput) ElementType() reflect.Type { + return reflect.TypeOf((*RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningTool)(nil)).Elem() +} + +func (o RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningToolOutput) ToRepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningToolOutput() RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningToolOutput { + return o +} + +func (o RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningToolOutput) ToRepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningToolOutputWithContext(ctx context.Context) RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningToolOutput { + return o +} + +// The severity level at which code scanning results that raise alerts block a reference update. Can be one of: `none`, `errors`, `errorsAndWarnings`, `all`. +func (o RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningToolOutput) AlertsThreshold() pulumi.StringOutput { + return o.ApplyT(func(v RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningTool) string { + return v.AlertsThreshold + }).(pulumi.StringOutput) +} + +// The severity level at which code scanning results that raise security alerts block a reference update. Can be one of: `none`, `critical`, `highOrHigher`, `mediumOrHigher`, `all`. +func (o RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningToolOutput) SecurityAlertsThreshold() pulumi.StringOutput { + return o.ApplyT(func(v RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningTool) string { + return v.SecurityAlertsThreshold + }).(pulumi.StringOutput) +} + +// The name of a code scanning tool +func (o RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningToolOutput) Tool() pulumi.StringOutput { + return o.ApplyT(func(v RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningTool) string { return v.Tool }).(pulumi.StringOutput) +} + +type RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArrayOutput struct{ *pulumi.OutputState } + +func (RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArrayOutput) ElementType() reflect.Type { + return reflect.TypeOf((*[]RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningTool)(nil)).Elem() +} + +func (o RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArrayOutput) ToRepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArrayOutput() RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArrayOutput { + return o +} + +func (o RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArrayOutput) ToRepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArrayOutputWithContext(ctx context.Context) RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArrayOutput { + return o +} + +func (o RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArrayOutput) Index(i pulumi.IntInput) RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningToolOutput { + return pulumi.All(o, i).ApplyT(func(vs []interface{}) RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningTool { + return vs[0].([]RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningTool)[vs[1].(int)] + }).(RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningToolOutput) +} + type RepositoryRulesetRulesRequiredDeployments struct { // The environments that must be successfully deployed to before branches can be merged. RequiredDeploymentEnvironments []string `pulumi:"requiredDeploymentEnvironments"` @@ -14776,6 +15334,10 @@ func init() { pulumi.RegisterInputType(reflect.TypeOf((*OrganizationRulesetRulesCommitterEmailPatternPtrInput)(nil)).Elem(), OrganizationRulesetRulesCommitterEmailPatternArgs{}) pulumi.RegisterInputType(reflect.TypeOf((*OrganizationRulesetRulesPullRequestInput)(nil)).Elem(), OrganizationRulesetRulesPullRequestArgs{}) pulumi.RegisterInputType(reflect.TypeOf((*OrganizationRulesetRulesPullRequestPtrInput)(nil)).Elem(), OrganizationRulesetRulesPullRequestArgs{}) + pulumi.RegisterInputType(reflect.TypeOf((*OrganizationRulesetRulesRequiredCodeScanningInput)(nil)).Elem(), OrganizationRulesetRulesRequiredCodeScanningArgs{}) + pulumi.RegisterInputType(reflect.TypeOf((*OrganizationRulesetRulesRequiredCodeScanningPtrInput)(nil)).Elem(), OrganizationRulesetRulesRequiredCodeScanningArgs{}) + pulumi.RegisterInputType(reflect.TypeOf((*OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningToolInput)(nil)).Elem(), OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArgs{}) + pulumi.RegisterInputType(reflect.TypeOf((*OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArrayInput)(nil)).Elem(), OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArray{}) pulumi.RegisterInputType(reflect.TypeOf((*OrganizationRulesetRulesRequiredStatusChecksInput)(nil)).Elem(), OrganizationRulesetRulesRequiredStatusChecksArgs{}) pulumi.RegisterInputType(reflect.TypeOf((*OrganizationRulesetRulesRequiredStatusChecksPtrInput)(nil)).Elem(), OrganizationRulesetRulesRequiredStatusChecksArgs{}) pulumi.RegisterInputType(reflect.TypeOf((*OrganizationRulesetRulesRequiredStatusChecksRequiredCheckInput)(nil)).Elem(), OrganizationRulesetRulesRequiredStatusChecksRequiredCheckArgs{}) @@ -14820,6 +15382,10 @@ func init() { pulumi.RegisterInputType(reflect.TypeOf((*RepositoryRulesetRulesCommitterEmailPatternPtrInput)(nil)).Elem(), RepositoryRulesetRulesCommitterEmailPatternArgs{}) pulumi.RegisterInputType(reflect.TypeOf((*RepositoryRulesetRulesPullRequestInput)(nil)).Elem(), RepositoryRulesetRulesPullRequestArgs{}) pulumi.RegisterInputType(reflect.TypeOf((*RepositoryRulesetRulesPullRequestPtrInput)(nil)).Elem(), RepositoryRulesetRulesPullRequestArgs{}) + pulumi.RegisterInputType(reflect.TypeOf((*RepositoryRulesetRulesRequiredCodeScanningInput)(nil)).Elem(), RepositoryRulesetRulesRequiredCodeScanningArgs{}) + pulumi.RegisterInputType(reflect.TypeOf((*RepositoryRulesetRulesRequiredCodeScanningPtrInput)(nil)).Elem(), RepositoryRulesetRulesRequiredCodeScanningArgs{}) + pulumi.RegisterInputType(reflect.TypeOf((*RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningToolInput)(nil)).Elem(), RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArgs{}) + pulumi.RegisterInputType(reflect.TypeOf((*RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArrayInput)(nil)).Elem(), RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArray{}) pulumi.RegisterInputType(reflect.TypeOf((*RepositoryRulesetRulesRequiredDeploymentsInput)(nil)).Elem(), RepositoryRulesetRulesRequiredDeploymentsArgs{}) pulumi.RegisterInputType(reflect.TypeOf((*RepositoryRulesetRulesRequiredDeploymentsPtrInput)(nil)).Elem(), RepositoryRulesetRulesRequiredDeploymentsArgs{}) pulumi.RegisterInputType(reflect.TypeOf((*RepositoryRulesetRulesRequiredStatusChecksInput)(nil)).Elem(), RepositoryRulesetRulesRequiredStatusChecksArgs{}) @@ -14964,6 +15530,10 @@ func init() { pulumi.RegisterOutputType(OrganizationRulesetRulesCommitterEmailPatternPtrOutput{}) pulumi.RegisterOutputType(OrganizationRulesetRulesPullRequestOutput{}) pulumi.RegisterOutputType(OrganizationRulesetRulesPullRequestPtrOutput{}) + pulumi.RegisterOutputType(OrganizationRulesetRulesRequiredCodeScanningOutput{}) + pulumi.RegisterOutputType(OrganizationRulesetRulesRequiredCodeScanningPtrOutput{}) + pulumi.RegisterOutputType(OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningToolOutput{}) + pulumi.RegisterOutputType(OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArrayOutput{}) pulumi.RegisterOutputType(OrganizationRulesetRulesRequiredStatusChecksOutput{}) pulumi.RegisterOutputType(OrganizationRulesetRulesRequiredStatusChecksPtrOutput{}) pulumi.RegisterOutputType(OrganizationRulesetRulesRequiredStatusChecksRequiredCheckOutput{}) @@ -15008,6 +15578,10 @@ func init() { pulumi.RegisterOutputType(RepositoryRulesetRulesCommitterEmailPatternPtrOutput{}) pulumi.RegisterOutputType(RepositoryRulesetRulesPullRequestOutput{}) pulumi.RegisterOutputType(RepositoryRulesetRulesPullRequestPtrOutput{}) + pulumi.RegisterOutputType(RepositoryRulesetRulesRequiredCodeScanningOutput{}) + pulumi.RegisterOutputType(RepositoryRulesetRulesRequiredCodeScanningPtrOutput{}) + pulumi.RegisterOutputType(RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningToolOutput{}) + pulumi.RegisterOutputType(RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArrayOutput{}) pulumi.RegisterOutputType(RepositoryRulesetRulesRequiredDeploymentsOutput{}) pulumi.RegisterOutputType(RepositoryRulesetRulesRequiredDeploymentsPtrOutput{}) pulumi.RegisterOutputType(RepositoryRulesetRulesRequiredStatusChecksOutput{}) diff --git a/sdk/go/github/repositoryEnvironmentDeploymentPolicy.go b/sdk/go/github/repositoryEnvironmentDeploymentPolicy.go index 5e7a8862..ab02ffef 100644 --- a/sdk/go/github/repositoryEnvironmentDeploymentPolicy.go +++ b/sdk/go/github/repositoryEnvironmentDeploymentPolicy.go @@ -16,6 +16,8 @@ import ( // // ## Example Usage // +// Create a branch-based deployment policy: +// // ```go // package main // @@ -73,6 +75,65 @@ import ( // // ``` // +// Create a tag-based deployment policy: +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-github/sdk/v6/go/github" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// current, err := github.GetUser(ctx, &github.GetUserArgs{ +// Username: "", +// }, nil) +// if err != nil { +// return err +// } +// test, err := github.NewRepository(ctx, "test", &github.RepositoryArgs{ +// Name: pulumi.String("tf-acc-test-%s"), +// }) +// if err != nil { +// return err +// } +// testRepositoryEnvironment, err := github.NewRepositoryEnvironment(ctx, "test", &github.RepositoryEnvironmentArgs{ +// Repository: test.Name, +// Environment: pulumi.String("environment/test"), +// WaitTimer: pulumi.Int(10000), +// Reviewers: github.RepositoryEnvironmentReviewerArray{ +// &github.RepositoryEnvironmentReviewerArgs{ +// Users: pulumi.IntArray{ +// pulumi.String(current.Id), +// }, +// }, +// }, +// DeploymentBranchPolicy: &github.RepositoryEnvironmentDeploymentBranchPolicyArgs{ +// ProtectedBranches: pulumi.Bool(false), +// CustomBranchPolicies: pulumi.Bool(true), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = github.NewRepositoryEnvironmentDeploymentPolicy(ctx, "test", &github.RepositoryEnvironmentDeploymentPolicyArgs{ +// Repository: test.Name, +// Environment: testRepositoryEnvironment.Environment, +// TagPattern: pulumi.String("v*"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // GitHub Repository Environment Deployment Policy can be imported using an ID made up of `name` of the repository combined with the `environment` name of the environment with the `Id` of the deployment policy, separated by a `:` character, e.g. @@ -83,12 +144,14 @@ import ( type RepositoryEnvironmentDeploymentPolicy struct { pulumi.CustomResourceState - // The name pattern that branches must match in order to deploy to the environment. - BranchPattern pulumi.StringOutput `pulumi:"branchPattern"` + // The name pattern that branches must match in order to deploy to the environment. If not specified, `tagPattern` must be specified. + BranchPattern pulumi.StringPtrOutput `pulumi:"branchPattern"` // The name of the environment. Environment pulumi.StringOutput `pulumi:"environment"` // The repository of the environment. Repository pulumi.StringOutput `pulumi:"repository"` + // The name pattern that tags must match in order to deploy to the environment. If not specified, `branchPattern` must be specified. + TagPattern pulumi.StringPtrOutput `pulumi:"tagPattern"` } // NewRepositoryEnvironmentDeploymentPolicy registers a new resource with the given unique name, arguments, and options. @@ -98,9 +161,6 @@ func NewRepositoryEnvironmentDeploymentPolicy(ctx *pulumi.Context, return nil, errors.New("missing one or more required arguments") } - if args.BranchPattern == nil { - return nil, errors.New("invalid value for required argument 'BranchPattern'") - } if args.Environment == nil { return nil, errors.New("invalid value for required argument 'Environment'") } @@ -130,21 +190,25 @@ func GetRepositoryEnvironmentDeploymentPolicy(ctx *pulumi.Context, // Input properties used for looking up and filtering RepositoryEnvironmentDeploymentPolicy resources. type repositoryEnvironmentDeploymentPolicyState struct { - // The name pattern that branches must match in order to deploy to the environment. + // The name pattern that branches must match in order to deploy to the environment. If not specified, `tagPattern` must be specified. BranchPattern *string `pulumi:"branchPattern"` // The name of the environment. Environment *string `pulumi:"environment"` // The repository of the environment. Repository *string `pulumi:"repository"` + // The name pattern that tags must match in order to deploy to the environment. If not specified, `branchPattern` must be specified. + TagPattern *string `pulumi:"tagPattern"` } type RepositoryEnvironmentDeploymentPolicyState struct { - // The name pattern that branches must match in order to deploy to the environment. + // The name pattern that branches must match in order to deploy to the environment. If not specified, `tagPattern` must be specified. BranchPattern pulumi.StringPtrInput // The name of the environment. Environment pulumi.StringPtrInput // The repository of the environment. Repository pulumi.StringPtrInput + // The name pattern that tags must match in order to deploy to the environment. If not specified, `branchPattern` must be specified. + TagPattern pulumi.StringPtrInput } func (RepositoryEnvironmentDeploymentPolicyState) ElementType() reflect.Type { @@ -152,22 +216,26 @@ func (RepositoryEnvironmentDeploymentPolicyState) ElementType() reflect.Type { } type repositoryEnvironmentDeploymentPolicyArgs struct { - // The name pattern that branches must match in order to deploy to the environment. - BranchPattern string `pulumi:"branchPattern"` + // The name pattern that branches must match in order to deploy to the environment. If not specified, `tagPattern` must be specified. + BranchPattern *string `pulumi:"branchPattern"` // The name of the environment. Environment string `pulumi:"environment"` // The repository of the environment. Repository string `pulumi:"repository"` + // The name pattern that tags must match in order to deploy to the environment. If not specified, `branchPattern` must be specified. + TagPattern *string `pulumi:"tagPattern"` } // The set of arguments for constructing a RepositoryEnvironmentDeploymentPolicy resource. type RepositoryEnvironmentDeploymentPolicyArgs struct { - // The name pattern that branches must match in order to deploy to the environment. - BranchPattern pulumi.StringInput + // The name pattern that branches must match in order to deploy to the environment. If not specified, `tagPattern` must be specified. + BranchPattern pulumi.StringPtrInput // The name of the environment. Environment pulumi.StringInput // The repository of the environment. Repository pulumi.StringInput + // The name pattern that tags must match in order to deploy to the environment. If not specified, `branchPattern` must be specified. + TagPattern pulumi.StringPtrInput } func (RepositoryEnvironmentDeploymentPolicyArgs) ElementType() reflect.Type { @@ -257,9 +325,9 @@ func (o RepositoryEnvironmentDeploymentPolicyOutput) ToRepositoryEnvironmentDepl return o } -// The name pattern that branches must match in order to deploy to the environment. -func (o RepositoryEnvironmentDeploymentPolicyOutput) BranchPattern() pulumi.StringOutput { - return o.ApplyT(func(v *RepositoryEnvironmentDeploymentPolicy) pulumi.StringOutput { return v.BranchPattern }).(pulumi.StringOutput) +// The name pattern that branches must match in order to deploy to the environment. If not specified, `tagPattern` must be specified. +func (o RepositoryEnvironmentDeploymentPolicyOutput) BranchPattern() pulumi.StringPtrOutput { + return o.ApplyT(func(v *RepositoryEnvironmentDeploymentPolicy) pulumi.StringPtrOutput { return v.BranchPattern }).(pulumi.StringPtrOutput) } // The name of the environment. @@ -272,6 +340,11 @@ func (o RepositoryEnvironmentDeploymentPolicyOutput) Repository() pulumi.StringO return o.ApplyT(func(v *RepositoryEnvironmentDeploymentPolicy) pulumi.StringOutput { return v.Repository }).(pulumi.StringOutput) } +// The name pattern that tags must match in order to deploy to the environment. If not specified, `branchPattern` must be specified. +func (o RepositoryEnvironmentDeploymentPolicyOutput) TagPattern() pulumi.StringPtrOutput { + return o.ApplyT(func(v *RepositoryEnvironmentDeploymentPolicy) pulumi.StringPtrOutput { return v.TagPattern }).(pulumi.StringPtrOutput) +} + type RepositoryEnvironmentDeploymentPolicyArrayOutput struct{ *pulumi.OutputState } func (RepositoryEnvironmentDeploymentPolicyArrayOutput) ElementType() reflect.Type { diff --git a/sdk/go/github/repositoryTagProtection.go b/sdk/go/github/repositoryTagProtection.go deleted file mode 100644 index f35bb7a3..00000000 --- a/sdk/go/github/repositoryTagProtection.go +++ /dev/null @@ -1,286 +0,0 @@ -// Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT. -// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! *** - -package github - -import ( - "context" - "reflect" - - "errors" - "github.com/pulumi/pulumi-github/sdk/v6/go/github/internal" - "github.com/pulumi/pulumi/sdk/v3/go/pulumi" -) - -// This resource allows you to create and manage a repository tag protection for repositories within your GitHub organization or personal account. -// -// ## Example Usage -// -// ```go -// package main -// -// import ( -// -// "github.com/pulumi/pulumi-github/sdk/v6/go/github" -// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" -// -// ) -// -// func main() { -// pulumi.Run(func(ctx *pulumi.Context) error { -// _, err := github.NewRepositoryTagProtection(ctx, "example", &github.RepositoryTagProtectionArgs{ -// Repository: pulumi.String("example-repository"), -// Pattern: pulumi.String("v*"), -// }) -// if err != nil { -// return err -// } -// return nil -// }) -// } -// -// ``` -// -// ## Import -// -// Repository tag protections can be imported using the `name` of the repository, combined with the `id` of the tag protection, separated by a `/` character. -// The `id` of the tag protection can be found using the [GitHub API](https://docs.github.com/en/rest/repos/tags#list-tag-protection-states-for-a-repository). -// -// Importing uses the name of the repository, as well as the ID of the tag protection, e.g. -// -// ```sh -// $ pulumi import github:index/repositoryTagProtection:RepositoryTagProtection terraform my-repo/31077 -// ``` -type RepositoryTagProtection struct { - pulumi.CustomResourceState - - // The pattern of the tag to protect. - Pattern pulumi.StringOutput `pulumi:"pattern"` - // Name of the repository to add the tag protection to. - Repository pulumi.StringOutput `pulumi:"repository"` - // The ID of the tag protection. - TagProtectionId pulumi.IntOutput `pulumi:"tagProtectionId"` -} - -// NewRepositoryTagProtection registers a new resource with the given unique name, arguments, and options. -func NewRepositoryTagProtection(ctx *pulumi.Context, - name string, args *RepositoryTagProtectionArgs, opts ...pulumi.ResourceOption) (*RepositoryTagProtection, error) { - if args == nil { - return nil, errors.New("missing one or more required arguments") - } - - if args.Pattern == nil { - return nil, errors.New("invalid value for required argument 'Pattern'") - } - if args.Repository == nil { - return nil, errors.New("invalid value for required argument 'Repository'") - } - opts = internal.PkgResourceDefaultOpts(opts) - var resource RepositoryTagProtection - err := ctx.RegisterResource("github:index/repositoryTagProtection:RepositoryTagProtection", name, args, &resource, opts...) - if err != nil { - return nil, err - } - return &resource, nil -} - -// GetRepositoryTagProtection gets an existing RepositoryTagProtection resource's state with the given name, ID, and optional -// state properties that are used to uniquely qualify the lookup (nil if not required). -func GetRepositoryTagProtection(ctx *pulumi.Context, - name string, id pulumi.IDInput, state *RepositoryTagProtectionState, opts ...pulumi.ResourceOption) (*RepositoryTagProtection, error) { - var resource RepositoryTagProtection - err := ctx.ReadResource("github:index/repositoryTagProtection:RepositoryTagProtection", name, id, state, &resource, opts...) - if err != nil { - return nil, err - } - return &resource, nil -} - -// Input properties used for looking up and filtering RepositoryTagProtection resources. -type repositoryTagProtectionState struct { - // The pattern of the tag to protect. - Pattern *string `pulumi:"pattern"` - // Name of the repository to add the tag protection to. - Repository *string `pulumi:"repository"` - // The ID of the tag protection. - TagProtectionId *int `pulumi:"tagProtectionId"` -} - -type RepositoryTagProtectionState struct { - // The pattern of the tag to protect. - Pattern pulumi.StringPtrInput - // Name of the repository to add the tag protection to. - Repository pulumi.StringPtrInput - // The ID of the tag protection. - TagProtectionId pulumi.IntPtrInput -} - -func (RepositoryTagProtectionState) ElementType() reflect.Type { - return reflect.TypeOf((*repositoryTagProtectionState)(nil)).Elem() -} - -type repositoryTagProtectionArgs struct { - // The pattern of the tag to protect. - Pattern string `pulumi:"pattern"` - // Name of the repository to add the tag protection to. - Repository string `pulumi:"repository"` -} - -// The set of arguments for constructing a RepositoryTagProtection resource. -type RepositoryTagProtectionArgs struct { - // The pattern of the tag to protect. - Pattern pulumi.StringInput - // Name of the repository to add the tag protection to. - Repository pulumi.StringInput -} - -func (RepositoryTagProtectionArgs) ElementType() reflect.Type { - return reflect.TypeOf((*repositoryTagProtectionArgs)(nil)).Elem() -} - -type RepositoryTagProtectionInput interface { - pulumi.Input - - ToRepositoryTagProtectionOutput() RepositoryTagProtectionOutput - ToRepositoryTagProtectionOutputWithContext(ctx context.Context) RepositoryTagProtectionOutput -} - -func (*RepositoryTagProtection) ElementType() reflect.Type { - return reflect.TypeOf((**RepositoryTagProtection)(nil)).Elem() -} - -func (i *RepositoryTagProtection) ToRepositoryTagProtectionOutput() RepositoryTagProtectionOutput { - return i.ToRepositoryTagProtectionOutputWithContext(context.Background()) -} - -func (i *RepositoryTagProtection) ToRepositoryTagProtectionOutputWithContext(ctx context.Context) RepositoryTagProtectionOutput { - return pulumi.ToOutputWithContext(ctx, i).(RepositoryTagProtectionOutput) -} - -// RepositoryTagProtectionArrayInput is an input type that accepts RepositoryTagProtectionArray and RepositoryTagProtectionArrayOutput values. -// You can construct a concrete instance of `RepositoryTagProtectionArrayInput` via: -// -// RepositoryTagProtectionArray{ RepositoryTagProtectionArgs{...} } -type RepositoryTagProtectionArrayInput interface { - pulumi.Input - - ToRepositoryTagProtectionArrayOutput() RepositoryTagProtectionArrayOutput - ToRepositoryTagProtectionArrayOutputWithContext(context.Context) RepositoryTagProtectionArrayOutput -} - -type RepositoryTagProtectionArray []RepositoryTagProtectionInput - -func (RepositoryTagProtectionArray) ElementType() reflect.Type { - return reflect.TypeOf((*[]*RepositoryTagProtection)(nil)).Elem() -} - -func (i RepositoryTagProtectionArray) ToRepositoryTagProtectionArrayOutput() RepositoryTagProtectionArrayOutput { - return i.ToRepositoryTagProtectionArrayOutputWithContext(context.Background()) -} - -func (i RepositoryTagProtectionArray) ToRepositoryTagProtectionArrayOutputWithContext(ctx context.Context) RepositoryTagProtectionArrayOutput { - return pulumi.ToOutputWithContext(ctx, i).(RepositoryTagProtectionArrayOutput) -} - -// RepositoryTagProtectionMapInput is an input type that accepts RepositoryTagProtectionMap and RepositoryTagProtectionMapOutput values. -// You can construct a concrete instance of `RepositoryTagProtectionMapInput` via: -// -// RepositoryTagProtectionMap{ "key": RepositoryTagProtectionArgs{...} } -type RepositoryTagProtectionMapInput interface { - pulumi.Input - - ToRepositoryTagProtectionMapOutput() RepositoryTagProtectionMapOutput - ToRepositoryTagProtectionMapOutputWithContext(context.Context) RepositoryTagProtectionMapOutput -} - -type RepositoryTagProtectionMap map[string]RepositoryTagProtectionInput - -func (RepositoryTagProtectionMap) ElementType() reflect.Type { - return reflect.TypeOf((*map[string]*RepositoryTagProtection)(nil)).Elem() -} - -func (i RepositoryTagProtectionMap) ToRepositoryTagProtectionMapOutput() RepositoryTagProtectionMapOutput { - return i.ToRepositoryTagProtectionMapOutputWithContext(context.Background()) -} - -func (i RepositoryTagProtectionMap) ToRepositoryTagProtectionMapOutputWithContext(ctx context.Context) RepositoryTagProtectionMapOutput { - return pulumi.ToOutputWithContext(ctx, i).(RepositoryTagProtectionMapOutput) -} - -type RepositoryTagProtectionOutput struct{ *pulumi.OutputState } - -func (RepositoryTagProtectionOutput) ElementType() reflect.Type { - return reflect.TypeOf((**RepositoryTagProtection)(nil)).Elem() -} - -func (o RepositoryTagProtectionOutput) ToRepositoryTagProtectionOutput() RepositoryTagProtectionOutput { - return o -} - -func (o RepositoryTagProtectionOutput) ToRepositoryTagProtectionOutputWithContext(ctx context.Context) RepositoryTagProtectionOutput { - return o -} - -// The pattern of the tag to protect. -func (o RepositoryTagProtectionOutput) Pattern() pulumi.StringOutput { - return o.ApplyT(func(v *RepositoryTagProtection) pulumi.StringOutput { return v.Pattern }).(pulumi.StringOutput) -} - -// Name of the repository to add the tag protection to. -func (o RepositoryTagProtectionOutput) Repository() pulumi.StringOutput { - return o.ApplyT(func(v *RepositoryTagProtection) pulumi.StringOutput { return v.Repository }).(pulumi.StringOutput) -} - -// The ID of the tag protection. -func (o RepositoryTagProtectionOutput) TagProtectionId() pulumi.IntOutput { - return o.ApplyT(func(v *RepositoryTagProtection) pulumi.IntOutput { return v.TagProtectionId }).(pulumi.IntOutput) -} - -type RepositoryTagProtectionArrayOutput struct{ *pulumi.OutputState } - -func (RepositoryTagProtectionArrayOutput) ElementType() reflect.Type { - return reflect.TypeOf((*[]*RepositoryTagProtection)(nil)).Elem() -} - -func (o RepositoryTagProtectionArrayOutput) ToRepositoryTagProtectionArrayOutput() RepositoryTagProtectionArrayOutput { - return o -} - -func (o RepositoryTagProtectionArrayOutput) ToRepositoryTagProtectionArrayOutputWithContext(ctx context.Context) RepositoryTagProtectionArrayOutput { - return o -} - -func (o RepositoryTagProtectionArrayOutput) Index(i pulumi.IntInput) RepositoryTagProtectionOutput { - return pulumi.All(o, i).ApplyT(func(vs []interface{}) *RepositoryTagProtection { - return vs[0].([]*RepositoryTagProtection)[vs[1].(int)] - }).(RepositoryTagProtectionOutput) -} - -type RepositoryTagProtectionMapOutput struct{ *pulumi.OutputState } - -func (RepositoryTagProtectionMapOutput) ElementType() reflect.Type { - return reflect.TypeOf((*map[string]*RepositoryTagProtection)(nil)).Elem() -} - -func (o RepositoryTagProtectionMapOutput) ToRepositoryTagProtectionMapOutput() RepositoryTagProtectionMapOutput { - return o -} - -func (o RepositoryTagProtectionMapOutput) ToRepositoryTagProtectionMapOutputWithContext(ctx context.Context) RepositoryTagProtectionMapOutput { - return o -} - -func (o RepositoryTagProtectionMapOutput) MapIndex(k pulumi.StringInput) RepositoryTagProtectionOutput { - return pulumi.All(o, k).ApplyT(func(vs []interface{}) *RepositoryTagProtection { - return vs[0].(map[string]*RepositoryTagProtection)[vs[1].(string)] - }).(RepositoryTagProtectionOutput) -} - -func init() { - pulumi.RegisterInputType(reflect.TypeOf((*RepositoryTagProtectionInput)(nil)).Elem(), &RepositoryTagProtection{}) - pulumi.RegisterInputType(reflect.TypeOf((*RepositoryTagProtectionArrayInput)(nil)).Elem(), RepositoryTagProtectionArray{}) - pulumi.RegisterInputType(reflect.TypeOf((*RepositoryTagProtectionMapInput)(nil)).Elem(), RepositoryTagProtectionMap{}) - pulumi.RegisterOutputType(RepositoryTagProtectionOutput{}) - pulumi.RegisterOutputType(RepositoryTagProtectionArrayOutput{}) - pulumi.RegisterOutputType(RepositoryTagProtectionMapOutput{}) -} diff --git a/sdk/go/github/teamMembership.go b/sdk/go/github/teamMembership.go index c84c733f..a606a616 100644 --- a/sdk/go/github/teamMembership.go +++ b/sdk/go/github/teamMembership.go @@ -21,7 +21,7 @@ import ( // // > **Note** This resource is not compatible with `TeamMembers`. Use either `TeamMembers` or `TeamMembership`. // -// > **Note** Organization owners may not be set as "members" of a team; they may only be set as "maintainers". Attempting to set organization an owner to "member" of a may result in a `pulumi preview` diff that changes their status back to "maintainer". +// > **Note** Organization owners may not be set as "members" of a team; they may only be set as "maintainers". Attempting to set an organization owner as a "member" of a team may result in a `pulumi preview` diff that changes their status back to "maintainer". // // ## Example Usage // diff --git a/sdk/java/src/main/java/com/pulumi/github/RepositoryEnvironmentDeploymentPolicy.java b/sdk/java/src/main/java/com/pulumi/github/RepositoryEnvironmentDeploymentPolicy.java index ebce5151..0df2fe92 100644 --- a/sdk/java/src/main/java/com/pulumi/github/RepositoryEnvironmentDeploymentPolicy.java +++ b/sdk/java/src/main/java/com/pulumi/github/RepositoryEnvironmentDeploymentPolicy.java @@ -11,6 +11,7 @@ import com.pulumi.github.Utilities; import com.pulumi.github.inputs.RepositoryEnvironmentDeploymentPolicyState; import java.lang.String; +import java.util.Optional; import javax.annotation.Nullable; /** @@ -18,6 +19,8 @@ * * ## Example Usage * + * Create a branch-based deployment policy: + * * <!--Start PulumiCodeChooser --> *
  * {@code
@@ -82,6 +85,72 @@
  * 
* <!--End PulumiCodeChooser --> * + * Create a tag-based deployment policy: + * + * <!--Start PulumiCodeChooser --> + *
+ * {@code
+ * package generated_program;
+ * 
+ * import com.pulumi.Context;
+ * import com.pulumi.Pulumi;
+ * import com.pulumi.core.Output;
+ * import com.pulumi.github.GithubFunctions;
+ * import com.pulumi.github.inputs.GetUserArgs;
+ * import com.pulumi.github.Repository;
+ * import com.pulumi.github.RepositoryArgs;
+ * import com.pulumi.github.RepositoryEnvironment;
+ * import com.pulumi.github.RepositoryEnvironmentArgs;
+ * import com.pulumi.github.inputs.RepositoryEnvironmentReviewerArgs;
+ * import com.pulumi.github.inputs.RepositoryEnvironmentDeploymentBranchPolicyArgs;
+ * import com.pulumi.github.RepositoryEnvironmentDeploymentPolicy;
+ * import com.pulumi.github.RepositoryEnvironmentDeploymentPolicyArgs;
+ * import java.util.List;
+ * import java.util.ArrayList;
+ * import java.util.Map;
+ * import java.io.File;
+ * import java.nio.file.Files;
+ * import java.nio.file.Paths;
+ * 
+ * public class App {
+ *     public static void main(String[] args) {
+ *         Pulumi.run(App::stack);
+ *     }
+ * 
+ *     public static void stack(Context ctx) {
+ *         final var current = GithubFunctions.getUser(GetUserArgs.builder()
+ *             .username("")
+ *             .build());
+ * 
+ *         var test = new Repository("test", RepositoryArgs.builder()
+ *             .name("tf-acc-test-%s")
+ *             .build());
+ * 
+ *         var testRepositoryEnvironment = new RepositoryEnvironment("testRepositoryEnvironment", RepositoryEnvironmentArgs.builder()
+ *             .repository(test.name())
+ *             .environment("environment/test")
+ *             .waitTimer(10000)
+ *             .reviewers(RepositoryEnvironmentReviewerArgs.builder()
+ *                 .users(current.applyValue(getUserResult -> getUserResult.id()))
+ *                 .build())
+ *             .deploymentBranchPolicy(RepositoryEnvironmentDeploymentBranchPolicyArgs.builder()
+ *                 .protectedBranches(false)
+ *                 .customBranchPolicies(true)
+ *                 .build())
+ *             .build());
+ * 
+ *         var testRepositoryEnvironmentDeploymentPolicy = new RepositoryEnvironmentDeploymentPolicy("testRepositoryEnvironmentDeploymentPolicy", RepositoryEnvironmentDeploymentPolicyArgs.builder()
+ *             .repository(test.name())
+ *             .environment(testRepositoryEnvironment.environment())
+ *             .tagPattern("v*")
+ *             .build());
+ * 
+ *     }
+ * }
+ * }
+ * 
+ * <!--End PulumiCodeChooser --> + * * ## Import * * GitHub Repository Environment Deployment Policy can be imported using an ID made up of `name` of the repository combined with the `environment` name of the environment with the `Id` of the deployment policy, separated by a `:` character, e.g. @@ -94,18 +163,18 @@ @ResourceType(type="github:index/repositoryEnvironmentDeploymentPolicy:RepositoryEnvironmentDeploymentPolicy") public class RepositoryEnvironmentDeploymentPolicy extends com.pulumi.resources.CustomResource { /** - * The name pattern that branches must match in order to deploy to the environment. + * The name pattern that branches must match in order to deploy to the environment. If not specified, `tag_pattern` must be specified. * */ @Export(name="branchPattern", refs={String.class}, tree="[0]") - private Output branchPattern; + private Output branchPattern; /** - * @return The name pattern that branches must match in order to deploy to the environment. + * @return The name pattern that branches must match in order to deploy to the environment. If not specified, `tag_pattern` must be specified. * */ - public Output branchPattern() { - return this.branchPattern; + public Output> branchPattern() { + return Codegen.optional(this.branchPattern); } /** * The name of the environment. @@ -135,6 +204,20 @@ public Output environment() { public Output repository() { return this.repository; } + /** + * The name pattern that tags must match in order to deploy to the environment. If not specified, `branch_pattern` must be specified. + * + */ + @Export(name="tagPattern", refs={String.class}, tree="[0]") + private Output tagPattern; + + /** + * @return The name pattern that tags must match in order to deploy to the environment. If not specified, `branch_pattern` must be specified. + * + */ + public Output> tagPattern() { + return Codegen.optional(this.tagPattern); + } /** * diff --git a/sdk/java/src/main/java/com/pulumi/github/RepositoryEnvironmentDeploymentPolicyArgs.java b/sdk/java/src/main/java/com/pulumi/github/RepositoryEnvironmentDeploymentPolicyArgs.java index f89798a0..03ab6b8d 100644 --- a/sdk/java/src/main/java/com/pulumi/github/RepositoryEnvironmentDeploymentPolicyArgs.java +++ b/sdk/java/src/main/java/com/pulumi/github/RepositoryEnvironmentDeploymentPolicyArgs.java @@ -8,6 +8,8 @@ import com.pulumi.exceptions.MissingRequiredPropertyException; import java.lang.String; import java.util.Objects; +import java.util.Optional; +import javax.annotation.Nullable; public final class RepositoryEnvironmentDeploymentPolicyArgs extends com.pulumi.resources.ResourceArgs { @@ -15,18 +17,18 @@ public final class RepositoryEnvironmentDeploymentPolicyArgs extends com.pulumi. public static final RepositoryEnvironmentDeploymentPolicyArgs Empty = new RepositoryEnvironmentDeploymentPolicyArgs(); /** - * The name pattern that branches must match in order to deploy to the environment. + * The name pattern that branches must match in order to deploy to the environment. If not specified, `tag_pattern` must be specified. * */ - @Import(name="branchPattern", required=true) - private Output branchPattern; + @Import(name="branchPattern") + private @Nullable Output branchPattern; /** - * @return The name pattern that branches must match in order to deploy to the environment. + * @return The name pattern that branches must match in order to deploy to the environment. If not specified, `tag_pattern` must be specified. * */ - public Output branchPattern() { - return this.branchPattern; + public Optional> branchPattern() { + return Optional.ofNullable(this.branchPattern); } /** @@ -59,12 +61,28 @@ public Output repository() { return this.repository; } + /** + * The name pattern that tags must match in order to deploy to the environment. If not specified, `branch_pattern` must be specified. + * + */ + @Import(name="tagPattern") + private @Nullable Output tagPattern; + + /** + * @return The name pattern that tags must match in order to deploy to the environment. If not specified, `branch_pattern` must be specified. + * + */ + public Optional> tagPattern() { + return Optional.ofNullable(this.tagPattern); + } + private RepositoryEnvironmentDeploymentPolicyArgs() {} private RepositoryEnvironmentDeploymentPolicyArgs(RepositoryEnvironmentDeploymentPolicyArgs $) { this.branchPattern = $.branchPattern; this.environment = $.environment; this.repository = $.repository; + this.tagPattern = $.tagPattern; } public static Builder builder() { @@ -86,18 +104,18 @@ public Builder(RepositoryEnvironmentDeploymentPolicyArgs defaults) { } /** - * @param branchPattern The name pattern that branches must match in order to deploy to the environment. + * @param branchPattern The name pattern that branches must match in order to deploy to the environment. If not specified, `tag_pattern` must be specified. * * @return builder * */ - public Builder branchPattern(Output branchPattern) { + public Builder branchPattern(@Nullable Output branchPattern) { $.branchPattern = branchPattern; return this; } /** - * @param branchPattern The name pattern that branches must match in order to deploy to the environment. + * @param branchPattern The name pattern that branches must match in order to deploy to the environment. If not specified, `tag_pattern` must be specified. * * @return builder * @@ -148,10 +166,28 @@ public Builder repository(String repository) { return repository(Output.of(repository)); } + /** + * @param tagPattern The name pattern that tags must match in order to deploy to the environment. If not specified, `branch_pattern` must be specified. + * + * @return builder + * + */ + public Builder tagPattern(@Nullable Output tagPattern) { + $.tagPattern = tagPattern; + return this; + } + + /** + * @param tagPattern The name pattern that tags must match in order to deploy to the environment. If not specified, `branch_pattern` must be specified. + * + * @return builder + * + */ + public Builder tagPattern(String tagPattern) { + return tagPattern(Output.of(tagPattern)); + } + public RepositoryEnvironmentDeploymentPolicyArgs build() { - if ($.branchPattern == null) { - throw new MissingRequiredPropertyException("RepositoryEnvironmentDeploymentPolicyArgs", "branchPattern"); - } if ($.environment == null) { throw new MissingRequiredPropertyException("RepositoryEnvironmentDeploymentPolicyArgs", "environment"); } diff --git a/sdk/java/src/main/java/com/pulumi/github/RepositoryTagProtection.java b/sdk/java/src/main/java/com/pulumi/github/RepositoryTagProtection.java deleted file mode 100644 index ab188159..00000000 --- a/sdk/java/src/main/java/com/pulumi/github/RepositoryTagProtection.java +++ /dev/null @@ -1,168 +0,0 @@ -// *** WARNING: this file was generated by pulumi-java-gen. *** -// *** Do not edit by hand unless you're certain you know what you are doing! *** - -package com.pulumi.github; - -import com.pulumi.core.Output; -import com.pulumi.core.annotations.Export; -import com.pulumi.core.annotations.ResourceType; -import com.pulumi.core.internal.Codegen; -import com.pulumi.github.RepositoryTagProtectionArgs; -import com.pulumi.github.Utilities; -import com.pulumi.github.inputs.RepositoryTagProtectionState; -import java.lang.Integer; -import java.lang.String; -import javax.annotation.Nullable; - -/** - * This resource allows you to create and manage a repository tag protection for repositories within your GitHub organization or personal account. - * - * ## Example Usage - * - * <!--Start PulumiCodeChooser --> - *
- * {@code
- * package generated_program;
- * 
- * import com.pulumi.Context;
- * import com.pulumi.Pulumi;
- * import com.pulumi.core.Output;
- * import com.pulumi.github.RepositoryTagProtection;
- * import com.pulumi.github.RepositoryTagProtectionArgs;
- * import java.util.List;
- * import java.util.ArrayList;
- * import java.util.Map;
- * import java.io.File;
- * import java.nio.file.Files;
- * import java.nio.file.Paths;
- * 
- * public class App {
- *     public static void main(String[] args) {
- *         Pulumi.run(App::stack);
- *     }
- * 
- *     public static void stack(Context ctx) {
- *         var example = new RepositoryTagProtection("example", RepositoryTagProtectionArgs.builder()
- *             .repository("example-repository")
- *             .pattern("v*")
- *             .build());
- * 
- *     }
- * }
- * }
- * 
- * <!--End PulumiCodeChooser --> - * - * ## Import - * - * Repository tag protections can be imported using the `name` of the repository, combined with the `id` of the tag protection, separated by a `/` character. - * The `id` of the tag protection can be found using the [GitHub API](https://docs.github.com/en/rest/repos/tags#list-tag-protection-states-for-a-repository). - * - * Importing uses the name of the repository, as well as the ID of the tag protection, e.g. - * - * ```sh - * $ pulumi import github:index/repositoryTagProtection:RepositoryTagProtection terraform my-repo/31077 - * ``` - * - */ -@ResourceType(type="github:index/repositoryTagProtection:RepositoryTagProtection") -public class RepositoryTagProtection extends com.pulumi.resources.CustomResource { - /** - * The pattern of the tag to protect. - * - */ - @Export(name="pattern", refs={String.class}, tree="[0]") - private Output pattern; - - /** - * @return The pattern of the tag to protect. - * - */ - public Output pattern() { - return this.pattern; - } - /** - * Name of the repository to add the tag protection to. - * - */ - @Export(name="repository", refs={String.class}, tree="[0]") - private Output repository; - - /** - * @return Name of the repository to add the tag protection to. - * - */ - public Output repository() { - return this.repository; - } - /** - * The ID of the tag protection. - * - */ - @Export(name="tagProtectionId", refs={Integer.class}, tree="[0]") - private Output tagProtectionId; - - /** - * @return The ID of the tag protection. - * - */ - public Output tagProtectionId() { - return this.tagProtectionId; - } - - /** - * - * @param name The _unique_ name of the resulting resource. - */ - public RepositoryTagProtection(java.lang.String name) { - this(name, RepositoryTagProtectionArgs.Empty); - } - /** - * - * @param name The _unique_ name of the resulting resource. - * @param args The arguments to use to populate this resource's properties. - */ - public RepositoryTagProtection(java.lang.String name, RepositoryTagProtectionArgs args) { - this(name, args, null); - } - /** - * - * @param name The _unique_ name of the resulting resource. - * @param args The arguments to use to populate this resource's properties. - * @param options A bag of options that control this resource's behavior. - */ - public RepositoryTagProtection(java.lang.String name, RepositoryTagProtectionArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) { - super("github:index/repositoryTagProtection:RepositoryTagProtection", name, makeArgs(args, options), makeResourceOptions(options, Codegen.empty()), false); - } - - private RepositoryTagProtection(java.lang.String name, Output id, @Nullable RepositoryTagProtectionState state, @Nullable com.pulumi.resources.CustomResourceOptions options) { - super("github:index/repositoryTagProtection:RepositoryTagProtection", name, state, makeResourceOptions(options, id), false); - } - - private static RepositoryTagProtectionArgs makeArgs(RepositoryTagProtectionArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) { - if (options != null && options.getUrn().isPresent()) { - return null; - } - return args == null ? RepositoryTagProtectionArgs.Empty : args; - } - - private static com.pulumi.resources.CustomResourceOptions makeResourceOptions(@Nullable com.pulumi.resources.CustomResourceOptions options, @Nullable Output id) { - var defaultOptions = com.pulumi.resources.CustomResourceOptions.builder() - .version(Utilities.getVersion()) - .build(); - return com.pulumi.resources.CustomResourceOptions.merge(defaultOptions, options, id); - } - - /** - * Get an existing Host resource's state with the given name, ID, and optional extra - * properties used to qualify the lookup. - * - * @param name The _unique_ name of the resulting resource. - * @param id The _unique_ provider ID of the resource to lookup. - * @param state - * @param options Optional settings to control the behavior of the CustomResource. - */ - public static RepositoryTagProtection get(java.lang.String name, Output id, @Nullable RepositoryTagProtectionState state, @Nullable com.pulumi.resources.CustomResourceOptions options) { - return new RepositoryTagProtection(name, id, state, options); - } -} diff --git a/sdk/java/src/main/java/com/pulumi/github/RepositoryTagProtectionArgs.java b/sdk/java/src/main/java/com/pulumi/github/RepositoryTagProtectionArgs.java deleted file mode 100644 index 3ad02870..00000000 --- a/sdk/java/src/main/java/com/pulumi/github/RepositoryTagProtectionArgs.java +++ /dev/null @@ -1,125 +0,0 @@ -// *** WARNING: this file was generated by pulumi-java-gen. *** -// *** Do not edit by hand unless you're certain you know what you are doing! *** - -package com.pulumi.github; - -import com.pulumi.core.Output; -import com.pulumi.core.annotations.Import; -import com.pulumi.exceptions.MissingRequiredPropertyException; -import java.lang.String; -import java.util.Objects; - - -public final class RepositoryTagProtectionArgs extends com.pulumi.resources.ResourceArgs { - - public static final RepositoryTagProtectionArgs Empty = new RepositoryTagProtectionArgs(); - - /** - * The pattern of the tag to protect. - * - */ - @Import(name="pattern", required=true) - private Output pattern; - - /** - * @return The pattern of the tag to protect. - * - */ - public Output pattern() { - return this.pattern; - } - - /** - * Name of the repository to add the tag protection to. - * - */ - @Import(name="repository", required=true) - private Output repository; - - /** - * @return Name of the repository to add the tag protection to. - * - */ - public Output repository() { - return this.repository; - } - - private RepositoryTagProtectionArgs() {} - - private RepositoryTagProtectionArgs(RepositoryTagProtectionArgs $) { - this.pattern = $.pattern; - this.repository = $.repository; - } - - public static Builder builder() { - return new Builder(); - } - public static Builder builder(RepositoryTagProtectionArgs defaults) { - return new Builder(defaults); - } - - public static final class Builder { - private RepositoryTagProtectionArgs $; - - public Builder() { - $ = new RepositoryTagProtectionArgs(); - } - - public Builder(RepositoryTagProtectionArgs defaults) { - $ = new RepositoryTagProtectionArgs(Objects.requireNonNull(defaults)); - } - - /** - * @param pattern The pattern of the tag to protect. - * - * @return builder - * - */ - public Builder pattern(Output pattern) { - $.pattern = pattern; - return this; - } - - /** - * @param pattern The pattern of the tag to protect. - * - * @return builder - * - */ - public Builder pattern(String pattern) { - return pattern(Output.of(pattern)); - } - - /** - * @param repository Name of the repository to add the tag protection to. - * - * @return builder - * - */ - public Builder repository(Output repository) { - $.repository = repository; - return this; - } - - /** - * @param repository Name of the repository to add the tag protection to. - * - * @return builder - * - */ - public Builder repository(String repository) { - return repository(Output.of(repository)); - } - - public RepositoryTagProtectionArgs build() { - if ($.pattern == null) { - throw new MissingRequiredPropertyException("RepositoryTagProtectionArgs", "pattern"); - } - if ($.repository == null) { - throw new MissingRequiredPropertyException("RepositoryTagProtectionArgs", "repository"); - } - return $; - } - } - -} diff --git a/sdk/java/src/main/java/com/pulumi/github/TeamMembership.java b/sdk/java/src/main/java/com/pulumi/github/TeamMembership.java index c058d605..fa425cb5 100644 --- a/sdk/java/src/main/java/com/pulumi/github/TeamMembership.java +++ b/sdk/java/src/main/java/com/pulumi/github/TeamMembership.java @@ -24,7 +24,7 @@ * * > **Note** This resource is not compatible with `github.TeamMembers`. Use either `github.TeamMembers` or `github.TeamMembership`. * - * > **Note** Organization owners may not be set as "members" of a team; they may only be set as "maintainers". Attempting to set organization an owner to "member" of a may result in a `pulumi preview` diff that changes their status back to "maintainer". + * > **Note** Organization owners may not be set as "members" of a team; they may only be set as "maintainers". Attempting to set an organization owner as a "member" of a team may result in a `pulumi preview` diff that changes their status back to "maintainer". * * ## Example Usage * diff --git a/sdk/java/src/main/java/com/pulumi/github/inputs/OrganizationRulesetRulesArgs.java b/sdk/java/src/main/java/com/pulumi/github/inputs/OrganizationRulesetRulesArgs.java index 6796bac4..f829c557 100644 --- a/sdk/java/src/main/java/com/pulumi/github/inputs/OrganizationRulesetRulesArgs.java +++ b/sdk/java/src/main/java/com/pulumi/github/inputs/OrganizationRulesetRulesArgs.java @@ -10,6 +10,7 @@ import com.pulumi.github.inputs.OrganizationRulesetRulesCommitMessagePatternArgs; import com.pulumi.github.inputs.OrganizationRulesetRulesCommitterEmailPatternArgs; import com.pulumi.github.inputs.OrganizationRulesetRulesPullRequestArgs; +import com.pulumi.github.inputs.OrganizationRulesetRulesRequiredCodeScanningArgs; import com.pulumi.github.inputs.OrganizationRulesetRulesRequiredStatusChecksArgs; import com.pulumi.github.inputs.OrganizationRulesetRulesRequiredWorkflowsArgs; import com.pulumi.github.inputs.OrganizationRulesetRulesTagNamePatternArgs; @@ -143,6 +144,21 @@ public Optional> pullRequest() { return Optional.ofNullable(this.pullRequest); } + /** + * (Block List, Max: 1) Define which tools must provide code scanning results before the reference is updated. When configured, code scanning must be enabled and have results for both the commit and the reference being updated. Multiple code scanning tools can be specified. (see below for nested schema) + * + */ + @Import(name="requiredCodeScanning") + private @Nullable Output requiredCodeScanning; + + /** + * @return (Block List, Max: 1) Define which tools must provide code scanning results before the reference is updated. When configured, code scanning must be enabled and have results for both the commit and the reference being updated. Multiple code scanning tools can be specified. (see below for nested schema) + * + */ + public Optional> requiredCodeScanning() { + return Optional.ofNullable(this.requiredCodeScanning); + } + /** * (Boolean) Prevent merge commits from being pushed to matching branches. * @@ -244,6 +260,7 @@ private OrganizationRulesetRulesArgs(OrganizationRulesetRulesArgs $) { this.deletion = $.deletion; this.nonFastForward = $.nonFastForward; this.pullRequest = $.pullRequest; + this.requiredCodeScanning = $.requiredCodeScanning; this.requiredLinearHistory = $.requiredLinearHistory; this.requiredSignatures = $.requiredSignatures; this.requiredStatusChecks = $.requiredStatusChecks; @@ -438,6 +455,27 @@ public Builder pullRequest(OrganizationRulesetRulesPullRequestArgs pullRequest) return pullRequest(Output.of(pullRequest)); } + /** + * @param requiredCodeScanning (Block List, Max: 1) Define which tools must provide code scanning results before the reference is updated. When configured, code scanning must be enabled and have results for both the commit and the reference being updated. Multiple code scanning tools can be specified. (see below for nested schema) + * + * @return builder + * + */ + public Builder requiredCodeScanning(@Nullable Output requiredCodeScanning) { + $.requiredCodeScanning = requiredCodeScanning; + return this; + } + + /** + * @param requiredCodeScanning (Block List, Max: 1) Define which tools must provide code scanning results before the reference is updated. When configured, code scanning must be enabled and have results for both the commit and the reference being updated. Multiple code scanning tools can be specified. (see below for nested schema) + * + * @return builder + * + */ + public Builder requiredCodeScanning(OrganizationRulesetRulesRequiredCodeScanningArgs requiredCodeScanning) { + return requiredCodeScanning(Output.of(requiredCodeScanning)); + } + /** * @param requiredLinearHistory (Boolean) Prevent merge commits from being pushed to matching branches. * diff --git a/sdk/java/src/main/java/com/pulumi/github/inputs/OrganizationRulesetRulesRequiredCodeScanningArgs.java b/sdk/java/src/main/java/com/pulumi/github/inputs/OrganizationRulesetRulesRequiredCodeScanningArgs.java new file mode 100644 index 00000000..6651e724 --- /dev/null +++ b/sdk/java/src/main/java/com/pulumi/github/inputs/OrganizationRulesetRulesRequiredCodeScanningArgs.java @@ -0,0 +1,96 @@ +// *** WARNING: this file was generated by pulumi-java-gen. *** +// *** Do not edit by hand unless you're certain you know what you are doing! *** + +package com.pulumi.github.inputs; + +import com.pulumi.core.Output; +import com.pulumi.core.annotations.Import; +import com.pulumi.exceptions.MissingRequiredPropertyException; +import com.pulumi.github.inputs.OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArgs; +import java.util.List; +import java.util.Objects; + + +public final class OrganizationRulesetRulesRequiredCodeScanningArgs extends com.pulumi.resources.ResourceArgs { + + public static final OrganizationRulesetRulesRequiredCodeScanningArgs Empty = new OrganizationRulesetRulesRequiredCodeScanningArgs(); + + /** + * Tools that must provide code scanning results for this rule to pass. + * + */ + @Import(name="requiredCodeScanningTools", required=true) + private Output> requiredCodeScanningTools; + + /** + * @return Tools that must provide code scanning results for this rule to pass. + * + */ + public Output> requiredCodeScanningTools() { + return this.requiredCodeScanningTools; + } + + private OrganizationRulesetRulesRequiredCodeScanningArgs() {} + + private OrganizationRulesetRulesRequiredCodeScanningArgs(OrganizationRulesetRulesRequiredCodeScanningArgs $) { + this.requiredCodeScanningTools = $.requiredCodeScanningTools; + } + + public static Builder builder() { + return new Builder(); + } + public static Builder builder(OrganizationRulesetRulesRequiredCodeScanningArgs defaults) { + return new Builder(defaults); + } + + public static final class Builder { + private OrganizationRulesetRulesRequiredCodeScanningArgs $; + + public Builder() { + $ = new OrganizationRulesetRulesRequiredCodeScanningArgs(); + } + + public Builder(OrganizationRulesetRulesRequiredCodeScanningArgs defaults) { + $ = new OrganizationRulesetRulesRequiredCodeScanningArgs(Objects.requireNonNull(defaults)); + } + + /** + * @param requiredCodeScanningTools Tools that must provide code scanning results for this rule to pass. + * + * @return builder + * + */ + public Builder requiredCodeScanningTools(Output> requiredCodeScanningTools) { + $.requiredCodeScanningTools = requiredCodeScanningTools; + return this; + } + + /** + * @param requiredCodeScanningTools Tools that must provide code scanning results for this rule to pass. + * + * @return builder + * + */ + public Builder requiredCodeScanningTools(List requiredCodeScanningTools) { + return requiredCodeScanningTools(Output.of(requiredCodeScanningTools)); + } + + /** + * @param requiredCodeScanningTools Tools that must provide code scanning results for this rule to pass. + * + * @return builder + * + */ + public Builder requiredCodeScanningTools(OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArgs... requiredCodeScanningTools) { + return requiredCodeScanningTools(List.of(requiredCodeScanningTools)); + } + + public OrganizationRulesetRulesRequiredCodeScanningArgs build() { + if ($.requiredCodeScanningTools == null) { + throw new MissingRequiredPropertyException("OrganizationRulesetRulesRequiredCodeScanningArgs", "requiredCodeScanningTools"); + } + return $; + } + } + +} diff --git a/sdk/java/src/main/java/com/pulumi/github/inputs/OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArgs.java b/sdk/java/src/main/java/com/pulumi/github/inputs/OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArgs.java new file mode 100644 index 00000000..c5ba5b62 --- /dev/null +++ b/sdk/java/src/main/java/com/pulumi/github/inputs/OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArgs.java @@ -0,0 +1,165 @@ +// *** WARNING: this file was generated by pulumi-java-gen. *** +// *** Do not edit by hand unless you're certain you know what you are doing! *** + +package com.pulumi.github.inputs; + +import com.pulumi.core.Output; +import com.pulumi.core.annotations.Import; +import com.pulumi.exceptions.MissingRequiredPropertyException; +import java.lang.String; +import java.util.Objects; + + +public final class OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArgs extends com.pulumi.resources.ResourceArgs { + + public static final OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArgs Empty = new OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArgs(); + + /** + * The severity level at which code scanning results that raise alerts block a reference update. Can be one of: `none`, `errors`, `errors_and_warnings`, `all`. + * + */ + @Import(name="alertsThreshold", required=true) + private Output alertsThreshold; + + /** + * @return The severity level at which code scanning results that raise alerts block a reference update. Can be one of: `none`, `errors`, `errors_and_warnings`, `all`. + * + */ + public Output alertsThreshold() { + return this.alertsThreshold; + } + + /** + * The severity level at which code scanning results that raise security alerts block a reference update. Can be one of: `none`, `critical`, `high_or_higher`, `medium_or_higher`, `all`. + * + */ + @Import(name="securityAlertsThreshold", required=true) + private Output securityAlertsThreshold; + + /** + * @return The severity level at which code scanning results that raise security alerts block a reference update. Can be one of: `none`, `critical`, `high_or_higher`, `medium_or_higher`, `all`. + * + */ + public Output securityAlertsThreshold() { + return this.securityAlertsThreshold; + } + + /** + * The name of a code scanning tool. + * + */ + @Import(name="tool", required=true) + private Output tool; + + /** + * @return The name of a code scanning tool. + * + */ + public Output tool() { + return this.tool; + } + + private OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArgs() {} + + private OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArgs(OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArgs $) { + this.alertsThreshold = $.alertsThreshold; + this.securityAlertsThreshold = $.securityAlertsThreshold; + this.tool = $.tool; + } + + public static Builder builder() { + return new Builder(); + } + public static Builder builder(OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArgs defaults) { + return new Builder(defaults); + } + + public static final class Builder { + private OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArgs $; + + public Builder() { + $ = new OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArgs(); + } + + public Builder(OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArgs defaults) { + $ = new OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArgs(Objects.requireNonNull(defaults)); + } + + /** + * @param alertsThreshold The severity level at which code scanning results that raise alerts block a reference update. Can be one of: `none`, `errors`, `errors_and_warnings`, `all`. + * + * @return builder + * + */ + public Builder alertsThreshold(Output alertsThreshold) { + $.alertsThreshold = alertsThreshold; + return this; + } + + /** + * @param alertsThreshold The severity level at which code scanning results that raise alerts block a reference update. Can be one of: `none`, `errors`, `errors_and_warnings`, `all`. + * + * @return builder + * + */ + public Builder alertsThreshold(String alertsThreshold) { + return alertsThreshold(Output.of(alertsThreshold)); + } + + /** + * @param securityAlertsThreshold The severity level at which code scanning results that raise security alerts block a reference update. Can be one of: `none`, `critical`, `high_or_higher`, `medium_or_higher`, `all`. + * + * @return builder + * + */ + public Builder securityAlertsThreshold(Output securityAlertsThreshold) { + $.securityAlertsThreshold = securityAlertsThreshold; + return this; + } + + /** + * @param securityAlertsThreshold The severity level at which code scanning results that raise security alerts block a reference update. Can be one of: `none`, `critical`, `high_or_higher`, `medium_or_higher`, `all`. + * + * @return builder + * + */ + public Builder securityAlertsThreshold(String securityAlertsThreshold) { + return securityAlertsThreshold(Output.of(securityAlertsThreshold)); + } + + /** + * @param tool The name of a code scanning tool. + * + * @return builder + * + */ + public Builder tool(Output tool) { + $.tool = tool; + return this; + } + + /** + * @param tool The name of a code scanning tool. + * + * @return builder + * + */ + public Builder tool(String tool) { + return tool(Output.of(tool)); + } + + public OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArgs build() { + if ($.alertsThreshold == null) { + throw new MissingRequiredPropertyException("OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArgs", "alertsThreshold"); + } + if ($.securityAlertsThreshold == null) { + throw new MissingRequiredPropertyException("OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArgs", "securityAlertsThreshold"); + } + if ($.tool == null) { + throw new MissingRequiredPropertyException("OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArgs", "tool"); + } + return $; + } + } + +} diff --git a/sdk/java/src/main/java/com/pulumi/github/inputs/RepositoryEnvironmentDeploymentPolicyState.java b/sdk/java/src/main/java/com/pulumi/github/inputs/RepositoryEnvironmentDeploymentPolicyState.java index cb21755f..480ba485 100644 --- a/sdk/java/src/main/java/com/pulumi/github/inputs/RepositoryEnvironmentDeploymentPolicyState.java +++ b/sdk/java/src/main/java/com/pulumi/github/inputs/RepositoryEnvironmentDeploymentPolicyState.java @@ -16,14 +16,14 @@ public final class RepositoryEnvironmentDeploymentPolicyState extends com.pulumi public static final RepositoryEnvironmentDeploymentPolicyState Empty = new RepositoryEnvironmentDeploymentPolicyState(); /** - * The name pattern that branches must match in order to deploy to the environment. + * The name pattern that branches must match in order to deploy to the environment. If not specified, `tag_pattern` must be specified. * */ @Import(name="branchPattern") private @Nullable Output branchPattern; /** - * @return The name pattern that branches must match in order to deploy to the environment. + * @return The name pattern that branches must match in order to deploy to the environment. If not specified, `tag_pattern` must be specified. * */ public Optional> branchPattern() { @@ -60,12 +60,28 @@ public Optional> repository() { return Optional.ofNullable(this.repository); } + /** + * The name pattern that tags must match in order to deploy to the environment. If not specified, `branch_pattern` must be specified. + * + */ + @Import(name="tagPattern") + private @Nullable Output tagPattern; + + /** + * @return The name pattern that tags must match in order to deploy to the environment. If not specified, `branch_pattern` must be specified. + * + */ + public Optional> tagPattern() { + return Optional.ofNullable(this.tagPattern); + } + private RepositoryEnvironmentDeploymentPolicyState() {} private RepositoryEnvironmentDeploymentPolicyState(RepositoryEnvironmentDeploymentPolicyState $) { this.branchPattern = $.branchPattern; this.environment = $.environment; this.repository = $.repository; + this.tagPattern = $.tagPattern; } public static Builder builder() { @@ -87,7 +103,7 @@ public Builder(RepositoryEnvironmentDeploymentPolicyState defaults) { } /** - * @param branchPattern The name pattern that branches must match in order to deploy to the environment. + * @param branchPattern The name pattern that branches must match in order to deploy to the environment. If not specified, `tag_pattern` must be specified. * * @return builder * @@ -98,7 +114,7 @@ public Builder branchPattern(@Nullable Output branchPattern) { } /** - * @param branchPattern The name pattern that branches must match in order to deploy to the environment. + * @param branchPattern The name pattern that branches must match in order to deploy to the environment. If not specified, `tag_pattern` must be specified. * * @return builder * @@ -149,6 +165,27 @@ public Builder repository(String repository) { return repository(Output.of(repository)); } + /** + * @param tagPattern The name pattern that tags must match in order to deploy to the environment. If not specified, `branch_pattern` must be specified. + * + * @return builder + * + */ + public Builder tagPattern(@Nullable Output tagPattern) { + $.tagPattern = tagPattern; + return this; + } + + /** + * @param tagPattern The name pattern that tags must match in order to deploy to the environment. If not specified, `branch_pattern` must be specified. + * + * @return builder + * + */ + public Builder tagPattern(String tagPattern) { + return tagPattern(Output.of(tagPattern)); + } + public RepositoryEnvironmentDeploymentPolicyState build() { return $; } diff --git a/sdk/java/src/main/java/com/pulumi/github/inputs/RepositoryRulesetRulesArgs.java b/sdk/java/src/main/java/com/pulumi/github/inputs/RepositoryRulesetRulesArgs.java index 52fc06e5..2cbe9fff 100644 --- a/sdk/java/src/main/java/com/pulumi/github/inputs/RepositoryRulesetRulesArgs.java +++ b/sdk/java/src/main/java/com/pulumi/github/inputs/RepositoryRulesetRulesArgs.java @@ -10,6 +10,7 @@ import com.pulumi.github.inputs.RepositoryRulesetRulesCommitMessagePatternArgs; import com.pulumi.github.inputs.RepositoryRulesetRulesCommitterEmailPatternArgs; import com.pulumi.github.inputs.RepositoryRulesetRulesPullRequestArgs; +import com.pulumi.github.inputs.RepositoryRulesetRulesRequiredCodeScanningArgs; import com.pulumi.github.inputs.RepositoryRulesetRulesRequiredDeploymentsArgs; import com.pulumi.github.inputs.RepositoryRulesetRulesRequiredStatusChecksArgs; import com.pulumi.github.inputs.RepositoryRulesetRulesTagNamePatternArgs; @@ -143,6 +144,21 @@ public Optional> pullRequest() { return Optional.ofNullable(this.pullRequest); } + /** + * (Block List, Max: 1) Define which tools must provide code scanning results before the reference is updated. When configured, code scanning must be enabled and have results for both the commit and the reference being updated. Multiple code scanning tools can be specified. (see below for nested schema) + * + */ + @Import(name="requiredCodeScanning") + private @Nullable Output requiredCodeScanning; + + /** + * @return (Block List, Max: 1) Define which tools must provide code scanning results before the reference is updated. When configured, code scanning must be enabled and have results for both the commit and the reference being updated. Multiple code scanning tools can be specified. (see below for nested schema) + * + */ + public Optional> requiredCodeScanning() { + return Optional.ofNullable(this.requiredCodeScanning); + } + /** * (Block List, Max: 1) Choose which environments must be successfully deployed to before branches can be merged into a branch that matches this rule. (see below for nested schema) * @@ -259,6 +275,7 @@ private RepositoryRulesetRulesArgs(RepositoryRulesetRulesArgs $) { this.deletion = $.deletion; this.nonFastForward = $.nonFastForward; this.pullRequest = $.pullRequest; + this.requiredCodeScanning = $.requiredCodeScanning; this.requiredDeployments = $.requiredDeployments; this.requiredLinearHistory = $.requiredLinearHistory; this.requiredSignatures = $.requiredSignatures; @@ -454,6 +471,27 @@ public Builder pullRequest(RepositoryRulesetRulesPullRequestArgs pullRequest) { return pullRequest(Output.of(pullRequest)); } + /** + * @param requiredCodeScanning (Block List, Max: 1) Define which tools must provide code scanning results before the reference is updated. When configured, code scanning must be enabled and have results for both the commit and the reference being updated. Multiple code scanning tools can be specified. (see below for nested schema) + * + * @return builder + * + */ + public Builder requiredCodeScanning(@Nullable Output requiredCodeScanning) { + $.requiredCodeScanning = requiredCodeScanning; + return this; + } + + /** + * @param requiredCodeScanning (Block List, Max: 1) Define which tools must provide code scanning results before the reference is updated. When configured, code scanning must be enabled and have results for both the commit and the reference being updated. Multiple code scanning tools can be specified. (see below for nested schema) + * + * @return builder + * + */ + public Builder requiredCodeScanning(RepositoryRulesetRulesRequiredCodeScanningArgs requiredCodeScanning) { + return requiredCodeScanning(Output.of(requiredCodeScanning)); + } + /** * @param requiredDeployments (Block List, Max: 1) Choose which environments must be successfully deployed to before branches can be merged into a branch that matches this rule. (see below for nested schema) * diff --git a/sdk/java/src/main/java/com/pulumi/github/inputs/RepositoryRulesetRulesRequiredCodeScanningArgs.java b/sdk/java/src/main/java/com/pulumi/github/inputs/RepositoryRulesetRulesRequiredCodeScanningArgs.java new file mode 100644 index 00000000..f9f3482a --- /dev/null +++ b/sdk/java/src/main/java/com/pulumi/github/inputs/RepositoryRulesetRulesRequiredCodeScanningArgs.java @@ -0,0 +1,96 @@ +// *** WARNING: this file was generated by pulumi-java-gen. *** +// *** Do not edit by hand unless you're certain you know what you are doing! *** + +package com.pulumi.github.inputs; + +import com.pulumi.core.Output; +import com.pulumi.core.annotations.Import; +import com.pulumi.exceptions.MissingRequiredPropertyException; +import com.pulumi.github.inputs.RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArgs; +import java.util.List; +import java.util.Objects; + + +public final class RepositoryRulesetRulesRequiredCodeScanningArgs extends com.pulumi.resources.ResourceArgs { + + public static final RepositoryRulesetRulesRequiredCodeScanningArgs Empty = new RepositoryRulesetRulesRequiredCodeScanningArgs(); + + /** + * Tools that must provide code scanning results for this rule to pass. + * + */ + @Import(name="requiredCodeScanningTools", required=true) + private Output> requiredCodeScanningTools; + + /** + * @return Tools that must provide code scanning results for this rule to pass. + * + */ + public Output> requiredCodeScanningTools() { + return this.requiredCodeScanningTools; + } + + private RepositoryRulesetRulesRequiredCodeScanningArgs() {} + + private RepositoryRulesetRulesRequiredCodeScanningArgs(RepositoryRulesetRulesRequiredCodeScanningArgs $) { + this.requiredCodeScanningTools = $.requiredCodeScanningTools; + } + + public static Builder builder() { + return new Builder(); + } + public static Builder builder(RepositoryRulesetRulesRequiredCodeScanningArgs defaults) { + return new Builder(defaults); + } + + public static final class Builder { + private RepositoryRulesetRulesRequiredCodeScanningArgs $; + + public Builder() { + $ = new RepositoryRulesetRulesRequiredCodeScanningArgs(); + } + + public Builder(RepositoryRulesetRulesRequiredCodeScanningArgs defaults) { + $ = new RepositoryRulesetRulesRequiredCodeScanningArgs(Objects.requireNonNull(defaults)); + } + + /** + * @param requiredCodeScanningTools Tools that must provide code scanning results for this rule to pass. + * + * @return builder + * + */ + public Builder requiredCodeScanningTools(Output> requiredCodeScanningTools) { + $.requiredCodeScanningTools = requiredCodeScanningTools; + return this; + } + + /** + * @param requiredCodeScanningTools Tools that must provide code scanning results for this rule to pass. + * + * @return builder + * + */ + public Builder requiredCodeScanningTools(List requiredCodeScanningTools) { + return requiredCodeScanningTools(Output.of(requiredCodeScanningTools)); + } + + /** + * @param requiredCodeScanningTools Tools that must provide code scanning results for this rule to pass. + * + * @return builder + * + */ + public Builder requiredCodeScanningTools(RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArgs... requiredCodeScanningTools) { + return requiredCodeScanningTools(List.of(requiredCodeScanningTools)); + } + + public RepositoryRulesetRulesRequiredCodeScanningArgs build() { + if ($.requiredCodeScanningTools == null) { + throw new MissingRequiredPropertyException("RepositoryRulesetRulesRequiredCodeScanningArgs", "requiredCodeScanningTools"); + } + return $; + } + } + +} diff --git a/sdk/java/src/main/java/com/pulumi/github/inputs/RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArgs.java b/sdk/java/src/main/java/com/pulumi/github/inputs/RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArgs.java new file mode 100644 index 00000000..e7699013 --- /dev/null +++ b/sdk/java/src/main/java/com/pulumi/github/inputs/RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArgs.java @@ -0,0 +1,165 @@ +// *** WARNING: this file was generated by pulumi-java-gen. *** +// *** Do not edit by hand unless you're certain you know what you are doing! *** + +package com.pulumi.github.inputs; + +import com.pulumi.core.Output; +import com.pulumi.core.annotations.Import; +import com.pulumi.exceptions.MissingRequiredPropertyException; +import java.lang.String; +import java.util.Objects; + + +public final class RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArgs extends com.pulumi.resources.ResourceArgs { + + public static final RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArgs Empty = new RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArgs(); + + /** + * The severity level at which code scanning results that raise alerts block a reference update. Can be one of: `none`, `errors`, `errors_and_warnings`, `all`. + * + */ + @Import(name="alertsThreshold", required=true) + private Output alertsThreshold; + + /** + * @return The severity level at which code scanning results that raise alerts block a reference update. Can be one of: `none`, `errors`, `errors_and_warnings`, `all`. + * + */ + public Output alertsThreshold() { + return this.alertsThreshold; + } + + /** + * The severity level at which code scanning results that raise security alerts block a reference update. Can be one of: `none`, `critical`, `high_or_higher`, `medium_or_higher`, `all`. + * + */ + @Import(name="securityAlertsThreshold", required=true) + private Output securityAlertsThreshold; + + /** + * @return The severity level at which code scanning results that raise security alerts block a reference update. Can be one of: `none`, `critical`, `high_or_higher`, `medium_or_higher`, `all`. + * + */ + public Output securityAlertsThreshold() { + return this.securityAlertsThreshold; + } + + /** + * The name of a code scanning tool + * + */ + @Import(name="tool", required=true) + private Output tool; + + /** + * @return The name of a code scanning tool + * + */ + public Output tool() { + return this.tool; + } + + private RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArgs() {} + + private RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArgs(RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArgs $) { + this.alertsThreshold = $.alertsThreshold; + this.securityAlertsThreshold = $.securityAlertsThreshold; + this.tool = $.tool; + } + + public static Builder builder() { + return new Builder(); + } + public static Builder builder(RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArgs defaults) { + return new Builder(defaults); + } + + public static final class Builder { + private RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArgs $; + + public Builder() { + $ = new RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArgs(); + } + + public Builder(RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArgs defaults) { + $ = new RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArgs(Objects.requireNonNull(defaults)); + } + + /** + * @param alertsThreshold The severity level at which code scanning results that raise alerts block a reference update. Can be one of: `none`, `errors`, `errors_and_warnings`, `all`. + * + * @return builder + * + */ + public Builder alertsThreshold(Output alertsThreshold) { + $.alertsThreshold = alertsThreshold; + return this; + } + + /** + * @param alertsThreshold The severity level at which code scanning results that raise alerts block a reference update. Can be one of: `none`, `errors`, `errors_and_warnings`, `all`. + * + * @return builder + * + */ + public Builder alertsThreshold(String alertsThreshold) { + return alertsThreshold(Output.of(alertsThreshold)); + } + + /** + * @param securityAlertsThreshold The severity level at which code scanning results that raise security alerts block a reference update. Can be one of: `none`, `critical`, `high_or_higher`, `medium_or_higher`, `all`. + * + * @return builder + * + */ + public Builder securityAlertsThreshold(Output securityAlertsThreshold) { + $.securityAlertsThreshold = securityAlertsThreshold; + return this; + } + + /** + * @param securityAlertsThreshold The severity level at which code scanning results that raise security alerts block a reference update. Can be one of: `none`, `critical`, `high_or_higher`, `medium_or_higher`, `all`. + * + * @return builder + * + */ + public Builder securityAlertsThreshold(String securityAlertsThreshold) { + return securityAlertsThreshold(Output.of(securityAlertsThreshold)); + } + + /** + * @param tool The name of a code scanning tool + * + * @return builder + * + */ + public Builder tool(Output tool) { + $.tool = tool; + return this; + } + + /** + * @param tool The name of a code scanning tool + * + * @return builder + * + */ + public Builder tool(String tool) { + return tool(Output.of(tool)); + } + + public RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArgs build() { + if ($.alertsThreshold == null) { + throw new MissingRequiredPropertyException("RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArgs", "alertsThreshold"); + } + if ($.securityAlertsThreshold == null) { + throw new MissingRequiredPropertyException("RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArgs", "securityAlertsThreshold"); + } + if ($.tool == null) { + throw new MissingRequiredPropertyException("RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArgs", "tool"); + } + return $; + } + } + +} diff --git a/sdk/java/src/main/java/com/pulumi/github/inputs/RepositoryTagProtectionState.java b/sdk/java/src/main/java/com/pulumi/github/inputs/RepositoryTagProtectionState.java deleted file mode 100644 index 0ab23e8d..00000000 --- a/sdk/java/src/main/java/com/pulumi/github/inputs/RepositoryTagProtectionState.java +++ /dev/null @@ -1,158 +0,0 @@ -// *** WARNING: this file was generated by pulumi-java-gen. *** -// *** Do not edit by hand unless you're certain you know what you are doing! *** - -package com.pulumi.github.inputs; - -import com.pulumi.core.Output; -import com.pulumi.core.annotations.Import; -import java.lang.Integer; -import java.lang.String; -import java.util.Objects; -import java.util.Optional; -import javax.annotation.Nullable; - - -public final class RepositoryTagProtectionState extends com.pulumi.resources.ResourceArgs { - - public static final RepositoryTagProtectionState Empty = new RepositoryTagProtectionState(); - - /** - * The pattern of the tag to protect. - * - */ - @Import(name="pattern") - private @Nullable Output pattern; - - /** - * @return The pattern of the tag to protect. - * - */ - public Optional> pattern() { - return Optional.ofNullable(this.pattern); - } - - /** - * Name of the repository to add the tag protection to. - * - */ - @Import(name="repository") - private @Nullable Output repository; - - /** - * @return Name of the repository to add the tag protection to. - * - */ - public Optional> repository() { - return Optional.ofNullable(this.repository); - } - - /** - * The ID of the tag protection. - * - */ - @Import(name="tagProtectionId") - private @Nullable Output tagProtectionId; - - /** - * @return The ID of the tag protection. - * - */ - public Optional> tagProtectionId() { - return Optional.ofNullable(this.tagProtectionId); - } - - private RepositoryTagProtectionState() {} - - private RepositoryTagProtectionState(RepositoryTagProtectionState $) { - this.pattern = $.pattern; - this.repository = $.repository; - this.tagProtectionId = $.tagProtectionId; - } - - public static Builder builder() { - return new Builder(); - } - public static Builder builder(RepositoryTagProtectionState defaults) { - return new Builder(defaults); - } - - public static final class Builder { - private RepositoryTagProtectionState $; - - public Builder() { - $ = new RepositoryTagProtectionState(); - } - - public Builder(RepositoryTagProtectionState defaults) { - $ = new RepositoryTagProtectionState(Objects.requireNonNull(defaults)); - } - - /** - * @param pattern The pattern of the tag to protect. - * - * @return builder - * - */ - public Builder pattern(@Nullable Output pattern) { - $.pattern = pattern; - return this; - } - - /** - * @param pattern The pattern of the tag to protect. - * - * @return builder - * - */ - public Builder pattern(String pattern) { - return pattern(Output.of(pattern)); - } - - /** - * @param repository Name of the repository to add the tag protection to. - * - * @return builder - * - */ - public Builder repository(@Nullable Output repository) { - $.repository = repository; - return this; - } - - /** - * @param repository Name of the repository to add the tag protection to. - * - * @return builder - * - */ - public Builder repository(String repository) { - return repository(Output.of(repository)); - } - - /** - * @param tagProtectionId The ID of the tag protection. - * - * @return builder - * - */ - public Builder tagProtectionId(@Nullable Output tagProtectionId) { - $.tagProtectionId = tagProtectionId; - return this; - } - - /** - * @param tagProtectionId The ID of the tag protection. - * - * @return builder - * - */ - public Builder tagProtectionId(Integer tagProtectionId) { - return tagProtectionId(Output.of(tagProtectionId)); - } - - public RepositoryTagProtectionState build() { - return $; - } - } - -} diff --git a/sdk/java/src/main/java/com/pulumi/github/outputs/OrganizationRulesetRules.java b/sdk/java/src/main/java/com/pulumi/github/outputs/OrganizationRulesetRules.java index 267c92b3..b80ae97a 100644 --- a/sdk/java/src/main/java/com/pulumi/github/outputs/OrganizationRulesetRules.java +++ b/sdk/java/src/main/java/com/pulumi/github/outputs/OrganizationRulesetRules.java @@ -9,6 +9,7 @@ import com.pulumi.github.outputs.OrganizationRulesetRulesCommitMessagePattern; import com.pulumi.github.outputs.OrganizationRulesetRulesCommitterEmailPattern; import com.pulumi.github.outputs.OrganizationRulesetRulesPullRequest; +import com.pulumi.github.outputs.OrganizationRulesetRulesRequiredCodeScanning; import com.pulumi.github.outputs.OrganizationRulesetRulesRequiredStatusChecks; import com.pulumi.github.outputs.OrganizationRulesetRulesRequiredWorkflows; import com.pulumi.github.outputs.OrganizationRulesetRulesTagNamePattern; @@ -59,6 +60,11 @@ public final class OrganizationRulesetRules { * */ private @Nullable OrganizationRulesetRulesPullRequest pullRequest; + /** + * @return (Block List, Max: 1) Define which tools must provide code scanning results before the reference is updated. When configured, code scanning must be enabled and have results for both the commit and the reference being updated. Multiple code scanning tools can be specified. (see below for nested schema) + * + */ + private @Nullable OrganizationRulesetRulesRequiredCodeScanning requiredCodeScanning; /** * @return (Boolean) Prevent merge commits from being pushed to matching branches. * @@ -147,6 +153,13 @@ public Optional nonFastForward() { public Optional pullRequest() { return Optional.ofNullable(this.pullRequest); } + /** + * @return (Block List, Max: 1) Define which tools must provide code scanning results before the reference is updated. When configured, code scanning must be enabled and have results for both the commit and the reference being updated. Multiple code scanning tools can be specified. (see below for nested schema) + * + */ + public Optional requiredCodeScanning() { + return Optional.ofNullable(this.requiredCodeScanning); + } /** * @return (Boolean) Prevent merge commits from being pushed to matching branches. * @@ -207,6 +220,7 @@ public static final class Builder { private @Nullable Boolean deletion; private @Nullable Boolean nonFastForward; private @Nullable OrganizationRulesetRulesPullRequest pullRequest; + private @Nullable OrganizationRulesetRulesRequiredCodeScanning requiredCodeScanning; private @Nullable Boolean requiredLinearHistory; private @Nullable Boolean requiredSignatures; private @Nullable OrganizationRulesetRulesRequiredStatusChecks requiredStatusChecks; @@ -224,6 +238,7 @@ public Builder(OrganizationRulesetRules defaults) { this.deletion = defaults.deletion; this.nonFastForward = defaults.nonFastForward; this.pullRequest = defaults.pullRequest; + this.requiredCodeScanning = defaults.requiredCodeScanning; this.requiredLinearHistory = defaults.requiredLinearHistory; this.requiredSignatures = defaults.requiredSignatures; this.requiredStatusChecks = defaults.requiredStatusChecks; @@ -281,6 +296,12 @@ public Builder pullRequest(@Nullable OrganizationRulesetRulesPullRequest pullReq return this; } @CustomType.Setter + public Builder requiredCodeScanning(@Nullable OrganizationRulesetRulesRequiredCodeScanning requiredCodeScanning) { + + this.requiredCodeScanning = requiredCodeScanning; + return this; + } + @CustomType.Setter public Builder requiredLinearHistory(@Nullable Boolean requiredLinearHistory) { this.requiredLinearHistory = requiredLinearHistory; @@ -326,6 +347,7 @@ public OrganizationRulesetRules build() { _resultValue.deletion = deletion; _resultValue.nonFastForward = nonFastForward; _resultValue.pullRequest = pullRequest; + _resultValue.requiredCodeScanning = requiredCodeScanning; _resultValue.requiredLinearHistory = requiredLinearHistory; _resultValue.requiredSignatures = requiredSignatures; _resultValue.requiredStatusChecks = requiredStatusChecks; diff --git a/sdk/java/src/main/java/com/pulumi/github/outputs/OrganizationRulesetRulesRequiredCodeScanning.java b/sdk/java/src/main/java/com/pulumi/github/outputs/OrganizationRulesetRulesRequiredCodeScanning.java new file mode 100644 index 00000000..a5297672 --- /dev/null +++ b/sdk/java/src/main/java/com/pulumi/github/outputs/OrganizationRulesetRulesRequiredCodeScanning.java @@ -0,0 +1,62 @@ +// *** WARNING: this file was generated by pulumi-java-gen. *** +// *** Do not edit by hand unless you're certain you know what you are doing! *** + +package com.pulumi.github.outputs; + +import com.pulumi.core.annotations.CustomType; +import com.pulumi.exceptions.MissingRequiredPropertyException; +import com.pulumi.github.outputs.OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningTool; +import java.util.List; +import java.util.Objects; + +@CustomType +public final class OrganizationRulesetRulesRequiredCodeScanning { + /** + * @return Tools that must provide code scanning results for this rule to pass. + * + */ + private List requiredCodeScanningTools; + + private OrganizationRulesetRulesRequiredCodeScanning() {} + /** + * @return Tools that must provide code scanning results for this rule to pass. + * + */ + public List requiredCodeScanningTools() { + return this.requiredCodeScanningTools; + } + + public static Builder builder() { + return new Builder(); + } + + public static Builder builder(OrganizationRulesetRulesRequiredCodeScanning defaults) { + return new Builder(defaults); + } + @CustomType.Builder + public static final class Builder { + private List requiredCodeScanningTools; + public Builder() {} + public Builder(OrganizationRulesetRulesRequiredCodeScanning defaults) { + Objects.requireNonNull(defaults); + this.requiredCodeScanningTools = defaults.requiredCodeScanningTools; + } + + @CustomType.Setter + public Builder requiredCodeScanningTools(List requiredCodeScanningTools) { + if (requiredCodeScanningTools == null) { + throw new MissingRequiredPropertyException("OrganizationRulesetRulesRequiredCodeScanning", "requiredCodeScanningTools"); + } + this.requiredCodeScanningTools = requiredCodeScanningTools; + return this; + } + public Builder requiredCodeScanningTools(OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningTool... requiredCodeScanningTools) { + return requiredCodeScanningTools(List.of(requiredCodeScanningTools)); + } + public OrganizationRulesetRulesRequiredCodeScanning build() { + final var _resultValue = new OrganizationRulesetRulesRequiredCodeScanning(); + _resultValue.requiredCodeScanningTools = requiredCodeScanningTools; + return _resultValue; + } + } +} diff --git a/sdk/java/src/main/java/com/pulumi/github/outputs/OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningTool.java b/sdk/java/src/main/java/com/pulumi/github/outputs/OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningTool.java new file mode 100644 index 00000000..2f30eb9e --- /dev/null +++ b/sdk/java/src/main/java/com/pulumi/github/outputs/OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningTool.java @@ -0,0 +1,104 @@ +// *** WARNING: this file was generated by pulumi-java-gen. *** +// *** Do not edit by hand unless you're certain you know what you are doing! *** + +package com.pulumi.github.outputs; + +import com.pulumi.core.annotations.CustomType; +import com.pulumi.exceptions.MissingRequiredPropertyException; +import java.lang.String; +import java.util.Objects; + +@CustomType +public final class OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningTool { + /** + * @return The severity level at which code scanning results that raise alerts block a reference update. Can be one of: `none`, `errors`, `errors_and_warnings`, `all`. + * + */ + private String alertsThreshold; + /** + * @return The severity level at which code scanning results that raise security alerts block a reference update. Can be one of: `none`, `critical`, `high_or_higher`, `medium_or_higher`, `all`. + * + */ + private String securityAlertsThreshold; + /** + * @return The name of a code scanning tool. + * + */ + private String tool; + + private OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningTool() {} + /** + * @return The severity level at which code scanning results that raise alerts block a reference update. Can be one of: `none`, `errors`, `errors_and_warnings`, `all`. + * + */ + public String alertsThreshold() { + return this.alertsThreshold; + } + /** + * @return The severity level at which code scanning results that raise security alerts block a reference update. Can be one of: `none`, `critical`, `high_or_higher`, `medium_or_higher`, `all`. + * + */ + public String securityAlertsThreshold() { + return this.securityAlertsThreshold; + } + /** + * @return The name of a code scanning tool. + * + */ + public String tool() { + return this.tool; + } + + public static Builder builder() { + return new Builder(); + } + + public static Builder builder(OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningTool defaults) { + return new Builder(defaults); + } + @CustomType.Builder + public static final class Builder { + private String alertsThreshold; + private String securityAlertsThreshold; + private String tool; + public Builder() {} + public Builder(OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningTool defaults) { + Objects.requireNonNull(defaults); + this.alertsThreshold = defaults.alertsThreshold; + this.securityAlertsThreshold = defaults.securityAlertsThreshold; + this.tool = defaults.tool; + } + + @CustomType.Setter + public Builder alertsThreshold(String alertsThreshold) { + if (alertsThreshold == null) { + throw new MissingRequiredPropertyException("OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningTool", "alertsThreshold"); + } + this.alertsThreshold = alertsThreshold; + return this; + } + @CustomType.Setter + public Builder securityAlertsThreshold(String securityAlertsThreshold) { + if (securityAlertsThreshold == null) { + throw new MissingRequiredPropertyException("OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningTool", "securityAlertsThreshold"); + } + this.securityAlertsThreshold = securityAlertsThreshold; + return this; + } + @CustomType.Setter + public Builder tool(String tool) { + if (tool == null) { + throw new MissingRequiredPropertyException("OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningTool", "tool"); + } + this.tool = tool; + return this; + } + public OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningTool build() { + final var _resultValue = new OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningTool(); + _resultValue.alertsThreshold = alertsThreshold; + _resultValue.securityAlertsThreshold = securityAlertsThreshold; + _resultValue.tool = tool; + return _resultValue; + } + } +} diff --git a/sdk/java/src/main/java/com/pulumi/github/outputs/RepositoryRulesetRules.java b/sdk/java/src/main/java/com/pulumi/github/outputs/RepositoryRulesetRules.java index 7bad871f..516f60b3 100644 --- a/sdk/java/src/main/java/com/pulumi/github/outputs/RepositoryRulesetRules.java +++ b/sdk/java/src/main/java/com/pulumi/github/outputs/RepositoryRulesetRules.java @@ -9,6 +9,7 @@ import com.pulumi.github.outputs.RepositoryRulesetRulesCommitMessagePattern; import com.pulumi.github.outputs.RepositoryRulesetRulesCommitterEmailPattern; import com.pulumi.github.outputs.RepositoryRulesetRulesPullRequest; +import com.pulumi.github.outputs.RepositoryRulesetRulesRequiredCodeScanning; import com.pulumi.github.outputs.RepositoryRulesetRulesRequiredDeployments; import com.pulumi.github.outputs.RepositoryRulesetRulesRequiredStatusChecks; import com.pulumi.github.outputs.RepositoryRulesetRulesTagNamePattern; @@ -59,6 +60,11 @@ public final class RepositoryRulesetRules { * */ private @Nullable RepositoryRulesetRulesPullRequest pullRequest; + /** + * @return (Block List, Max: 1) Define which tools must provide code scanning results before the reference is updated. When configured, code scanning must be enabled and have results for both the commit and the reference being updated. Multiple code scanning tools can be specified. (see below for nested schema) + * + */ + private @Nullable RepositoryRulesetRulesRequiredCodeScanning requiredCodeScanning; /** * @return (Block List, Max: 1) Choose which environments must be successfully deployed to before branches can be merged into a branch that matches this rule. (see below for nested schema) * @@ -152,6 +158,13 @@ public Optional nonFastForward() { public Optional pullRequest() { return Optional.ofNullable(this.pullRequest); } + /** + * @return (Block List, Max: 1) Define which tools must provide code scanning results before the reference is updated. When configured, code scanning must be enabled and have results for both the commit and the reference being updated. Multiple code scanning tools can be specified. (see below for nested schema) + * + */ + public Optional requiredCodeScanning() { + return Optional.ofNullable(this.requiredCodeScanning); + } /** * @return (Block List, Max: 1) Choose which environments must be successfully deployed to before branches can be merged into a branch that matches this rule. (see below for nested schema) * @@ -219,6 +232,7 @@ public static final class Builder { private @Nullable Boolean deletion; private @Nullable Boolean nonFastForward; private @Nullable RepositoryRulesetRulesPullRequest pullRequest; + private @Nullable RepositoryRulesetRulesRequiredCodeScanning requiredCodeScanning; private @Nullable RepositoryRulesetRulesRequiredDeployments requiredDeployments; private @Nullable Boolean requiredLinearHistory; private @Nullable Boolean requiredSignatures; @@ -237,6 +251,7 @@ public Builder(RepositoryRulesetRules defaults) { this.deletion = defaults.deletion; this.nonFastForward = defaults.nonFastForward; this.pullRequest = defaults.pullRequest; + this.requiredCodeScanning = defaults.requiredCodeScanning; this.requiredDeployments = defaults.requiredDeployments; this.requiredLinearHistory = defaults.requiredLinearHistory; this.requiredSignatures = defaults.requiredSignatures; @@ -295,6 +310,12 @@ public Builder pullRequest(@Nullable RepositoryRulesetRulesPullRequest pullReque return this; } @CustomType.Setter + public Builder requiredCodeScanning(@Nullable RepositoryRulesetRulesRequiredCodeScanning requiredCodeScanning) { + + this.requiredCodeScanning = requiredCodeScanning; + return this; + } + @CustomType.Setter public Builder requiredDeployments(@Nullable RepositoryRulesetRulesRequiredDeployments requiredDeployments) { this.requiredDeployments = requiredDeployments; @@ -346,6 +367,7 @@ public RepositoryRulesetRules build() { _resultValue.deletion = deletion; _resultValue.nonFastForward = nonFastForward; _resultValue.pullRequest = pullRequest; + _resultValue.requiredCodeScanning = requiredCodeScanning; _resultValue.requiredDeployments = requiredDeployments; _resultValue.requiredLinearHistory = requiredLinearHistory; _resultValue.requiredSignatures = requiredSignatures; diff --git a/sdk/java/src/main/java/com/pulumi/github/outputs/RepositoryRulesetRulesRequiredCodeScanning.java b/sdk/java/src/main/java/com/pulumi/github/outputs/RepositoryRulesetRulesRequiredCodeScanning.java new file mode 100644 index 00000000..ea50f758 --- /dev/null +++ b/sdk/java/src/main/java/com/pulumi/github/outputs/RepositoryRulesetRulesRequiredCodeScanning.java @@ -0,0 +1,62 @@ +// *** WARNING: this file was generated by pulumi-java-gen. *** +// *** Do not edit by hand unless you're certain you know what you are doing! *** + +package com.pulumi.github.outputs; + +import com.pulumi.core.annotations.CustomType; +import com.pulumi.exceptions.MissingRequiredPropertyException; +import com.pulumi.github.outputs.RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningTool; +import java.util.List; +import java.util.Objects; + +@CustomType +public final class RepositoryRulesetRulesRequiredCodeScanning { + /** + * @return Tools that must provide code scanning results for this rule to pass. + * + */ + private List requiredCodeScanningTools; + + private RepositoryRulesetRulesRequiredCodeScanning() {} + /** + * @return Tools that must provide code scanning results for this rule to pass. + * + */ + public List requiredCodeScanningTools() { + return this.requiredCodeScanningTools; + } + + public static Builder builder() { + return new Builder(); + } + + public static Builder builder(RepositoryRulesetRulesRequiredCodeScanning defaults) { + return new Builder(defaults); + } + @CustomType.Builder + public static final class Builder { + private List requiredCodeScanningTools; + public Builder() {} + public Builder(RepositoryRulesetRulesRequiredCodeScanning defaults) { + Objects.requireNonNull(defaults); + this.requiredCodeScanningTools = defaults.requiredCodeScanningTools; + } + + @CustomType.Setter + public Builder requiredCodeScanningTools(List requiredCodeScanningTools) { + if (requiredCodeScanningTools == null) { + throw new MissingRequiredPropertyException("RepositoryRulesetRulesRequiredCodeScanning", "requiredCodeScanningTools"); + } + this.requiredCodeScanningTools = requiredCodeScanningTools; + return this; + } + public Builder requiredCodeScanningTools(RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningTool... requiredCodeScanningTools) { + return requiredCodeScanningTools(List.of(requiredCodeScanningTools)); + } + public RepositoryRulesetRulesRequiredCodeScanning build() { + final var _resultValue = new RepositoryRulesetRulesRequiredCodeScanning(); + _resultValue.requiredCodeScanningTools = requiredCodeScanningTools; + return _resultValue; + } + } +} diff --git a/sdk/java/src/main/java/com/pulumi/github/outputs/RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningTool.java b/sdk/java/src/main/java/com/pulumi/github/outputs/RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningTool.java new file mode 100644 index 00000000..21ec4b4d --- /dev/null +++ b/sdk/java/src/main/java/com/pulumi/github/outputs/RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningTool.java @@ -0,0 +1,104 @@ +// *** WARNING: this file was generated by pulumi-java-gen. *** +// *** Do not edit by hand unless you're certain you know what you are doing! *** + +package com.pulumi.github.outputs; + +import com.pulumi.core.annotations.CustomType; +import com.pulumi.exceptions.MissingRequiredPropertyException; +import java.lang.String; +import java.util.Objects; + +@CustomType +public final class RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningTool { + /** + * @return The severity level at which code scanning results that raise alerts block a reference update. Can be one of: `none`, `errors`, `errors_and_warnings`, `all`. + * + */ + private String alertsThreshold; + /** + * @return The severity level at which code scanning results that raise security alerts block a reference update. Can be one of: `none`, `critical`, `high_or_higher`, `medium_or_higher`, `all`. + * + */ + private String securityAlertsThreshold; + /** + * @return The name of a code scanning tool + * + */ + private String tool; + + private RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningTool() {} + /** + * @return The severity level at which code scanning results that raise alerts block a reference update. Can be one of: `none`, `errors`, `errors_and_warnings`, `all`. + * + */ + public String alertsThreshold() { + return this.alertsThreshold; + } + /** + * @return The severity level at which code scanning results that raise security alerts block a reference update. Can be one of: `none`, `critical`, `high_or_higher`, `medium_or_higher`, `all`. + * + */ + public String securityAlertsThreshold() { + return this.securityAlertsThreshold; + } + /** + * @return The name of a code scanning tool + * + */ + public String tool() { + return this.tool; + } + + public static Builder builder() { + return new Builder(); + } + + public static Builder builder(RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningTool defaults) { + return new Builder(defaults); + } + @CustomType.Builder + public static final class Builder { + private String alertsThreshold; + private String securityAlertsThreshold; + private String tool; + public Builder() {} + public Builder(RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningTool defaults) { + Objects.requireNonNull(defaults); + this.alertsThreshold = defaults.alertsThreshold; + this.securityAlertsThreshold = defaults.securityAlertsThreshold; + this.tool = defaults.tool; + } + + @CustomType.Setter + public Builder alertsThreshold(String alertsThreshold) { + if (alertsThreshold == null) { + throw new MissingRequiredPropertyException("RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningTool", "alertsThreshold"); + } + this.alertsThreshold = alertsThreshold; + return this; + } + @CustomType.Setter + public Builder securityAlertsThreshold(String securityAlertsThreshold) { + if (securityAlertsThreshold == null) { + throw new MissingRequiredPropertyException("RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningTool", "securityAlertsThreshold"); + } + this.securityAlertsThreshold = securityAlertsThreshold; + return this; + } + @CustomType.Setter + public Builder tool(String tool) { + if (tool == null) { + throw new MissingRequiredPropertyException("RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningTool", "tool"); + } + this.tool = tool; + return this; + } + public RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningTool build() { + final var _resultValue = new RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningTool(); + _resultValue.alertsThreshold = alertsThreshold; + _resultValue.securityAlertsThreshold = securityAlertsThreshold; + _resultValue.tool = tool; + return _resultValue; + } + } +} diff --git a/sdk/nodejs/index.ts b/sdk/nodejs/index.ts index 19236736..dc4cf525 100644 --- a/sdk/nodejs/index.ts +++ b/sdk/nodejs/index.ts @@ -605,11 +605,6 @@ export type RepositoryRuleset = import("./repositoryRuleset").RepositoryRuleset; export const RepositoryRuleset: typeof import("./repositoryRuleset").RepositoryRuleset = null as any; utilities.lazyLoad(exports, ["RepositoryRuleset"], () => require("./repositoryRuleset")); -export { RepositoryTagProtectionArgs, RepositoryTagProtectionState } from "./repositoryTagProtection"; -export type RepositoryTagProtection = import("./repositoryTagProtection").RepositoryTagProtection; -export const RepositoryTagProtection: typeof import("./repositoryTagProtection").RepositoryTagProtection = null as any; -utilities.lazyLoad(exports, ["RepositoryTagProtection"], () => require("./repositoryTagProtection")); - export { RepositoryTopicsArgs, RepositoryTopicsState } from "./repositoryTopics"; export type RepositoryTopics = import("./repositoryTopics").RepositoryTopics; export const RepositoryTopics: typeof import("./repositoryTopics").RepositoryTopics = null as any; @@ -795,8 +790,6 @@ const _module = { return new RepositoryPullRequest(name, undefined, { urn }) case "github:index/repositoryRuleset:RepositoryRuleset": return new RepositoryRuleset(name, undefined, { urn }) - case "github:index/repositoryTagProtection:RepositoryTagProtection": - return new RepositoryTagProtection(name, undefined, { urn }) case "github:index/repositoryTopics:RepositoryTopics": return new RepositoryTopics(name, undefined, { urn }) case "github:index/repositoryWebhook:RepositoryWebhook": @@ -882,7 +875,6 @@ pulumi.runtime.registerResourceModule("github", "index/repositoryMilestone", _mo pulumi.runtime.registerResourceModule("github", "index/repositoryProject", _module) pulumi.runtime.registerResourceModule("github", "index/repositoryPullRequest", _module) pulumi.runtime.registerResourceModule("github", "index/repositoryRuleset", _module) -pulumi.runtime.registerResourceModule("github", "index/repositoryTagProtection", _module) pulumi.runtime.registerResourceModule("github", "index/repositoryTopics", _module) pulumi.runtime.registerResourceModule("github", "index/repositoryWebhook", _module) pulumi.runtime.registerResourceModule("github", "index/team", _module) diff --git a/sdk/nodejs/repositoryEnvironmentDeploymentPolicy.ts b/sdk/nodejs/repositoryEnvironmentDeploymentPolicy.ts index 91440968..b9ac122b 100644 --- a/sdk/nodejs/repositoryEnvironmentDeploymentPolicy.ts +++ b/sdk/nodejs/repositoryEnvironmentDeploymentPolicy.ts @@ -9,6 +9,8 @@ import * as utilities from "./utilities"; * * ## Example Usage * + * Create a branch-based deployment policy: + * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as github from "@pulumi/github"; @@ -36,6 +38,35 @@ import * as utilities from "./utilities"; * }); * ``` * + * Create a tag-based deployment policy: + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const current = github.getUser({ + * username: "", + * }); + * const test = new github.Repository("test", {name: "tf-acc-test-%s"}); + * const testRepositoryEnvironment = new github.RepositoryEnvironment("test", { + * repository: test.name, + * environment: "environment/test", + * waitTimer: 10000, + * reviewers: [{ + * users: [current.then(current => current.id)], + * }], + * deploymentBranchPolicy: { + * protectedBranches: false, + * customBranchPolicies: true, + * }, + * }); + * const testRepositoryEnvironmentDeploymentPolicy = new github.RepositoryEnvironmentDeploymentPolicy("test", { + * repository: test.name, + * environment: testRepositoryEnvironment.environment, + * tagPattern: "v*", + * }); + * ``` + * * ## Import * * GitHub Repository Environment Deployment Policy can be imported using an ID made up of `name` of the repository combined with the `environment` name of the environment with the `Id` of the deployment policy, separated by a `:` character, e.g. @@ -73,9 +104,9 @@ export class RepositoryEnvironmentDeploymentPolicy extends pulumi.CustomResource } /** - * The name pattern that branches must match in order to deploy to the environment. + * The name pattern that branches must match in order to deploy to the environment. If not specified, `tagPattern` must be specified. */ - public readonly branchPattern!: pulumi.Output; + public readonly branchPattern!: pulumi.Output; /** * The name of the environment. */ @@ -84,6 +115,10 @@ export class RepositoryEnvironmentDeploymentPolicy extends pulumi.CustomResource * The repository of the environment. */ public readonly repository!: pulumi.Output; + /** + * The name pattern that tags must match in order to deploy to the environment. If not specified, `branchPattern` must be specified. + */ + public readonly tagPattern!: pulumi.Output; /** * Create a RepositoryEnvironmentDeploymentPolicy resource with the given unique name, arguments, and options. @@ -101,11 +136,9 @@ export class RepositoryEnvironmentDeploymentPolicy extends pulumi.CustomResource resourceInputs["branchPattern"] = state ? state.branchPattern : undefined; resourceInputs["environment"] = state ? state.environment : undefined; resourceInputs["repository"] = state ? state.repository : undefined; + resourceInputs["tagPattern"] = state ? state.tagPattern : undefined; } else { const args = argsOrState as RepositoryEnvironmentDeploymentPolicyArgs | undefined; - if ((!args || args.branchPattern === undefined) && !opts.urn) { - throw new Error("Missing required property 'branchPattern'"); - } if ((!args || args.environment === undefined) && !opts.urn) { throw new Error("Missing required property 'environment'"); } @@ -115,6 +148,7 @@ export class RepositoryEnvironmentDeploymentPolicy extends pulumi.CustomResource resourceInputs["branchPattern"] = args ? args.branchPattern : undefined; resourceInputs["environment"] = args ? args.environment : undefined; resourceInputs["repository"] = args ? args.repository : undefined; + resourceInputs["tagPattern"] = args ? args.tagPattern : undefined; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(RepositoryEnvironmentDeploymentPolicy.__pulumiType, name, resourceInputs, opts); @@ -126,7 +160,7 @@ export class RepositoryEnvironmentDeploymentPolicy extends pulumi.CustomResource */ export interface RepositoryEnvironmentDeploymentPolicyState { /** - * The name pattern that branches must match in order to deploy to the environment. + * The name pattern that branches must match in order to deploy to the environment. If not specified, `tagPattern` must be specified. */ branchPattern?: pulumi.Input; /** @@ -137,6 +171,10 @@ export interface RepositoryEnvironmentDeploymentPolicyState { * The repository of the environment. */ repository?: pulumi.Input; + /** + * The name pattern that tags must match in order to deploy to the environment. If not specified, `branchPattern` must be specified. + */ + tagPattern?: pulumi.Input; } /** @@ -144,9 +182,9 @@ export interface RepositoryEnvironmentDeploymentPolicyState { */ export interface RepositoryEnvironmentDeploymentPolicyArgs { /** - * The name pattern that branches must match in order to deploy to the environment. + * The name pattern that branches must match in order to deploy to the environment. If not specified, `tagPattern` must be specified. */ - branchPattern: pulumi.Input; + branchPattern?: pulumi.Input; /** * The name of the environment. */ @@ -155,4 +193,8 @@ export interface RepositoryEnvironmentDeploymentPolicyArgs { * The repository of the environment. */ repository: pulumi.Input; + /** + * The name pattern that tags must match in order to deploy to the environment. If not specified, `branchPattern` must be specified. + */ + tagPattern?: pulumi.Input; } diff --git a/sdk/nodejs/repositoryTagProtection.ts b/sdk/nodejs/repositoryTagProtection.ts deleted file mode 100644 index aeac4330..00000000 --- a/sdk/nodejs/repositoryTagProtection.ts +++ /dev/null @@ -1,137 +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! *** - -import * as pulumi from "@pulumi/pulumi"; -import * as utilities from "./utilities"; - -/** - * This resource allows you to create and manage a repository tag protection for repositories within your GitHub organization or personal account. - * - * ## Example Usage - * - * ```typescript - * import * as pulumi from "@pulumi/pulumi"; - * import * as github from "@pulumi/github"; - * - * const example = new github.RepositoryTagProtection("example", { - * repository: "example-repository", - * pattern: "v*", - * }); - * ``` - * - * ## Import - * - * Repository tag protections can be imported using the `name` of the repository, combined with the `id` of the tag protection, separated by a `/` character. - * The `id` of the tag protection can be found using the [GitHub API](https://docs.github.com/en/rest/repos/tags#list-tag-protection-states-for-a-repository). - * - * Importing uses the name of the repository, as well as the ID of the tag protection, e.g. - * - * ```sh - * $ pulumi import github:index/repositoryTagProtection:RepositoryTagProtection terraform my-repo/31077 - * ``` - */ -export class RepositoryTagProtection extends pulumi.CustomResource { - /** - * Get an existing RepositoryTagProtection resource's state with the given name, ID, and optional extra - * properties used to qualify the lookup. - * - * @param name The _unique_ name of the resulting resource. - * @param id The _unique_ provider ID of the resource to lookup. - * @param state Any extra arguments used during the lookup. - * @param opts Optional settings to control the behavior of the CustomResource. - */ - public static get(name: string, id: pulumi.Input, state?: RepositoryTagProtectionState, opts?: pulumi.CustomResourceOptions): RepositoryTagProtection { - return new RepositoryTagProtection(name, state, { ...opts, id: id }); - } - - /** @internal */ - public static readonly __pulumiType = 'github:index/repositoryTagProtection:RepositoryTagProtection'; - - /** - * Returns true if the given object is an instance of RepositoryTagProtection. This is designed to work even - * when multiple copies of the Pulumi SDK have been loaded into the same process. - */ - public static isInstance(obj: any): obj is RepositoryTagProtection { - if (obj === undefined || obj === null) { - return false; - } - return obj['__pulumiType'] === RepositoryTagProtection.__pulumiType; - } - - /** - * The pattern of the tag to protect. - */ - public readonly pattern!: pulumi.Output; - /** - * Name of the repository to add the tag protection to. - */ - public readonly repository!: pulumi.Output; - /** - * The ID of the tag protection. - */ - public /*out*/ readonly tagProtectionId!: pulumi.Output; - - /** - * Create a RepositoryTagProtection resource with the given unique name, arguments, and options. - * - * @param name The _unique_ name of the resource. - * @param args The arguments to use to populate this resource's properties. - * @param opts A bag of options that control this resource's behavior. - */ - constructor(name: string, args: RepositoryTagProtectionArgs, opts?: pulumi.CustomResourceOptions) - constructor(name: string, argsOrState?: RepositoryTagProtectionArgs | RepositoryTagProtectionState, opts?: pulumi.CustomResourceOptions) { - let resourceInputs: pulumi.Inputs = {}; - opts = opts || {}; - if (opts.id) { - const state = argsOrState as RepositoryTagProtectionState | undefined; - resourceInputs["pattern"] = state ? state.pattern : undefined; - resourceInputs["repository"] = state ? state.repository : undefined; - resourceInputs["tagProtectionId"] = state ? state.tagProtectionId : undefined; - } else { - const args = argsOrState as RepositoryTagProtectionArgs | undefined; - if ((!args || args.pattern === undefined) && !opts.urn) { - throw new Error("Missing required property 'pattern'"); - } - if ((!args || args.repository === undefined) && !opts.urn) { - throw new Error("Missing required property 'repository'"); - } - resourceInputs["pattern"] = args ? args.pattern : undefined; - resourceInputs["repository"] = args ? args.repository : undefined; - resourceInputs["tagProtectionId"] = undefined /*out*/; - } - opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); - super(RepositoryTagProtection.__pulumiType, name, resourceInputs, opts); - } -} - -/** - * Input properties used for looking up and filtering RepositoryTagProtection resources. - */ -export interface RepositoryTagProtectionState { - /** - * The pattern of the tag to protect. - */ - pattern?: pulumi.Input; - /** - * Name of the repository to add the tag protection to. - */ - repository?: pulumi.Input; - /** - * The ID of the tag protection. - */ - tagProtectionId?: pulumi.Input; -} - -/** - * The set of arguments for constructing a RepositoryTagProtection resource. - */ -export interface RepositoryTagProtectionArgs { - /** - * The pattern of the tag to protect. - */ - pattern: pulumi.Input; - /** - * Name of the repository to add the tag protection to. - */ - repository: pulumi.Input; -} diff --git a/sdk/nodejs/teamMembership.ts b/sdk/nodejs/teamMembership.ts index 79161d63..084eafaf 100644 --- a/sdk/nodejs/teamMembership.ts +++ b/sdk/nodejs/teamMembership.ts @@ -14,7 +14,7 @@ import * as utilities from "./utilities"; * * > **Note** This resource is not compatible with `github.TeamMembers`. Use either `github.TeamMembers` or `github.TeamMembership`. * - * > **Note** Organization owners may not be set as "members" of a team; they may only be set as "maintainers". Attempting to set organization an owner to "member" of a may result in a `pulumi preview` diff that changes their status back to "maintainer". + * > **Note** Organization owners may not be set as "members" of a team; they may only be set as "maintainers". Attempting to set an organization owner as a "member" of a team may result in a `pulumi preview` diff that changes their status back to "maintainer". * * ## Example Usage * diff --git a/sdk/nodejs/tsconfig.json b/sdk/nodejs/tsconfig.json index 6bbdbd1c..6a5a450b 100644 --- a/sdk/nodejs/tsconfig.json +++ b/sdk/nodejs/tsconfig.json @@ -136,7 +136,6 @@ "repositoryProject.ts", "repositoryPullRequest.ts", "repositoryRuleset.ts", - "repositoryTagProtection.ts", "repositoryTopics.ts", "repositoryWebhook.ts", "team.ts", diff --git a/sdk/nodejs/types/input.ts b/sdk/nodejs/types/input.ts index b9887323..cf100654 100644 --- a/sdk/nodejs/types/input.ts +++ b/sdk/nodejs/types/input.ts @@ -337,6 +337,10 @@ export interface OrganizationRulesetRules { * (Block List, Max: 1) Require all commits be made to a non-target branch and submitted via a pull request before they can be merged. (see below for nested schema) */ pullRequest?: pulumi.Input; + /** + * (Block List, Max: 1) Define which tools must provide code scanning results before the reference is updated. When configured, code scanning must be enabled and have results for both the commit and the reference being updated. Multiple code scanning tools can be specified. (see below for nested schema) + */ + requiredCodeScanning?: pulumi.Input; /** * (Boolean) Prevent merge commits from being pushed to matching branches. */ @@ -462,6 +466,28 @@ export interface OrganizationRulesetRulesPullRequest { requiredReviewThreadResolution?: pulumi.Input; } +export interface OrganizationRulesetRulesRequiredCodeScanning { + /** + * Tools that must provide code scanning results for this rule to pass. + */ + requiredCodeScanningTools: pulumi.Input[]>; +} + +export interface OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningTool { + /** + * The severity level at which code scanning results that raise alerts block a reference update. Can be one of: `none`, `errors`, `errorsAndWarnings`, `all`. + */ + alertsThreshold: pulumi.Input; + /** + * The severity level at which code scanning results that raise security alerts block a reference update. Can be one of: `none`, `critical`, `highOrHigher`, `mediumOrHigher`, `all`. + */ + securityAlertsThreshold: pulumi.Input; + /** + * The name of a code scanning tool. + */ + tool: pulumi.Input; +} + export interface OrganizationRulesetRulesRequiredStatusChecks { /** * Status checks that are required. Several can be defined. @@ -716,6 +742,10 @@ export interface RepositoryRulesetRules { * (Block List, Max: 1) Require all commits be made to a non-target branch and submitted via a pull request before they can be merged. (see below for nested schema) */ pullRequest?: pulumi.Input; + /** + * (Block List, Max: 1) Define which tools must provide code scanning results before the reference is updated. When configured, code scanning must be enabled and have results for both the commit and the reference being updated. Multiple code scanning tools can be specified. (see below for nested schema) + */ + requiredCodeScanning?: pulumi.Input; /** * (Block List, Max: 1) Choose which environments must be successfully deployed to before branches can be merged into a branch that matches this rule. (see below for nested schema) */ @@ -845,6 +875,28 @@ export interface RepositoryRulesetRulesPullRequest { requiredReviewThreadResolution?: pulumi.Input; } +export interface RepositoryRulesetRulesRequiredCodeScanning { + /** + * Tools that must provide code scanning results for this rule to pass. + */ + requiredCodeScanningTools: pulumi.Input[]>; +} + +export interface RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningTool { + /** + * The severity level at which code scanning results that raise alerts block a reference update. Can be one of: `none`, `errors`, `errorsAndWarnings`, `all`. + */ + alertsThreshold: pulumi.Input; + /** + * The severity level at which code scanning results that raise security alerts block a reference update. Can be one of: `none`, `critical`, `highOrHigher`, `mediumOrHigher`, `all`. + */ + securityAlertsThreshold: pulumi.Input; + /** + * The name of a code scanning tool + */ + tool: pulumi.Input; +} + export interface RepositoryRulesetRulesRequiredDeployments { /** * The environments that must be successfully deployed to before branches can be merged. diff --git a/sdk/nodejs/types/output.ts b/sdk/nodejs/types/output.ts index d5925436..feb6d713 100644 --- a/sdk/nodejs/types/output.ts +++ b/sdk/nodejs/types/output.ts @@ -1122,6 +1122,10 @@ export interface OrganizationRulesetRules { * (Block List, Max: 1) Require all commits be made to a non-target branch and submitted via a pull request before they can be merged. (see below for nested schema) */ pullRequest?: outputs.OrganizationRulesetRulesPullRequest; + /** + * (Block List, Max: 1) Define which tools must provide code scanning results before the reference is updated. When configured, code scanning must be enabled and have results for both the commit and the reference being updated. Multiple code scanning tools can be specified. (see below for nested schema) + */ + requiredCodeScanning?: outputs.OrganizationRulesetRulesRequiredCodeScanning; /** * (Boolean) Prevent merge commits from being pushed to matching branches. */ @@ -1247,6 +1251,28 @@ export interface OrganizationRulesetRulesPullRequest { requiredReviewThreadResolution?: boolean; } +export interface OrganizationRulesetRulesRequiredCodeScanning { + /** + * Tools that must provide code scanning results for this rule to pass. + */ + requiredCodeScanningTools: outputs.OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningTool[]; +} + +export interface OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningTool { + /** + * The severity level at which code scanning results that raise alerts block a reference update. Can be one of: `none`, `errors`, `errorsAndWarnings`, `all`. + */ + alertsThreshold: string; + /** + * The severity level at which code scanning results that raise security alerts block a reference update. Can be one of: `none`, `critical`, `highOrHigher`, `mediumOrHigher`, `all`. + */ + securityAlertsThreshold: string; + /** + * The name of a code scanning tool. + */ + tool: string; +} + export interface OrganizationRulesetRulesRequiredStatusChecks { /** * Status checks that are required. Several can be defined. @@ -1486,6 +1512,10 @@ export interface RepositoryRulesetRules { * (Block List, Max: 1) Require all commits be made to a non-target branch and submitted via a pull request before they can be merged. (see below for nested schema) */ pullRequest?: outputs.RepositoryRulesetRulesPullRequest; + /** + * (Block List, Max: 1) Define which tools must provide code scanning results before the reference is updated. When configured, code scanning must be enabled and have results for both the commit and the reference being updated. Multiple code scanning tools can be specified. (see below for nested schema) + */ + requiredCodeScanning?: outputs.RepositoryRulesetRulesRequiredCodeScanning; /** * (Block List, Max: 1) Choose which environments must be successfully deployed to before branches can be merged into a branch that matches this rule. (see below for nested schema) */ @@ -1615,6 +1645,28 @@ export interface RepositoryRulesetRulesPullRequest { requiredReviewThreadResolution?: boolean; } +export interface RepositoryRulesetRulesRequiredCodeScanning { + /** + * Tools that must provide code scanning results for this rule to pass. + */ + requiredCodeScanningTools: outputs.RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningTool[]; +} + +export interface RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningTool { + /** + * The severity level at which code scanning results that raise alerts block a reference update. Can be one of: `none`, `errors`, `errorsAndWarnings`, `all`. + */ + alertsThreshold: string; + /** + * The severity level at which code scanning results that raise security alerts block a reference update. Can be one of: `none`, `critical`, `highOrHigher`, `mediumOrHigher`, `all`. + */ + securityAlertsThreshold: string; + /** + * The name of a code scanning tool + */ + tool: string; +} + export interface RepositoryRulesetRulesRequiredDeployments { /** * The environments that must be successfully deployed to before branches can be merged. diff --git a/sdk/python/pulumi_github/__init__.py b/sdk/python/pulumi_github/__init__.py index 03b2012e..74549b2e 100644 --- a/sdk/python/pulumi_github/__init__.py +++ b/sdk/python/pulumi_github/__init__.py @@ -125,7 +125,6 @@ from .repository_project import * from .repository_pull_request import * from .repository_ruleset import * -from .repository_tag_protection import * from .repository_topics import * from .repository_webhook import * from .team import * @@ -614,14 +613,6 @@ "github:index/repositoryRuleset:RepositoryRuleset": "RepositoryRuleset" } }, - { - "pkg": "github", - "mod": "index/repositoryTagProtection", - "fqn": "pulumi_github", - "classes": { - "github:index/repositoryTagProtection:RepositoryTagProtection": "RepositoryTagProtection" - } - }, { "pkg": "github", "mod": "index/repositoryTopics", diff --git a/sdk/python/pulumi_github/_inputs.py b/sdk/python/pulumi_github/_inputs.py index 4b902f07..c825adc1 100644 --- a/sdk/python/pulumi_github/_inputs.py +++ b/sdk/python/pulumi_github/_inputs.py @@ -61,6 +61,10 @@ 'OrganizationRulesetRulesCommitterEmailPatternArgsDict', 'OrganizationRulesetRulesPullRequestArgs', 'OrganizationRulesetRulesPullRequestArgsDict', + 'OrganizationRulesetRulesRequiredCodeScanningArgs', + 'OrganizationRulesetRulesRequiredCodeScanningArgsDict', + 'OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArgs', + 'OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArgsDict', 'OrganizationRulesetRulesRequiredStatusChecksArgs', 'OrganizationRulesetRulesRequiredStatusChecksArgsDict', 'OrganizationRulesetRulesRequiredStatusChecksRequiredCheckArgs', @@ -105,6 +109,10 @@ 'RepositoryRulesetRulesCommitterEmailPatternArgsDict', 'RepositoryRulesetRulesPullRequestArgs', 'RepositoryRulesetRulesPullRequestArgsDict', + 'RepositoryRulesetRulesRequiredCodeScanningArgs', + 'RepositoryRulesetRulesRequiredCodeScanningArgsDict', + 'RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArgs', + 'RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArgsDict', 'RepositoryRulesetRulesRequiredDeploymentsArgs', 'RepositoryRulesetRulesRequiredDeploymentsArgsDict', 'RepositoryRulesetRulesRequiredStatusChecksArgs', @@ -1542,6 +1550,10 @@ class OrganizationRulesetRulesArgsDict(TypedDict): """ (Block List, Max: 1) Require all commits be made to a non-target branch and submitted via a pull request before they can be merged. (see below for nested schema) """ + required_code_scanning: NotRequired[pulumi.Input['OrganizationRulesetRulesRequiredCodeScanningArgsDict']] + """ + (Block List, Max: 1) Define which tools must provide code scanning results before the reference is updated. When configured, code scanning must be enabled and have results for both the commit and the reference being updated. Multiple code scanning tools can be specified. (see below for nested schema) + """ required_linear_history: NotRequired[pulumi.Input[bool]] """ (Boolean) Prevent merge commits from being pushed to matching branches. @@ -1580,6 +1592,7 @@ def __init__(__self__, *, deletion: Optional[pulumi.Input[bool]] = None, non_fast_forward: Optional[pulumi.Input[bool]] = None, pull_request: Optional[pulumi.Input['OrganizationRulesetRulesPullRequestArgs']] = None, + required_code_scanning: Optional[pulumi.Input['OrganizationRulesetRulesRequiredCodeScanningArgs']] = None, required_linear_history: Optional[pulumi.Input[bool]] = None, required_signatures: Optional[pulumi.Input[bool]] = None, required_status_checks: Optional[pulumi.Input['OrganizationRulesetRulesRequiredStatusChecksArgs']] = None, @@ -1595,6 +1608,7 @@ def __init__(__self__, *, :param pulumi.Input[bool] deletion: (Boolean) Only allow users with bypass permissions to delete matching refs. :param pulumi.Input[bool] non_fast_forward: (Boolean) Prevent users with push access from force pushing to branches. :param pulumi.Input['OrganizationRulesetRulesPullRequestArgs'] pull_request: (Block List, Max: 1) Require all commits be made to a non-target branch and submitted via a pull request before they can be merged. (see below for nested schema) + :param pulumi.Input['OrganizationRulesetRulesRequiredCodeScanningArgs'] required_code_scanning: (Block List, Max: 1) Define which tools must provide code scanning results before the reference is updated. When configured, code scanning must be enabled and have results for both the commit and the reference being updated. Multiple code scanning tools can be specified. (see below for nested schema) :param pulumi.Input[bool] required_linear_history: (Boolean) Prevent merge commits from being pushed to matching branches. :param pulumi.Input[bool] required_signatures: (Boolean) Commits pushed to matching branches must have verified signatures. :param pulumi.Input['OrganizationRulesetRulesRequiredStatusChecksArgs'] required_status_checks: (Block List, Max: 1) Choose which status checks must pass before branches can be merged into a branch that matches this rule. When enabled, commits must first be pushed to another branch, then merged or pushed directly to a branch that matches this rule after status checks have passed. (see below for nested schema) @@ -1618,6 +1632,8 @@ def __init__(__self__, *, pulumi.set(__self__, "non_fast_forward", non_fast_forward) if pull_request is not None: pulumi.set(__self__, "pull_request", pull_request) + if required_code_scanning is not None: + pulumi.set(__self__, "required_code_scanning", required_code_scanning) if required_linear_history is not None: pulumi.set(__self__, "required_linear_history", required_linear_history) if required_signatures is not None: @@ -1727,6 +1743,18 @@ def pull_request(self) -> Optional[pulumi.Input['OrganizationRulesetRulesPullReq def pull_request(self, value: Optional[pulumi.Input['OrganizationRulesetRulesPullRequestArgs']]): pulumi.set(self, "pull_request", value) + @property + @pulumi.getter(name="requiredCodeScanning") + def required_code_scanning(self) -> Optional[pulumi.Input['OrganizationRulesetRulesRequiredCodeScanningArgs']]: + """ + (Block List, Max: 1) Define which tools must provide code scanning results before the reference is updated. When configured, code scanning must be enabled and have results for both the commit and the reference being updated. Multiple code scanning tools can be specified. (see below for nested schema) + """ + return pulumi.get(self, "required_code_scanning") + + @required_code_scanning.setter + def required_code_scanning(self, value: Optional[pulumi.Input['OrganizationRulesetRulesRequiredCodeScanningArgs']]): + pulumi.set(self, "required_code_scanning", value) + @property @pulumi.getter(name="requiredLinearHistory") def required_linear_history(self) -> Optional[pulumi.Input[bool]]: @@ -2272,6 +2300,106 @@ def required_review_thread_resolution(self, value: Optional[pulumi.Input[bool]]) pulumi.set(self, "required_review_thread_resolution", value) +if not MYPY: + class OrganizationRulesetRulesRequiredCodeScanningArgsDict(TypedDict): + required_code_scanning_tools: pulumi.Input[Sequence[pulumi.Input['OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArgsDict']]] + """ + Tools that must provide code scanning results for this rule to pass. + """ +elif False: + OrganizationRulesetRulesRequiredCodeScanningArgsDict: TypeAlias = Mapping[str, Any] + +@pulumi.input_type +class OrganizationRulesetRulesRequiredCodeScanningArgs: + def __init__(__self__, *, + required_code_scanning_tools: pulumi.Input[Sequence[pulumi.Input['OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArgs']]]): + """ + :param pulumi.Input[Sequence[pulumi.Input['OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArgs']]] required_code_scanning_tools: Tools that must provide code scanning results for this rule to pass. + """ + pulumi.set(__self__, "required_code_scanning_tools", required_code_scanning_tools) + + @property + @pulumi.getter(name="requiredCodeScanningTools") + def required_code_scanning_tools(self) -> pulumi.Input[Sequence[pulumi.Input['OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArgs']]]: + """ + Tools that must provide code scanning results for this rule to pass. + """ + return pulumi.get(self, "required_code_scanning_tools") + + @required_code_scanning_tools.setter + def required_code_scanning_tools(self, value: pulumi.Input[Sequence[pulumi.Input['OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArgs']]]): + pulumi.set(self, "required_code_scanning_tools", value) + + +if not MYPY: + class OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArgsDict(TypedDict): + alerts_threshold: pulumi.Input[str] + """ + The severity level at which code scanning results that raise alerts block a reference update. Can be one of: `none`, `errors`, `errors_and_warnings`, `all`. + """ + security_alerts_threshold: pulumi.Input[str] + """ + The severity level at which code scanning results that raise security alerts block a reference update. Can be one of: `none`, `critical`, `high_or_higher`, `medium_or_higher`, `all`. + """ + tool: pulumi.Input[str] + """ + The name of a code scanning tool. + """ +elif False: + OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArgsDict: TypeAlias = Mapping[str, Any] + +@pulumi.input_type +class OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArgs: + def __init__(__self__, *, + alerts_threshold: pulumi.Input[str], + security_alerts_threshold: pulumi.Input[str], + tool: pulumi.Input[str]): + """ + :param pulumi.Input[str] alerts_threshold: The severity level at which code scanning results that raise alerts block a reference update. Can be one of: `none`, `errors`, `errors_and_warnings`, `all`. + :param pulumi.Input[str] security_alerts_threshold: The severity level at which code scanning results that raise security alerts block a reference update. Can be one of: `none`, `critical`, `high_or_higher`, `medium_or_higher`, `all`. + :param pulumi.Input[str] tool: The name of a code scanning tool. + """ + pulumi.set(__self__, "alerts_threshold", alerts_threshold) + pulumi.set(__self__, "security_alerts_threshold", security_alerts_threshold) + pulumi.set(__self__, "tool", tool) + + @property + @pulumi.getter(name="alertsThreshold") + def alerts_threshold(self) -> pulumi.Input[str]: + """ + The severity level at which code scanning results that raise alerts block a reference update. Can be one of: `none`, `errors`, `errors_and_warnings`, `all`. + """ + return pulumi.get(self, "alerts_threshold") + + @alerts_threshold.setter + def alerts_threshold(self, value: pulumi.Input[str]): + pulumi.set(self, "alerts_threshold", value) + + @property + @pulumi.getter(name="securityAlertsThreshold") + def security_alerts_threshold(self) -> pulumi.Input[str]: + """ + The severity level at which code scanning results that raise security alerts block a reference update. Can be one of: `none`, `critical`, `high_or_higher`, `medium_or_higher`, `all`. + """ + return pulumi.get(self, "security_alerts_threshold") + + @security_alerts_threshold.setter + def security_alerts_threshold(self, value: pulumi.Input[str]): + pulumi.set(self, "security_alerts_threshold", value) + + @property + @pulumi.getter + def tool(self) -> pulumi.Input[str]: + """ + The name of a code scanning tool. + """ + return pulumi.get(self, "tool") + + @tool.setter + def tool(self, value: pulumi.Input[str]): + pulumi.set(self, "tool", value) + + if not MYPY: class OrganizationRulesetRulesRequiredStatusChecksArgsDict(TypedDict): required_checks: pulumi.Input[Sequence[pulumi.Input['OrganizationRulesetRulesRequiredStatusChecksRequiredCheckArgsDict']]] @@ -3333,6 +3461,10 @@ class RepositoryRulesetRulesArgsDict(TypedDict): """ (Block List, Max: 1) Require all commits be made to a non-target branch and submitted via a pull request before they can be merged. (see below for nested schema) """ + required_code_scanning: NotRequired[pulumi.Input['RepositoryRulesetRulesRequiredCodeScanningArgsDict']] + """ + (Block List, Max: 1) Define which tools must provide code scanning results before the reference is updated. When configured, code scanning must be enabled and have results for both the commit and the reference being updated. Multiple code scanning tools can be specified. (see below for nested schema) + """ required_deployments: NotRequired[pulumi.Input['RepositoryRulesetRulesRequiredDeploymentsArgsDict']] """ (Block List, Max: 1) Choose which environments must be successfully deployed to before branches can be merged into a branch that matches this rule. (see below for nested schema) @@ -3375,6 +3507,7 @@ def __init__(__self__, *, deletion: Optional[pulumi.Input[bool]] = None, non_fast_forward: Optional[pulumi.Input[bool]] = None, pull_request: Optional[pulumi.Input['RepositoryRulesetRulesPullRequestArgs']] = None, + required_code_scanning: Optional[pulumi.Input['RepositoryRulesetRulesRequiredCodeScanningArgs']] = None, required_deployments: Optional[pulumi.Input['RepositoryRulesetRulesRequiredDeploymentsArgs']] = None, required_linear_history: Optional[pulumi.Input[bool]] = None, required_signatures: Optional[pulumi.Input[bool]] = None, @@ -3391,6 +3524,7 @@ def __init__(__self__, *, :param pulumi.Input[bool] deletion: (Boolean) Only allow users with bypass permissions to delete matching refs. :param pulumi.Input[bool] non_fast_forward: (Boolean) Prevent users with push access from force pushing to branches. :param pulumi.Input['RepositoryRulesetRulesPullRequestArgs'] pull_request: (Block List, Max: 1) Require all commits be made to a non-target branch and submitted via a pull request before they can be merged. (see below for nested schema) + :param pulumi.Input['RepositoryRulesetRulesRequiredCodeScanningArgs'] required_code_scanning: (Block List, Max: 1) Define which tools must provide code scanning results before the reference is updated. When configured, code scanning must be enabled and have results for both the commit and the reference being updated. Multiple code scanning tools can be specified. (see below for nested schema) :param pulumi.Input['RepositoryRulesetRulesRequiredDeploymentsArgs'] required_deployments: (Block List, Max: 1) Choose which environments must be successfully deployed to before branches can be merged into a branch that matches this rule. (see below for nested schema) :param pulumi.Input[bool] required_linear_history: (Boolean) Prevent merge commits from being pushed to matching branches. :param pulumi.Input[bool] required_signatures: (Boolean) Commits pushed to matching branches must have verified signatures. @@ -3415,6 +3549,8 @@ def __init__(__self__, *, pulumi.set(__self__, "non_fast_forward", non_fast_forward) if pull_request is not None: pulumi.set(__self__, "pull_request", pull_request) + if required_code_scanning is not None: + pulumi.set(__self__, "required_code_scanning", required_code_scanning) if required_deployments is not None: pulumi.set(__self__, "required_deployments", required_deployments) if required_linear_history is not None: @@ -3526,6 +3662,18 @@ def pull_request(self) -> Optional[pulumi.Input['RepositoryRulesetRulesPullReque def pull_request(self, value: Optional[pulumi.Input['RepositoryRulesetRulesPullRequestArgs']]): pulumi.set(self, "pull_request", value) + @property + @pulumi.getter(name="requiredCodeScanning") + def required_code_scanning(self) -> Optional[pulumi.Input['RepositoryRulesetRulesRequiredCodeScanningArgs']]: + """ + (Block List, Max: 1) Define which tools must provide code scanning results before the reference is updated. When configured, code scanning must be enabled and have results for both the commit and the reference being updated. Multiple code scanning tools can be specified. (see below for nested schema) + """ + return pulumi.get(self, "required_code_scanning") + + @required_code_scanning.setter + def required_code_scanning(self, value: Optional[pulumi.Input['RepositoryRulesetRulesRequiredCodeScanningArgs']]): + pulumi.set(self, "required_code_scanning", value) + @property @pulumi.getter(name="requiredDeployments") def required_deployments(self) -> Optional[pulumi.Input['RepositoryRulesetRulesRequiredDeploymentsArgs']]: @@ -4083,6 +4231,106 @@ def required_review_thread_resolution(self, value: Optional[pulumi.Input[bool]]) pulumi.set(self, "required_review_thread_resolution", value) +if not MYPY: + class RepositoryRulesetRulesRequiredCodeScanningArgsDict(TypedDict): + required_code_scanning_tools: pulumi.Input[Sequence[pulumi.Input['RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArgsDict']]] + """ + Tools that must provide code scanning results for this rule to pass. + """ +elif False: + RepositoryRulesetRulesRequiredCodeScanningArgsDict: TypeAlias = Mapping[str, Any] + +@pulumi.input_type +class RepositoryRulesetRulesRequiredCodeScanningArgs: + def __init__(__self__, *, + required_code_scanning_tools: pulumi.Input[Sequence[pulumi.Input['RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArgs']]]): + """ + :param pulumi.Input[Sequence[pulumi.Input['RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArgs']]] required_code_scanning_tools: Tools that must provide code scanning results for this rule to pass. + """ + pulumi.set(__self__, "required_code_scanning_tools", required_code_scanning_tools) + + @property + @pulumi.getter(name="requiredCodeScanningTools") + def required_code_scanning_tools(self) -> pulumi.Input[Sequence[pulumi.Input['RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArgs']]]: + """ + Tools that must provide code scanning results for this rule to pass. + """ + return pulumi.get(self, "required_code_scanning_tools") + + @required_code_scanning_tools.setter + def required_code_scanning_tools(self, value: pulumi.Input[Sequence[pulumi.Input['RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArgs']]]): + pulumi.set(self, "required_code_scanning_tools", value) + + +if not MYPY: + class RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArgsDict(TypedDict): + alerts_threshold: pulumi.Input[str] + """ + The severity level at which code scanning results that raise alerts block a reference update. Can be one of: `none`, `errors`, `errors_and_warnings`, `all`. + """ + security_alerts_threshold: pulumi.Input[str] + """ + The severity level at which code scanning results that raise security alerts block a reference update. Can be one of: `none`, `critical`, `high_or_higher`, `medium_or_higher`, `all`. + """ + tool: pulumi.Input[str] + """ + The name of a code scanning tool + """ +elif False: + RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArgsDict: TypeAlias = Mapping[str, Any] + +@pulumi.input_type +class RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArgs: + def __init__(__self__, *, + alerts_threshold: pulumi.Input[str], + security_alerts_threshold: pulumi.Input[str], + tool: pulumi.Input[str]): + """ + :param pulumi.Input[str] alerts_threshold: The severity level at which code scanning results that raise alerts block a reference update. Can be one of: `none`, `errors`, `errors_and_warnings`, `all`. + :param pulumi.Input[str] security_alerts_threshold: The severity level at which code scanning results that raise security alerts block a reference update. Can be one of: `none`, `critical`, `high_or_higher`, `medium_or_higher`, `all`. + :param pulumi.Input[str] tool: The name of a code scanning tool + """ + pulumi.set(__self__, "alerts_threshold", alerts_threshold) + pulumi.set(__self__, "security_alerts_threshold", security_alerts_threshold) + pulumi.set(__self__, "tool", tool) + + @property + @pulumi.getter(name="alertsThreshold") + def alerts_threshold(self) -> pulumi.Input[str]: + """ + The severity level at which code scanning results that raise alerts block a reference update. Can be one of: `none`, `errors`, `errors_and_warnings`, `all`. + """ + return pulumi.get(self, "alerts_threshold") + + @alerts_threshold.setter + def alerts_threshold(self, value: pulumi.Input[str]): + pulumi.set(self, "alerts_threshold", value) + + @property + @pulumi.getter(name="securityAlertsThreshold") + def security_alerts_threshold(self) -> pulumi.Input[str]: + """ + The severity level at which code scanning results that raise security alerts block a reference update. Can be one of: `none`, `critical`, `high_or_higher`, `medium_or_higher`, `all`. + """ + return pulumi.get(self, "security_alerts_threshold") + + @security_alerts_threshold.setter + def security_alerts_threshold(self, value: pulumi.Input[str]): + pulumi.set(self, "security_alerts_threshold", value) + + @property + @pulumi.getter + def tool(self) -> pulumi.Input[str]: + """ + The name of a code scanning tool + """ + return pulumi.get(self, "tool") + + @tool.setter + def tool(self, value: pulumi.Input[str]): + pulumi.set(self, "tool", value) + + if not MYPY: class RepositoryRulesetRulesRequiredDeploymentsArgsDict(TypedDict): required_deployment_environments: pulumi.Input[Sequence[pulumi.Input[str]]] diff --git a/sdk/python/pulumi_github/outputs.py b/sdk/python/pulumi_github/outputs.py index 73417236..0347ed19 100644 --- a/sdk/python/pulumi_github/outputs.py +++ b/sdk/python/pulumi_github/outputs.py @@ -39,6 +39,8 @@ 'OrganizationRulesetRulesCommitMessagePattern', 'OrganizationRulesetRulesCommitterEmailPattern', 'OrganizationRulesetRulesPullRequest', + 'OrganizationRulesetRulesRequiredCodeScanning', + 'OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningTool', 'OrganizationRulesetRulesRequiredStatusChecks', 'OrganizationRulesetRulesRequiredStatusChecksRequiredCheck', 'OrganizationRulesetRulesRequiredWorkflows', @@ -60,6 +62,8 @@ 'RepositoryRulesetRulesCommitMessagePattern', 'RepositoryRulesetRulesCommitterEmailPattern', 'RepositoryRulesetRulesPullRequest', + 'RepositoryRulesetRulesRequiredCodeScanning', + 'RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningTool', 'RepositoryRulesetRulesRequiredDeployments', 'RepositoryRulesetRulesRequiredStatusChecks', 'RepositoryRulesetRulesRequiredStatusChecksRequiredCheck', @@ -1180,6 +1184,8 @@ def __key_warning(key: str): suggest = "non_fast_forward" elif key == "pullRequest": suggest = "pull_request" + elif key == "requiredCodeScanning": + suggest = "required_code_scanning" elif key == "requiredLinearHistory": suggest = "required_linear_history" elif key == "requiredSignatures": @@ -1211,6 +1217,7 @@ def __init__(__self__, *, deletion: Optional[bool] = None, non_fast_forward: Optional[bool] = None, pull_request: Optional['outputs.OrganizationRulesetRulesPullRequest'] = None, + required_code_scanning: Optional['outputs.OrganizationRulesetRulesRequiredCodeScanning'] = None, required_linear_history: Optional[bool] = None, required_signatures: Optional[bool] = None, required_status_checks: Optional['outputs.OrganizationRulesetRulesRequiredStatusChecks'] = None, @@ -1226,6 +1233,7 @@ def __init__(__self__, *, :param bool deletion: (Boolean) Only allow users with bypass permissions to delete matching refs. :param bool non_fast_forward: (Boolean) Prevent users with push access from force pushing to branches. :param 'OrganizationRulesetRulesPullRequestArgs' pull_request: (Block List, Max: 1) Require all commits be made to a non-target branch and submitted via a pull request before they can be merged. (see below for nested schema) + :param 'OrganizationRulesetRulesRequiredCodeScanningArgs' required_code_scanning: (Block List, Max: 1) Define which tools must provide code scanning results before the reference is updated. When configured, code scanning must be enabled and have results for both the commit and the reference being updated. Multiple code scanning tools can be specified. (see below for nested schema) :param bool required_linear_history: (Boolean) Prevent merge commits from being pushed to matching branches. :param bool required_signatures: (Boolean) Commits pushed to matching branches must have verified signatures. :param 'OrganizationRulesetRulesRequiredStatusChecksArgs' required_status_checks: (Block List, Max: 1) Choose which status checks must pass before branches can be merged into a branch that matches this rule. When enabled, commits must first be pushed to another branch, then merged or pushed directly to a branch that matches this rule after status checks have passed. (see below for nested schema) @@ -1249,6 +1257,8 @@ def __init__(__self__, *, pulumi.set(__self__, "non_fast_forward", non_fast_forward) if pull_request is not None: pulumi.set(__self__, "pull_request", pull_request) + if required_code_scanning is not None: + pulumi.set(__self__, "required_code_scanning", required_code_scanning) if required_linear_history is not None: pulumi.set(__self__, "required_linear_history", required_linear_history) if required_signatures is not None: @@ -1326,6 +1336,14 @@ def pull_request(self) -> Optional['outputs.OrganizationRulesetRulesPullRequest' """ return pulumi.get(self, "pull_request") + @property + @pulumi.getter(name="requiredCodeScanning") + def required_code_scanning(self) -> Optional['outputs.OrganizationRulesetRulesRequiredCodeScanning']: + """ + (Block List, Max: 1) Define which tools must provide code scanning results before the reference is updated. When configured, code scanning must be enabled and have results for both the commit and the reference being updated. Multiple code scanning tools can be specified. (see below for nested schema) + """ + return pulumi.get(self, "required_code_scanning") + @property @pulumi.getter(name="requiredLinearHistory") def required_linear_history(self) -> Optional[bool]: @@ -1679,6 +1697,100 @@ def required_review_thread_resolution(self) -> Optional[bool]: return pulumi.get(self, "required_review_thread_resolution") +@pulumi.output_type +class OrganizationRulesetRulesRequiredCodeScanning(dict): + @staticmethod + def __key_warning(key: str): + suggest = None + if key == "requiredCodeScanningTools": + suggest = "required_code_scanning_tools" + + if suggest: + pulumi.log.warn(f"Key '{key}' not found in OrganizationRulesetRulesRequiredCodeScanning. Access the value via the '{suggest}' property getter instead.") + + def __getitem__(self, key: str) -> Any: + OrganizationRulesetRulesRequiredCodeScanning.__key_warning(key) + return super().__getitem__(key) + + def get(self, key: str, default = None) -> Any: + OrganizationRulesetRulesRequiredCodeScanning.__key_warning(key) + return super().get(key, default) + + def __init__(__self__, *, + required_code_scanning_tools: Sequence['outputs.OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningTool']): + """ + :param Sequence['OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArgs'] required_code_scanning_tools: Tools that must provide code scanning results for this rule to pass. + """ + pulumi.set(__self__, "required_code_scanning_tools", required_code_scanning_tools) + + @property + @pulumi.getter(name="requiredCodeScanningTools") + def required_code_scanning_tools(self) -> Sequence['outputs.OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningTool']: + """ + Tools that must provide code scanning results for this rule to pass. + """ + return pulumi.get(self, "required_code_scanning_tools") + + +@pulumi.output_type +class OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningTool(dict): + @staticmethod + def __key_warning(key: str): + suggest = None + if key == "alertsThreshold": + suggest = "alerts_threshold" + elif key == "securityAlertsThreshold": + suggest = "security_alerts_threshold" + + if suggest: + pulumi.log.warn(f"Key '{key}' not found in OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningTool. Access the value via the '{suggest}' property getter instead.") + + def __getitem__(self, key: str) -> Any: + OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningTool.__key_warning(key) + return super().__getitem__(key) + + def get(self, key: str, default = None) -> Any: + OrganizationRulesetRulesRequiredCodeScanningRequiredCodeScanningTool.__key_warning(key) + return super().get(key, default) + + def __init__(__self__, *, + alerts_threshold: str, + security_alerts_threshold: str, + tool: str): + """ + :param str alerts_threshold: The severity level at which code scanning results that raise alerts block a reference update. Can be one of: `none`, `errors`, `errors_and_warnings`, `all`. + :param str security_alerts_threshold: The severity level at which code scanning results that raise security alerts block a reference update. Can be one of: `none`, `critical`, `high_or_higher`, `medium_or_higher`, `all`. + :param str tool: The name of a code scanning tool. + """ + pulumi.set(__self__, "alerts_threshold", alerts_threshold) + pulumi.set(__self__, "security_alerts_threshold", security_alerts_threshold) + pulumi.set(__self__, "tool", tool) + + @property + @pulumi.getter(name="alertsThreshold") + def alerts_threshold(self) -> str: + """ + The severity level at which code scanning results that raise alerts block a reference update. Can be one of: `none`, `errors`, `errors_and_warnings`, `all`. + """ + return pulumi.get(self, "alerts_threshold") + + @property + @pulumi.getter(name="securityAlertsThreshold") + def security_alerts_threshold(self) -> str: + """ + The severity level at which code scanning results that raise security alerts block a reference update. Can be one of: `none`, `critical`, `high_or_higher`, `medium_or_higher`, `all`. + """ + return pulumi.get(self, "security_alerts_threshold") + + @property + @pulumi.getter + def tool(self) -> str: + """ + The name of a code scanning tool. + """ + return pulumi.get(self, "tool") + + @pulumi.output_type class OrganizationRulesetRulesRequiredStatusChecks(dict): @staticmethod @@ -2444,6 +2556,8 @@ def __key_warning(key: str): suggest = "non_fast_forward" elif key == "pullRequest": suggest = "pull_request" + elif key == "requiredCodeScanning": + suggest = "required_code_scanning" elif key == "requiredDeployments": suggest = "required_deployments" elif key == "requiredLinearHistory": @@ -2477,6 +2591,7 @@ def __init__(__self__, *, deletion: Optional[bool] = None, non_fast_forward: Optional[bool] = None, pull_request: Optional['outputs.RepositoryRulesetRulesPullRequest'] = None, + required_code_scanning: Optional['outputs.RepositoryRulesetRulesRequiredCodeScanning'] = None, required_deployments: Optional['outputs.RepositoryRulesetRulesRequiredDeployments'] = None, required_linear_history: Optional[bool] = None, required_signatures: Optional[bool] = None, @@ -2493,6 +2608,7 @@ def __init__(__self__, *, :param bool deletion: (Boolean) Only allow users with bypass permissions to delete matching refs. :param bool non_fast_forward: (Boolean) Prevent users with push access from force pushing to branches. :param 'RepositoryRulesetRulesPullRequestArgs' pull_request: (Block List, Max: 1) Require all commits be made to a non-target branch and submitted via a pull request before they can be merged. (see below for nested schema) + :param 'RepositoryRulesetRulesRequiredCodeScanningArgs' required_code_scanning: (Block List, Max: 1) Define which tools must provide code scanning results before the reference is updated. When configured, code scanning must be enabled and have results for both the commit and the reference being updated. Multiple code scanning tools can be specified. (see below for nested schema) :param 'RepositoryRulesetRulesRequiredDeploymentsArgs' required_deployments: (Block List, Max: 1) Choose which environments must be successfully deployed to before branches can be merged into a branch that matches this rule. (see below for nested schema) :param bool required_linear_history: (Boolean) Prevent merge commits from being pushed to matching branches. :param bool required_signatures: (Boolean) Commits pushed to matching branches must have verified signatures. @@ -2517,6 +2633,8 @@ def __init__(__self__, *, pulumi.set(__self__, "non_fast_forward", non_fast_forward) if pull_request is not None: pulumi.set(__self__, "pull_request", pull_request) + if required_code_scanning is not None: + pulumi.set(__self__, "required_code_scanning", required_code_scanning) if required_deployments is not None: pulumi.set(__self__, "required_deployments", required_deployments) if required_linear_history is not None: @@ -2596,6 +2714,14 @@ def pull_request(self) -> Optional['outputs.RepositoryRulesetRulesPullRequest']: """ return pulumi.get(self, "pull_request") + @property + @pulumi.getter(name="requiredCodeScanning") + def required_code_scanning(self) -> Optional['outputs.RepositoryRulesetRulesRequiredCodeScanning']: + """ + (Block List, Max: 1) Define which tools must provide code scanning results before the reference is updated. When configured, code scanning must be enabled and have results for both the commit and the reference being updated. Multiple code scanning tools can be specified. (see below for nested schema) + """ + return pulumi.get(self, "required_code_scanning") + @property @pulumi.getter(name="requiredDeployments") def required_deployments(self) -> Optional['outputs.RepositoryRulesetRulesRequiredDeployments']: @@ -2957,6 +3083,100 @@ def required_review_thread_resolution(self) -> Optional[bool]: return pulumi.get(self, "required_review_thread_resolution") +@pulumi.output_type +class RepositoryRulesetRulesRequiredCodeScanning(dict): + @staticmethod + def __key_warning(key: str): + suggest = None + if key == "requiredCodeScanningTools": + suggest = "required_code_scanning_tools" + + if suggest: + pulumi.log.warn(f"Key '{key}' not found in RepositoryRulesetRulesRequiredCodeScanning. Access the value via the '{suggest}' property getter instead.") + + def __getitem__(self, key: str) -> Any: + RepositoryRulesetRulesRequiredCodeScanning.__key_warning(key) + return super().__getitem__(key) + + def get(self, key: str, default = None) -> Any: + RepositoryRulesetRulesRequiredCodeScanning.__key_warning(key) + return super().get(key, default) + + def __init__(__self__, *, + required_code_scanning_tools: Sequence['outputs.RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningTool']): + """ + :param Sequence['RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningToolArgs'] required_code_scanning_tools: Tools that must provide code scanning results for this rule to pass. + """ + pulumi.set(__self__, "required_code_scanning_tools", required_code_scanning_tools) + + @property + @pulumi.getter(name="requiredCodeScanningTools") + def required_code_scanning_tools(self) -> Sequence['outputs.RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningTool']: + """ + Tools that must provide code scanning results for this rule to pass. + """ + return pulumi.get(self, "required_code_scanning_tools") + + +@pulumi.output_type +class RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningTool(dict): + @staticmethod + def __key_warning(key: str): + suggest = None + if key == "alertsThreshold": + suggest = "alerts_threshold" + elif key == "securityAlertsThreshold": + suggest = "security_alerts_threshold" + + if suggest: + pulumi.log.warn(f"Key '{key}' not found in RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningTool. Access the value via the '{suggest}' property getter instead.") + + def __getitem__(self, key: str) -> Any: + RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningTool.__key_warning(key) + return super().__getitem__(key) + + def get(self, key: str, default = None) -> Any: + RepositoryRulesetRulesRequiredCodeScanningRequiredCodeScanningTool.__key_warning(key) + return super().get(key, default) + + def __init__(__self__, *, + alerts_threshold: str, + security_alerts_threshold: str, + tool: str): + """ + :param str alerts_threshold: The severity level at which code scanning results that raise alerts block a reference update. Can be one of: `none`, `errors`, `errors_and_warnings`, `all`. + :param str security_alerts_threshold: The severity level at which code scanning results that raise security alerts block a reference update. Can be one of: `none`, `critical`, `high_or_higher`, `medium_or_higher`, `all`. + :param str tool: The name of a code scanning tool + """ + pulumi.set(__self__, "alerts_threshold", alerts_threshold) + pulumi.set(__self__, "security_alerts_threshold", security_alerts_threshold) + pulumi.set(__self__, "tool", tool) + + @property + @pulumi.getter(name="alertsThreshold") + def alerts_threshold(self) -> str: + """ + The severity level at which code scanning results that raise alerts block a reference update. Can be one of: `none`, `errors`, `errors_and_warnings`, `all`. + """ + return pulumi.get(self, "alerts_threshold") + + @property + @pulumi.getter(name="securityAlertsThreshold") + def security_alerts_threshold(self) -> str: + """ + The severity level at which code scanning results that raise security alerts block a reference update. Can be one of: `none`, `critical`, `high_or_higher`, `medium_or_higher`, `all`. + """ + return pulumi.get(self, "security_alerts_threshold") + + @property + @pulumi.getter + def tool(self) -> str: + """ + The name of a code scanning tool + """ + return pulumi.get(self, "tool") + + @pulumi.output_type class RepositoryRulesetRulesRequiredDeployments(dict): @staticmethod diff --git a/sdk/python/pulumi_github/repository_environment_deployment_policy.py b/sdk/python/pulumi_github/repository_environment_deployment_policy.py index 12d70a38..c468a379 100644 --- a/sdk/python/pulumi_github/repository_environment_deployment_policy.py +++ b/sdk/python/pulumi_github/repository_environment_deployment_policy.py @@ -19,30 +19,23 @@ @pulumi.input_type class RepositoryEnvironmentDeploymentPolicyArgs: def __init__(__self__, *, - branch_pattern: pulumi.Input[str], environment: pulumi.Input[str], - repository: pulumi.Input[str]): + repository: pulumi.Input[str], + branch_pattern: Optional[pulumi.Input[str]] = None, + tag_pattern: Optional[pulumi.Input[str]] = None): """ The set of arguments for constructing a RepositoryEnvironmentDeploymentPolicy resource. - :param pulumi.Input[str] branch_pattern: The name pattern that branches must match in order to deploy to the environment. :param pulumi.Input[str] environment: The name of the environment. :param pulumi.Input[str] repository: The repository of the environment. + :param pulumi.Input[str] branch_pattern: The name pattern that branches must match in order to deploy to the environment. If not specified, `tag_pattern` must be specified. + :param pulumi.Input[str] tag_pattern: The name pattern that tags must match in order to deploy to the environment. If not specified, `branch_pattern` must be specified. """ - pulumi.set(__self__, "branch_pattern", branch_pattern) pulumi.set(__self__, "environment", environment) pulumi.set(__self__, "repository", repository) - - @property - @pulumi.getter(name="branchPattern") - def branch_pattern(self) -> pulumi.Input[str]: - """ - The name pattern that branches must match in order to deploy to the environment. - """ - return pulumi.get(self, "branch_pattern") - - @branch_pattern.setter - def branch_pattern(self, value: pulumi.Input[str]): - pulumi.set(self, "branch_pattern", value) + if branch_pattern is not None: + pulumi.set(__self__, "branch_pattern", branch_pattern) + if tag_pattern is not None: + pulumi.set(__self__, "tag_pattern", tag_pattern) @property @pulumi.getter @@ -68,18 +61,44 @@ def repository(self) -> pulumi.Input[str]: def repository(self, value: pulumi.Input[str]): pulumi.set(self, "repository", value) + @property + @pulumi.getter(name="branchPattern") + def branch_pattern(self) -> Optional[pulumi.Input[str]]: + """ + The name pattern that branches must match in order to deploy to the environment. If not specified, `tag_pattern` must be specified. + """ + return pulumi.get(self, "branch_pattern") + + @branch_pattern.setter + def branch_pattern(self, value: Optional[pulumi.Input[str]]): + pulumi.set(self, "branch_pattern", value) + + @property + @pulumi.getter(name="tagPattern") + def tag_pattern(self) -> Optional[pulumi.Input[str]]: + """ + The name pattern that tags must match in order to deploy to the environment. If not specified, `branch_pattern` must be specified. + """ + return pulumi.get(self, "tag_pattern") + + @tag_pattern.setter + def tag_pattern(self, value: Optional[pulumi.Input[str]]): + pulumi.set(self, "tag_pattern", value) + @pulumi.input_type class _RepositoryEnvironmentDeploymentPolicyState: def __init__(__self__, *, branch_pattern: Optional[pulumi.Input[str]] = None, environment: Optional[pulumi.Input[str]] = None, - repository: Optional[pulumi.Input[str]] = None): + repository: Optional[pulumi.Input[str]] = None, + tag_pattern: Optional[pulumi.Input[str]] = None): """ Input properties used for looking up and filtering RepositoryEnvironmentDeploymentPolicy resources. - :param pulumi.Input[str] branch_pattern: The name pattern that branches must match in order to deploy to the environment. + :param pulumi.Input[str] branch_pattern: The name pattern that branches must match in order to deploy to the environment. If not specified, `tag_pattern` must be specified. :param pulumi.Input[str] environment: The name of the environment. :param pulumi.Input[str] repository: The repository of the environment. + :param pulumi.Input[str] tag_pattern: The name pattern that tags must match in order to deploy to the environment. If not specified, `branch_pattern` must be specified. """ if branch_pattern is not None: pulumi.set(__self__, "branch_pattern", branch_pattern) @@ -87,12 +106,14 @@ def __init__(__self__, *, pulumi.set(__self__, "environment", environment) if repository is not None: pulumi.set(__self__, "repository", repository) + if tag_pattern is not None: + pulumi.set(__self__, "tag_pattern", tag_pattern) @property @pulumi.getter(name="branchPattern") def branch_pattern(self) -> Optional[pulumi.Input[str]]: """ - The name pattern that branches must match in order to deploy to the environment. + The name pattern that branches must match in order to deploy to the environment. If not specified, `tag_pattern` must be specified. """ return pulumi.get(self, "branch_pattern") @@ -124,6 +145,18 @@ def repository(self) -> Optional[pulumi.Input[str]]: def repository(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "repository", value) + @property + @pulumi.getter(name="tagPattern") + def tag_pattern(self) -> Optional[pulumi.Input[str]]: + """ + The name pattern that tags must match in order to deploy to the environment. If not specified, `branch_pattern` must be specified. + """ + return pulumi.get(self, "tag_pattern") + + @tag_pattern.setter + def tag_pattern(self, value: Optional[pulumi.Input[str]]): + pulumi.set(self, "tag_pattern", value) + class RepositoryEnvironmentDeploymentPolicy(pulumi.CustomResource): @overload @@ -133,12 +166,15 @@ def __init__(__self__, branch_pattern: Optional[pulumi.Input[str]] = None, environment: Optional[pulumi.Input[str]] = None, repository: Optional[pulumi.Input[str]] = None, + tag_pattern: Optional[pulumi.Input[str]] = None, __props__=None): """ This resource allows you to create and manage environment deployment branch policies for a GitHub repository. ## Example Usage + Create a branch-based deployment policy: + ```python import pulumi import pulumi_github as github @@ -162,6 +198,31 @@ def __init__(__self__, branch_pattern="releases/*") ``` + Create a tag-based deployment policy: + + ```python + import pulumi + import pulumi_github as github + + current = github.get_user(username="") + test = github.Repository("test", name="tf-acc-test-%s") + test_repository_environment = github.RepositoryEnvironment("test", + repository=test.name, + environment="environment/test", + wait_timer=10000, + reviewers=[{ + "users": [current.id], + }], + deployment_branch_policy={ + "protected_branches": False, + "custom_branch_policies": True, + }) + test_repository_environment_deployment_policy = github.RepositoryEnvironmentDeploymentPolicy("test", + repository=test.name, + environment=test_repository_environment.environment, + tag_pattern="v*") + ``` + ## Import GitHub Repository Environment Deployment Policy can be imported using an ID made up of `name` of the repository combined with the `environment` name of the environment with the `Id` of the deployment policy, separated by a `:` character, e.g. @@ -172,9 +233,10 @@ def __init__(__self__, :param str resource_name: The name of the resource. :param pulumi.ResourceOptions opts: Options for the resource. - :param pulumi.Input[str] branch_pattern: The name pattern that branches must match in order to deploy to the environment. + :param pulumi.Input[str] branch_pattern: The name pattern that branches must match in order to deploy to the environment. If not specified, `tag_pattern` must be specified. :param pulumi.Input[str] environment: The name of the environment. :param pulumi.Input[str] repository: The repository of the environment. + :param pulumi.Input[str] tag_pattern: The name pattern that tags must match in order to deploy to the environment. If not specified, `branch_pattern` must be specified. """ ... @overload @@ -187,6 +249,8 @@ def __init__(__self__, ## Example Usage + Create a branch-based deployment policy: + ```python import pulumi import pulumi_github as github @@ -210,6 +274,31 @@ def __init__(__self__, branch_pattern="releases/*") ``` + Create a tag-based deployment policy: + + ```python + import pulumi + import pulumi_github as github + + current = github.get_user(username="") + test = github.Repository("test", name="tf-acc-test-%s") + test_repository_environment = github.RepositoryEnvironment("test", + repository=test.name, + environment="environment/test", + wait_timer=10000, + reviewers=[{ + "users": [current.id], + }], + deployment_branch_policy={ + "protected_branches": False, + "custom_branch_policies": True, + }) + test_repository_environment_deployment_policy = github.RepositoryEnvironmentDeploymentPolicy("test", + repository=test.name, + environment=test_repository_environment.environment, + tag_pattern="v*") + ``` + ## Import GitHub Repository Environment Deployment Policy can be imported using an ID made up of `name` of the repository combined with the `environment` name of the environment with the `Id` of the deployment policy, separated by a `:` character, e.g. @@ -236,6 +325,7 @@ def _internal_init(__self__, branch_pattern: Optional[pulumi.Input[str]] = None, environment: Optional[pulumi.Input[str]] = None, repository: Optional[pulumi.Input[str]] = None, + tag_pattern: Optional[pulumi.Input[str]] = None, __props__=None): opts = pulumi.ResourceOptions.merge(_utilities.get_resource_opts_defaults(), opts) if not isinstance(opts, pulumi.ResourceOptions): @@ -245,8 +335,6 @@ def _internal_init(__self__, raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource') __props__ = RepositoryEnvironmentDeploymentPolicyArgs.__new__(RepositoryEnvironmentDeploymentPolicyArgs) - if branch_pattern is None and not opts.urn: - raise TypeError("Missing required property 'branch_pattern'") __props__.__dict__["branch_pattern"] = branch_pattern if environment is None and not opts.urn: raise TypeError("Missing required property 'environment'") @@ -254,6 +342,7 @@ def _internal_init(__self__, if repository is None and not opts.urn: raise TypeError("Missing required property 'repository'") __props__.__dict__["repository"] = repository + __props__.__dict__["tag_pattern"] = tag_pattern super(RepositoryEnvironmentDeploymentPolicy, __self__).__init__( 'github:index/repositoryEnvironmentDeploymentPolicy:RepositoryEnvironmentDeploymentPolicy', resource_name, @@ -266,7 +355,8 @@ def get(resource_name: str, opts: Optional[pulumi.ResourceOptions] = None, branch_pattern: Optional[pulumi.Input[str]] = None, environment: Optional[pulumi.Input[str]] = None, - repository: Optional[pulumi.Input[str]] = None) -> 'RepositoryEnvironmentDeploymentPolicy': + repository: Optional[pulumi.Input[str]] = None, + tag_pattern: Optional[pulumi.Input[str]] = None) -> 'RepositoryEnvironmentDeploymentPolicy': """ Get an existing RepositoryEnvironmentDeploymentPolicy resource's state with the given name, id, and optional extra properties used to qualify the lookup. @@ -274,9 +364,10 @@ 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_pattern: The name pattern that branches must match in order to deploy to the environment. + :param pulumi.Input[str] branch_pattern: The name pattern that branches must match in order to deploy to the environment. If not specified, `tag_pattern` must be specified. :param pulumi.Input[str] environment: The name of the environment. :param pulumi.Input[str] repository: The repository of the environment. + :param pulumi.Input[str] tag_pattern: The name pattern that tags must match in order to deploy to the environment. If not specified, `branch_pattern` must be specified. """ opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id)) @@ -285,13 +376,14 @@ def get(resource_name: str, __props__.__dict__["branch_pattern"] = branch_pattern __props__.__dict__["environment"] = environment __props__.__dict__["repository"] = repository + __props__.__dict__["tag_pattern"] = tag_pattern return RepositoryEnvironmentDeploymentPolicy(resource_name, opts=opts, __props__=__props__) @property @pulumi.getter(name="branchPattern") - def branch_pattern(self) -> pulumi.Output[str]: + def branch_pattern(self) -> pulumi.Output[Optional[str]]: """ - The name pattern that branches must match in order to deploy to the environment. + The name pattern that branches must match in order to deploy to the environment. If not specified, `tag_pattern` must be specified. """ return pulumi.get(self, "branch_pattern") @@ -311,3 +403,11 @@ def repository(self) -> pulumi.Output[str]: """ return pulumi.get(self, "repository") + @property + @pulumi.getter(name="tagPattern") + def tag_pattern(self) -> pulumi.Output[Optional[str]]: + """ + The name pattern that tags must match in order to deploy to the environment. If not specified, `branch_pattern` must be specified. + """ + return pulumi.get(self, "tag_pattern") + diff --git a/sdk/python/pulumi_github/repository_tag_protection.py b/sdk/python/pulumi_github/repository_tag_protection.py deleted file mode 100644 index d2760085..00000000 --- a/sdk/python/pulumi_github/repository_tag_protection.py +++ /dev/null @@ -1,271 +0,0 @@ -# coding=utf-8 -# *** 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! *** - -import copy -import warnings -import sys -import pulumi -import pulumi.runtime -from typing import Any, Mapping, Optional, Sequence, Union, overload -if sys.version_info >= (3, 11): - from typing import NotRequired, TypedDict, TypeAlias -else: - from typing_extensions import NotRequired, TypedDict, TypeAlias -from . import _utilities - -__all__ = ['RepositoryTagProtectionArgs', 'RepositoryTagProtection'] - -@pulumi.input_type -class RepositoryTagProtectionArgs: - def __init__(__self__, *, - pattern: pulumi.Input[str], - repository: pulumi.Input[str]): - """ - The set of arguments for constructing a RepositoryTagProtection resource. - :param pulumi.Input[str] pattern: The pattern of the tag to protect. - :param pulumi.Input[str] repository: Name of the repository to add the tag protection to. - """ - pulumi.set(__self__, "pattern", pattern) - pulumi.set(__self__, "repository", repository) - - @property - @pulumi.getter - def pattern(self) -> pulumi.Input[str]: - """ - The pattern of the tag to protect. - """ - return pulumi.get(self, "pattern") - - @pattern.setter - def pattern(self, value: pulumi.Input[str]): - pulumi.set(self, "pattern", value) - - @property - @pulumi.getter - def repository(self) -> pulumi.Input[str]: - """ - Name of the repository to add the tag protection to. - """ - return pulumi.get(self, "repository") - - @repository.setter - def repository(self, value: pulumi.Input[str]): - pulumi.set(self, "repository", value) - - -@pulumi.input_type -class _RepositoryTagProtectionState: - def __init__(__self__, *, - pattern: Optional[pulumi.Input[str]] = None, - repository: Optional[pulumi.Input[str]] = None, - tag_protection_id: Optional[pulumi.Input[int]] = None): - """ - Input properties used for looking up and filtering RepositoryTagProtection resources. - :param pulumi.Input[str] pattern: The pattern of the tag to protect. - :param pulumi.Input[str] repository: Name of the repository to add the tag protection to. - :param pulumi.Input[int] tag_protection_id: The ID of the tag protection. - """ - if pattern is not None: - pulumi.set(__self__, "pattern", pattern) - if repository is not None: - pulumi.set(__self__, "repository", repository) - if tag_protection_id is not None: - pulumi.set(__self__, "tag_protection_id", tag_protection_id) - - @property - @pulumi.getter - def pattern(self) -> Optional[pulumi.Input[str]]: - """ - The pattern of the tag to protect. - """ - return pulumi.get(self, "pattern") - - @pattern.setter - def pattern(self, value: Optional[pulumi.Input[str]]): - pulumi.set(self, "pattern", value) - - @property - @pulumi.getter - def repository(self) -> Optional[pulumi.Input[str]]: - """ - Name of the repository to add the tag protection to. - """ - return pulumi.get(self, "repository") - - @repository.setter - def repository(self, value: Optional[pulumi.Input[str]]): - pulumi.set(self, "repository", value) - - @property - @pulumi.getter(name="tagProtectionId") - def tag_protection_id(self) -> Optional[pulumi.Input[int]]: - """ - The ID of the tag protection. - """ - return pulumi.get(self, "tag_protection_id") - - @tag_protection_id.setter - def tag_protection_id(self, value: Optional[pulumi.Input[int]]): - pulumi.set(self, "tag_protection_id", value) - - -class RepositoryTagProtection(pulumi.CustomResource): - @overload - def __init__(__self__, - resource_name: str, - opts: Optional[pulumi.ResourceOptions] = None, - pattern: Optional[pulumi.Input[str]] = None, - repository: Optional[pulumi.Input[str]] = None, - __props__=None): - """ - This resource allows you to create and manage a repository tag protection for repositories within your GitHub organization or personal account. - - ## Example Usage - - ```python - import pulumi - import pulumi_github as github - - example = github.RepositoryTagProtection("example", - repository="example-repository", - pattern="v*") - ``` - - ## Import - - Repository tag protections can be imported using the `name` of the repository, combined with the `id` of the tag protection, separated by a `/` character. - The `id` of the tag protection can be found using the [GitHub API](https://docs.github.com/en/rest/repos/tags#list-tag-protection-states-for-a-repository). - - Importing uses the name of the repository, as well as the ID of the tag protection, e.g. - - ```sh - $ pulumi import github:index/repositoryTagProtection:RepositoryTagProtection terraform my-repo/31077 - ``` - - :param str resource_name: The name of the resource. - :param pulumi.ResourceOptions opts: Options for the resource. - :param pulumi.Input[str] pattern: The pattern of the tag to protect. - :param pulumi.Input[str] repository: Name of the repository to add the tag protection to. - """ - ... - @overload - def __init__(__self__, - resource_name: str, - args: RepositoryTagProtectionArgs, - opts: Optional[pulumi.ResourceOptions] = None): - """ - This resource allows you to create and manage a repository tag protection for repositories within your GitHub organization or personal account. - - ## Example Usage - - ```python - import pulumi - import pulumi_github as github - - example = github.RepositoryTagProtection("example", - repository="example-repository", - pattern="v*") - ``` - - ## Import - - Repository tag protections can be imported using the `name` of the repository, combined with the `id` of the tag protection, separated by a `/` character. - The `id` of the tag protection can be found using the [GitHub API](https://docs.github.com/en/rest/repos/tags#list-tag-protection-states-for-a-repository). - - Importing uses the name of the repository, as well as the ID of the tag protection, e.g. - - ```sh - $ pulumi import github:index/repositoryTagProtection:RepositoryTagProtection terraform my-repo/31077 - ``` - - :param str resource_name: The name of the resource. - :param RepositoryTagProtectionArgs args: The arguments to use to populate this resource's properties. - :param pulumi.ResourceOptions opts: Options for the resource. - """ - ... - def __init__(__self__, resource_name: str, *args, **kwargs): - resource_args, opts = _utilities.get_resource_args_opts(RepositoryTagProtectionArgs, pulumi.ResourceOptions, *args, **kwargs) - if resource_args is not None: - __self__._internal_init(resource_name, opts, **resource_args.__dict__) - else: - __self__._internal_init(resource_name, *args, **kwargs) - - def _internal_init(__self__, - resource_name: str, - opts: Optional[pulumi.ResourceOptions] = None, - pattern: Optional[pulumi.Input[str]] = None, - repository: Optional[pulumi.Input[str]] = None, - __props__=None): - opts = pulumi.ResourceOptions.merge(_utilities.get_resource_opts_defaults(), opts) - if not isinstance(opts, pulumi.ResourceOptions): - raise TypeError('Expected resource options to be a ResourceOptions instance') - if opts.id is None: - if __props__ is not None: - raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource') - __props__ = RepositoryTagProtectionArgs.__new__(RepositoryTagProtectionArgs) - - if pattern is None and not opts.urn: - raise TypeError("Missing required property 'pattern'") - __props__.__dict__["pattern"] = pattern - if repository is None and not opts.urn: - raise TypeError("Missing required property 'repository'") - __props__.__dict__["repository"] = repository - __props__.__dict__["tag_protection_id"] = None - super(RepositoryTagProtection, __self__).__init__( - 'github:index/repositoryTagProtection:RepositoryTagProtection', - resource_name, - __props__, - opts) - - @staticmethod - def get(resource_name: str, - id: pulumi.Input[str], - opts: Optional[pulumi.ResourceOptions] = None, - pattern: Optional[pulumi.Input[str]] = None, - repository: Optional[pulumi.Input[str]] = None, - tag_protection_id: Optional[pulumi.Input[int]] = None) -> 'RepositoryTagProtection': - """ - Get an existing RepositoryTagProtection resource's state with the given name, id, and optional extra - properties used to qualify the lookup. - - :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] pattern: The pattern of the tag to protect. - :param pulumi.Input[str] repository: Name of the repository to add the tag protection to. - :param pulumi.Input[int] tag_protection_id: The ID of the tag protection. - """ - opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id)) - - __props__ = _RepositoryTagProtectionState.__new__(_RepositoryTagProtectionState) - - __props__.__dict__["pattern"] = pattern - __props__.__dict__["repository"] = repository - __props__.__dict__["tag_protection_id"] = tag_protection_id - return RepositoryTagProtection(resource_name, opts=opts, __props__=__props__) - - @property - @pulumi.getter - def pattern(self) -> pulumi.Output[str]: - """ - The pattern of the tag to protect. - """ - return pulumi.get(self, "pattern") - - @property - @pulumi.getter - def repository(self) -> pulumi.Output[str]: - """ - Name of the repository to add the tag protection to. - """ - return pulumi.get(self, "repository") - - @property - @pulumi.getter(name="tagProtectionId") - def tag_protection_id(self) -> pulumi.Output[int]: - """ - The ID of the tag protection. - """ - return pulumi.get(self, "tag_protection_id") - diff --git a/sdk/python/pulumi_github/team_membership.py b/sdk/python/pulumi_github/team_membership.py index 443cc934..b252f33a 100644 --- a/sdk/python/pulumi_github/team_membership.py +++ b/sdk/python/pulumi_github/team_membership.py @@ -161,7 +161,7 @@ def __init__(__self__, > **Note** This resource is not compatible with `TeamMembers`. Use either `TeamMembers` or `TeamMembership`. - > **Note** Organization owners may not be set as "members" of a team; they may only be set as "maintainers". Attempting to set organization an owner to "member" of a may result in a `pulumi preview` diff that changes their status back to "maintainer". + > **Note** Organization owners may not be set as "members" of a team; they may only be set as "maintainers". Attempting to set an organization owner as a "member" of a team may result in a `pulumi preview` diff that changes their status back to "maintainer". ## Example Usage @@ -217,7 +217,7 @@ def __init__(__self__, > **Note** This resource is not compatible with `TeamMembers`. Use either `TeamMembers` or `TeamMembership`. - > **Note** Organization owners may not be set as "members" of a team; they may only be set as "maintainers". Attempting to set organization an owner to "member" of a may result in a `pulumi preview` diff that changes their status back to "maintainer". + > **Note** Organization owners may not be set as "members" of a team; they may only be set as "maintainers". Attempting to set an organization owner as a "member" of a team may result in a `pulumi preview` diff that changes their status back to "maintainer". ## Example Usage diff --git a/upstream b/upstream index 58096174..84c6bd21 160000 --- a/upstream +++ b/upstream @@ -1 +1 @@ -Subproject commit 580961747df6864f0f9e5123ebf3003712d00feb +Subproject commit 84c6bd2189177d0f685121b3b35f2bccecc70b9e