diff --git a/provider/cmd/pulumi-resource-github/bridge-metadata.json b/provider/cmd/pulumi-resource-github/bridge-metadata.json index 2602c568..f8c2fbfd 100644 --- a/provider/cmd/pulumi-resource-github/bridge-metadata.json +++ b/provider/cmd/pulumi-resource-github/bridge-metadata.json @@ -333,6 +333,18 @@ } } }, + "github_enterprise_actions_runner_group": { + "current": "github:index/enterpriseActionsRunnerGroup:EnterpriseActionsRunnerGroup", + "majorVersion": 6, + "fields": { + "selected_organization_ids": { + "maxItemsOne": false + }, + "selected_workflows": { + "maxItemsOne": false + } + } + }, "github_enterprise_organization": { "current": "github:index/enterpriseOrganization:EnterpriseOrganization", "majorVersion": 6, diff --git a/provider/cmd/pulumi-resource-github/schema.json b/provider/cmd/pulumi-resource-github/schema.json index dcd77954..e28e781c 100644 --- a/provider/cmd/pulumi-resource-github/schema.json +++ b/provider/cmd/pulumi-resource-github/schema.json @@ -316,6 +316,10 @@ "type": "boolean", "description": "Require an approved review in pull requests including files with a designated code owner. Defaults to `false`.\n" }, + "requireLastPushApproval": { + "type": "boolean", + "description": "Require that the most recent push must be approved by someone other than the last pusher. Defaults to `false`\n" + }, "requiredApprovingReviewCount": { "type": "integer", "description": "Require x number of approvals to satisfy branch protection requirements. If this is specified it must be a number between 0-6. This requirement matches GitHub's API, see the upstream [documentation](https://developer.github.com/v3/repos/branches/#parameters-1) for more information.\n" @@ -5537,6 +5541,166 @@ "type": "object" } }, + "github:index/enterpriseActionsRunnerGroup:EnterpriseActionsRunnerGroup": { + "description": "This resource allows you to create and manage GitHub Actions runner groups within your GitHub enterprise.\nYou must have admin access to an enterprise to use this resource.\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 enterprise = github.getEnterprise({\n slug: \"my-enterprise\",\n});\nconst enterpriseOrganization = new github.EnterpriseOrganization(\"enterpriseOrganization\", {\n enterpriseId: enterprise.then(enterprise =\u003e enterprise.id),\n billingEmail: \"octocat@octo.cat\",\n adminLogins: [\"octocat\"],\n});\nconst example = new github.EnterpriseActionsRunnerGroup(\"example\", {\n enterpriseSlug: enterprise.then(enterprise =\u003e enterprise.slug),\n allowsPublicRepositories: true,\n visibility: \"selected\",\n selectedOrganizationIds: [enterpriseOrganization.databaseId],\n restrictedToWorkflows: true,\n selectedWorkflows: [\"my-organization/my-repo/.github/workflows/cool-workflow.yaml@refs/tags/v1\"],\n});\n```\n```python\nimport pulumi\nimport pulumi_github as github\n\nenterprise = github.get_enterprise(slug=\"my-enterprise\")\nenterprise_organization = github.EnterpriseOrganization(\"enterpriseOrganization\",\n enterprise_id=enterprise.id,\n billing_email=\"octocat@octo.cat\",\n admin_logins=[\"octocat\"])\nexample = github.EnterpriseActionsRunnerGroup(\"example\",\n enterprise_slug=enterprise.slug,\n allows_public_repositories=True,\n visibility=\"selected\",\n selected_organization_ids=[enterprise_organization.database_id],\n restricted_to_workflows=True,\n selected_workflows=[\"my-organization/my-repo/.github/workflows/cool-workflow.yaml@refs/tags/v1\"])\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 enterprise = Github.GetEnterprise.Invoke(new()\n {\n Slug = \"my-enterprise\",\n });\n\n var enterpriseOrganization = new Github.EnterpriseOrganization(\"enterpriseOrganization\", new()\n {\n EnterpriseId = enterprise.Apply(getEnterpriseResult =\u003e getEnterpriseResult.Id),\n BillingEmail = \"octocat@octo.cat\",\n AdminLogins = new[]\n {\n \"octocat\",\n },\n });\n\n var example = new Github.EnterpriseActionsRunnerGroup(\"example\", new()\n {\n EnterpriseSlug = enterprise.Apply(getEnterpriseResult =\u003e getEnterpriseResult.Slug),\n AllowsPublicRepositories = true,\n Visibility = \"selected\",\n SelectedOrganizationIds = new[]\n {\n enterpriseOrganization.DatabaseId,\n },\n RestrictedToWorkflows = true,\n SelectedWorkflows = new[]\n {\n \"my-organization/my-repo/.github/workflows/cool-workflow.yaml@refs/tags/v1\",\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\tenterprise, err := github.GetEnterprise(ctx, \u0026github.GetEnterpriseArgs{\n\t\t\tSlug: \"my-enterprise\",\n\t\t}, nil)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tenterpriseOrganization, err := github.NewEnterpriseOrganization(ctx, \"enterpriseOrganization\", \u0026github.EnterpriseOrganizationArgs{\n\t\t\tEnterpriseId: pulumi.String(enterprise.Id),\n\t\t\tBillingEmail: pulumi.String(\"octocat@octo.cat\"),\n\t\t\tAdminLogins: pulumi.StringArray{\n\t\t\t\tpulumi.String(\"octocat\"),\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.NewEnterpriseActionsRunnerGroup(ctx, \"example\", \u0026github.EnterpriseActionsRunnerGroupArgs{\n\t\t\tEnterpriseSlug: pulumi.String(enterprise.Slug),\n\t\t\tAllowsPublicRepositories: pulumi.Bool(true),\n\t\t\tVisibility: pulumi.String(\"selected\"),\n\t\t\tSelectedOrganizationIds: pulumi.IntArray{\n\t\t\t\tenterpriseOrganization.DatabaseId,\n\t\t\t},\n\t\t\tRestrictedToWorkflows: pulumi.Bool(true),\n\t\t\tSelectedWorkflows: pulumi.StringArray{\n\t\t\t\tpulumi.String(\"my-organization/my-repo/.github/workflows/cool-workflow.yaml@refs/tags/v1\"),\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.GetEnterpriseArgs;\nimport com.pulumi.github.EnterpriseOrganization;\nimport com.pulumi.github.EnterpriseOrganizationArgs;\nimport com.pulumi.github.EnterpriseActionsRunnerGroup;\nimport com.pulumi.github.EnterpriseActionsRunnerGroupArgs;\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 enterprise = GithubFunctions.getEnterprise(GetEnterpriseArgs.builder()\n .slug(\"my-enterprise\")\n .build());\n\n var enterpriseOrganization = new EnterpriseOrganization(\"enterpriseOrganization\", EnterpriseOrganizationArgs.builder() \n .enterpriseId(enterprise.applyValue(getEnterpriseResult -\u003e getEnterpriseResult.id()))\n .billingEmail(\"octocat@octo.cat\")\n .adminLogins(\"octocat\")\n .build());\n\n var example = new EnterpriseActionsRunnerGroup(\"example\", EnterpriseActionsRunnerGroupArgs.builder() \n .enterpriseSlug(enterprise.applyValue(getEnterpriseResult -\u003e getEnterpriseResult.slug()))\n .allowsPublicRepositories(true)\n .visibility(\"selected\")\n .selectedOrganizationIds(enterpriseOrganization.databaseId())\n .restrictedToWorkflows(true)\n .selectedWorkflows(\"my-organization/my-repo/.github/workflows/cool-workflow.yaml@refs/tags/v1\")\n .build());\n\n }\n}\n```\n```yaml\nresources:\n enterpriseOrganization:\n type: github:EnterpriseOrganization\n properties:\n enterpriseId: ${enterprise.id}\n billingEmail: octocat@octo.cat\n adminLogins:\n - octocat\n example:\n type: github:EnterpriseActionsRunnerGroup\n properties:\n enterpriseSlug: ${enterprise.slug}\n allowsPublicRepositories: true\n visibility: selected\n selectedOrganizationIds:\n - ${enterpriseOrganization.databaseId}\n restrictedToWorkflows: true\n selectedWorkflows:\n - my-organization/my-repo/.github/workflows/cool-workflow.yaml@refs/tags/v1\nvariables:\n enterprise:\n fn::invoke:\n Function: github:getEnterprise\n Arguments:\n slug: my-enterprise\n```\n\u003c!--End PulumiCodeChooser --\u003e\n\n## Import\n\nThis resource can be imported using the enterprise slug and the ID of the runner group:\n\n```sh\n$ pulumi import github:index/enterpriseActionsRunnerGroup:EnterpriseActionsRunnerGroup test enterprise-slug/42\n```\n", + "properties": { + "allowsPublicRepositories": { + "type": "boolean", + "description": "Whether public repositories can be added to the runner group. Defaults to false.\n" + }, + "default": { + "type": "boolean", + "description": "Whether this is the default runner group\n" + }, + "enterpriseSlug": { + "type": "string", + "description": "The slug of the enterprise.\n" + }, + "etag": { + "type": "string", + "description": "An etag representing the runner group object\n" + }, + "name": { + "type": "string", + "description": "Name of the runner group\n" + }, + "restrictedToWorkflows": { + "type": "boolean", + "description": "If true, the runner group will be restricted to running only the workflows specified in the selected_workflows array. Defaults to false.\n" + }, + "runnersUrl": { + "type": "string", + "description": "The GitHub API URL for the runner group's runners\n" + }, + "selectedOrganizationIds": { + "type": "array", + "items": { + "type": "integer" + }, + "description": "IDs of the organizations which should be added to the runner group\n" + }, + "selectedOrganizationsUrl": { + "type": "string", + "description": "The GitHub API URL for the runner group's selected organizations\n" + }, + "selectedWorkflows": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of workflows the runner group should be allowed to run. This setting will be ignored unless restricted_to_workflows is set to true.\n" + }, + "visibility": { + "type": "string", + "description": "Visibility of a runner group to enterprise organizations. Whether the runner group can include `all` or `selected`\n" + } + }, + "required": [ + "default", + "enterpriseSlug", + "etag", + "name", + "runnersUrl", + "selectedOrganizationsUrl", + "visibility" + ], + "inputProperties": { + "allowsPublicRepositories": { + "type": "boolean", + "description": "Whether public repositories can be added to the runner group. Defaults to false.\n" + }, + "enterpriseSlug": { + "type": "string", + "description": "The slug of the enterprise.\n" + }, + "name": { + "type": "string", + "description": "Name of the runner group\n" + }, + "restrictedToWorkflows": { + "type": "boolean", + "description": "If true, the runner group will be restricted to running only the workflows specified in the selected_workflows array. Defaults to false.\n" + }, + "selectedOrganizationIds": { + "type": "array", + "items": { + "type": "integer" + }, + "description": "IDs of the organizations which should be added to the runner group\n" + }, + "selectedWorkflows": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of workflows the runner group should be allowed to run. This setting will be ignored unless restricted_to_workflows is set to true.\n" + }, + "visibility": { + "type": "string", + "description": "Visibility of a runner group to enterprise organizations. Whether the runner group can include `all` or `selected`\n" + } + }, + "requiredInputs": [ + "enterpriseSlug", + "visibility" + ], + "stateInputs": { + "description": "Input properties used for looking up and filtering EnterpriseActionsRunnerGroup resources.\n", + "properties": { + "allowsPublicRepositories": { + "type": "boolean", + "description": "Whether public repositories can be added to the runner group. Defaults to false.\n" + }, + "default": { + "type": "boolean", + "description": "Whether this is the default runner group\n" + }, + "enterpriseSlug": { + "type": "string", + "description": "The slug of the enterprise.\n" + }, + "etag": { + "type": "string", + "description": "An etag representing the runner group object\n" + }, + "name": { + "type": "string", + "description": "Name of the runner group\n" + }, + "restrictedToWorkflows": { + "type": "boolean", + "description": "If true, the runner group will be restricted to running only the workflows specified in the selected_workflows array. Defaults to false.\n" + }, + "runnersUrl": { + "type": "string", + "description": "The GitHub API URL for the runner group's runners\n" + }, + "selectedOrganizationIds": { + "type": "array", + "items": { + "type": "integer" + }, + "description": "IDs of the organizations which should be added to the runner group\n" + }, + "selectedOrganizationsUrl": { + "type": "string", + "description": "The GitHub API URL for the runner group's selected organizations\n" + }, + "selectedWorkflows": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of workflows the runner group should be allowed to run. This setting will be ignored unless restricted_to_workflows is set to true.\n" + }, + "visibility": { + "type": "string", + "description": "Visibility of a runner group to enterprise organizations. Whether the runner group can include `all` or `selected`\n" + } + }, + "type": "object" + } + }, "github:index/enterpriseOrganization:EnterpriseOrganization": { "description": "This resource allows you to create and manage a GitHub enterprise organization.\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 org = new github.EnterpriseOrganization(\"org\", {\n enterpriseId: data.github_enterprise.enterprise.id,\n displayName: \"Some Awesome Org\",\n description: \"Organization created with terraform\",\n billingEmail: \"jon@winteriscoming.com\",\n adminLogins: [\"jon-snow\"],\n});\n```\n```python\nimport pulumi\nimport pulumi_github as github\n\norg = github.EnterpriseOrganization(\"org\",\n enterprise_id=data[\"github_enterprise\"][\"enterprise\"][\"id\"],\n display_name=\"Some Awesome Org\",\n description=\"Organization created with terraform\",\n billing_email=\"jon@winteriscoming.com\",\n admin_logins=[\"jon-snow\"])\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 org = new Github.EnterpriseOrganization(\"org\", new()\n {\n EnterpriseId = data.Github_enterprise.Enterprise.Id,\n DisplayName = \"Some Awesome Org\",\n Description = \"Organization created with terraform\",\n BillingEmail = \"jon@winteriscoming.com\",\n AdminLogins = new[]\n {\n \"jon-snow\",\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.NewEnterpriseOrganization(ctx, \"org\", \u0026github.EnterpriseOrganizationArgs{\n\t\t\tEnterpriseId: pulumi.Any(data.Github_enterprise.Enterprise.Id),\n\t\t\tDisplayName: pulumi.String(\"Some Awesome Org\"),\n\t\t\tDescription: pulumi.String(\"Organization created with terraform\"),\n\t\t\tBillingEmail: pulumi.String(\"jon@winteriscoming.com\"),\n\t\t\tAdminLogins: pulumi.StringArray{\n\t\t\t\tpulumi.String(\"jon-snow\"),\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.EnterpriseOrganization;\nimport com.pulumi.github.EnterpriseOrganizationArgs;\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 org = new EnterpriseOrganization(\"org\", EnterpriseOrganizationArgs.builder() \n .enterpriseId(data.github_enterprise().enterprise().id())\n .displayName(\"Some Awesome Org\")\n .description(\"Organization created with terraform\")\n .billingEmail(\"jon@winteriscoming.com\")\n .adminLogins(\"jon-snow\")\n .build());\n\n }\n}\n```\n```yaml\nresources:\n org:\n type: github:EnterpriseOrganization\n properties:\n enterpriseId: ${data.github_enterprise.enterprise.id}\n displayName: Some Awesome Org\n description: Organization created with terraform\n billingEmail: jon@winteriscoming.com\n adminLogins:\n - jon-snow\n```\n\u003c!--End PulumiCodeChooser --\u003e\n\n## Import\n\nGitHub Enterprise Organization can be imported using the `slug` of the enterprise, combined with the `orgname` of the organization, separated by a `/` character.\n\n```sh\n$ pulumi import github:index/enterpriseOrganization:EnterpriseOrganization org enterp/some-awesome-org\n```\n", "properties": { @@ -5551,6 +5715,10 @@ "type": "string", "description": "The billing email address.\n" }, + "databaseId": { + "type": "integer", + "description": "The ID of the organization.\n" + }, "description": { "type": "string", "description": "The description of the organization.\n" @@ -5571,6 +5739,7 @@ "required": [ "adminLogins", "billingEmail", + "databaseId", "enterpriseId", "name" ], @@ -5624,6 +5793,10 @@ "type": "string", "description": "The billing email address.\n" }, + "databaseId": { + "type": "integer", + "description": "The ID of the organization.\n" + }, "description": { "type": "string", "description": "The description of the organization.\n" @@ -10747,6 +10920,10 @@ "type": "string", "description": "The time the enterprise was created.\n" }, + "databaseId": { + "type": "integer", + "description": "The database ID of the enterprise.\n" + }, "description": { "type": "string", "description": "The description of the enterprise.\n" @@ -10771,6 +10948,7 @@ "type": "object", "required": [ "createdAt", + "databaseId", "description", "name", "slug", diff --git a/provider/go.mod b/provider/go.mod index 60812228..0ac2ec80 100644 --- a/provider/go.mod +++ b/provider/go.mod @@ -190,7 +190,7 @@ require ( github.com/russross/blackfriday/v2 v2.1.0 // indirect github.com/ryanuber/go-glob v1.0.0 // indirect github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06 // indirect - github.com/santhosh-tekuri/jsonschema/v5 v5.3.0 // indirect + github.com/santhosh-tekuri/jsonschema/v5 v5.3.1 // indirect github.com/segmentio/asm v1.2.0 // indirect github.com/segmentio/encoding v0.3.6 // indirect github.com/sergi/go-diff v1.3.1 // indirect @@ -228,15 +228,15 @@ require ( gocloud.dev/secrets/hashivault v0.29.0 // indirect golang.org/x/crypto v0.21.0 // indirect golang.org/x/exp v0.0.0-20240103183307-be819d1f06fc // indirect - golang.org/x/mod v0.15.0 // indirect - golang.org/x/net v0.21.0 // indirect - golang.org/x/oauth2 v0.17.0 // indirect + golang.org/x/mod v0.16.0 // indirect + golang.org/x/net v0.22.0 // indirect + golang.org/x/oauth2 v0.18.0 // indirect golang.org/x/sync v0.6.0 // indirect golang.org/x/sys v0.18.0 // indirect golang.org/x/term v0.18.0 // indirect golang.org/x/text v0.14.0 // indirect golang.org/x/time v0.5.0 // indirect - golang.org/x/tools v0.18.0 // indirect + golang.org/x/tools v0.19.0 // indirect golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 // indirect google.golang.org/api v0.155.0 // indirect google.golang.org/appengine v1.6.8 // indirect @@ -244,7 +244,7 @@ require ( google.golang.org/genproto/googleapis/api v0.0.0-20240123012728-ef4313101c80 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80 // indirect google.golang.org/grpc v1.62.0 // indirect - google.golang.org/protobuf v1.32.0 // indirect + google.golang.org/protobuf v1.33.0 // indirect gopkg.in/square/go-jose.v2 v2.6.0 // indirect gopkg.in/warnings.v0 v0.1.2 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/provider/go.sum b/provider/go.sum index b28158a2..e54d25fe 100644 --- a/provider/go.sum +++ b/provider/go.sum @@ -2891,8 +2891,8 @@ github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06/go.mod h1:+e github.com/safchain/ethtool v0.0.0-20190326074333-42ed695e3de8/go.mod h1:Z0q5wiBQGYcxhMZ6gUqHn6pYNLypFAvaL3UvgZLR0U4= github.com/safchain/ethtool v0.0.0-20210803160452-9aa261dae9b1/go.mod h1:Z0q5wiBQGYcxhMZ6gUqHn6pYNLypFAvaL3UvgZLR0U4= github.com/sagikazarmark/crypt v0.6.0/go.mod h1:U8+INwJo3nBv1m6A/8OBXAq7Jnpspk5AxSgDyEQcea8= -github.com/santhosh-tekuri/jsonschema/v5 v5.3.0 h1:uIkTLo0AGRc8l7h5l9r+GcYi9qfVPt6lD4/bhmzfiKo= -github.com/santhosh-tekuri/jsonschema/v5 v5.3.0/go.mod h1:FKdcjfQW6rpZSnxxUvEA5H/cDPdvJ/SZJQLWWXWGrZ0= +github.com/santhosh-tekuri/jsonschema/v5 v5.3.1 h1:lZUw3E0/J3roVtGQ+SCrUrg3ON6NgVqpn3+iol9aGu4= +github.com/santhosh-tekuri/jsonschema/v5 v5.3.1/go.mod h1:uToXkOrWAZ6/Oc07xWQrPOhJotwFIyu2bBVN41fcDUY= github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= github.com/scaleway/scaleway-sdk-go v1.0.0-beta.9/go.mod h1:fCa7OJZ/9DRTnOKmxvT6pn+LPWUptQAmHF/SBJUGEcg= github.com/scaleway/scaleway-sdk-go v1.0.0-beta.12/go.mod h1:fCa7OJZ/9DRTnOKmxvT6pn+LPWUptQAmHF/SBJUGEcg= @@ -3363,8 +3363,9 @@ golang.org/x/mod v0.9.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.10.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.11.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.15.0 h1:SernR4v+D55NyBH2QiEQrlBAnj1ECL6AGrA5+dPaMY8= golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.16.0 h1:QX4fJ0Rr5cPQCF7O9lh9Se4pmwfwskqZfq5moyldzic= +golang.org/x/mod v0.16.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20180530234432-1e491301e022/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180811021610-c39426892332/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -3472,8 +3473,8 @@ golang.org/x/net v0.16.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= golang.org/x/net v0.18.0/go.mod h1:/czyP5RqHAH4odGYxBJ1qz0+CE5WZ+2j1YgoEo8F2jQ= golang.org/x/net v0.19.0/go.mod h1:CfAk/cbD4CthTvqiEl8NpboMuiuOYsAr/7NOjZJtv1U= -golang.org/x/net v0.21.0 h1:AQyQV4dYCvJ7vGmJyKki9+PBdyvhkSd8EIx/qb0AYv4= -golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= +golang.org/x/net v0.22.0 h1:9sGLhx7iRIHEiX0oAJ3MRZMUCElJgy7Br1nO+AMN3Tc= +golang.org/x/net v0.22.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -3513,8 +3514,8 @@ golang.org/x/oauth2 v0.10.0/go.mod h1:kTpgurOux7LqtuxjuyZa4Gj2gdezIt/jQtGnNFfypQ golang.org/x/oauth2 v0.11.0/go.mod h1:LdF7O/8bLR/qWK9DrpXmbHLTouvRHK0SgJl0GmDBchk= golang.org/x/oauth2 v0.13.0/go.mod h1:/JMhi4ZRXAf4HG9LiNmxvk+45+96RUlVThiH8FzNBn0= golang.org/x/oauth2 v0.14.0/go.mod h1:lAtNWgaWfL4cm7j2OV8TxGi9Qb7ECORx8DktCY74OwM= -golang.org/x/oauth2 v0.17.0 h1:6m3ZPmLEFdVxKKWnKq4VqZ60gutO35zm+zrAHVmHyDQ= -golang.org/x/oauth2 v0.17.0/go.mod h1:OzPDGQiuQMguemayvdylqddI7qcD9lnSDb+1FiwQ5HA= +golang.org/x/oauth2 v0.18.0 h1:09qnuIAgzdx1XplqJvW6CQqMCtGZykZWcXzPMPUusvI= +golang.org/x/oauth2 v0.18.0/go.mod h1:Wf7knwG0MPoWIMMBgFlEaSUDaKskp0dCfrlJRJXbBi8= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -3872,8 +3873,8 @@ golang.org/x/tools v0.9.1/go.mod h1:owI94Op576fPu3cIGQeHs3joujW/2Oc6MtlxbF5dfNc= golang.org/x/tools v0.9.3/go.mod h1:owI94Op576fPu3cIGQeHs3joujW/2Oc6MtlxbF5dfNc= golang.org/x/tools v0.10.0/go.mod h1:UJwyiVBsOA2uwvK/e5OY3GTpDUJriEd+/YlqAwLPmyM= golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58= -golang.org/x/tools v0.18.0 h1:k8NLag8AGHnn+PHbl7g43CtqZAwG60vZkLqgyZgIHgQ= -golang.org/x/tools v0.18.0/go.mod h1:GL7B4CwcLLeo59yx/9UWWuNOW1n3VZ4f5axWfML7Lcg= +golang.org/x/tools v0.19.0 h1:tfGCXNR1OsFG+sVdLAitlpjAvD/I6dHDKnYrpEZUHkw= +golang.org/x/tools v0.19.0/go.mod h1:qoJWxmGSIBmAeriMx19ogtrEPrGtDbPK634QFIcLAhc= golang.org/x/xerrors v0.0.0-20190410155217-1f06c39b4373/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20190513163551-3ee3066db522/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -4271,8 +4272,9 @@ google.golang.org/protobuf v1.28.2-0.20230222093303-bc1253ad3743/go.mod h1:HV8QO google.golang.org/protobuf v1.29.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I= google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= +google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/airbrake/gobrake.v2 v2.0.9/go.mod h1:/h5ZAUhDkGaJfjzjKLSjv6zCL6O0LLBxU4K+aSYdM/U= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/sdk/dotnet/EnterpriseActionsRunnerGroup.cs b/sdk/dotnet/EnterpriseActionsRunnerGroup.cs new file mode 100644 index 00000000..dbb2820a --- /dev/null +++ b/sdk/dotnet/EnterpriseActionsRunnerGroup.cs @@ -0,0 +1,330 @@ +// *** 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 GitHub Actions runner groups within your GitHub enterprise. + /// You must have admin access to an enterprise to use this resource. + /// + /// ## Example Usage + /// + /// <!--Start PulumiCodeChooser --> + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var enterprise = Github.GetEnterprise.Invoke(new() + /// { + /// Slug = "my-enterprise", + /// }); + /// + /// var enterpriseOrganization = new Github.EnterpriseOrganization("enterpriseOrganization", new() + /// { + /// EnterpriseId = enterprise.Apply(getEnterpriseResult => getEnterpriseResult.Id), + /// BillingEmail = "octocat@octo.cat", + /// AdminLogins = new[] + /// { + /// "octocat", + /// }, + /// }); + /// + /// var example = new Github.EnterpriseActionsRunnerGroup("example", new() + /// { + /// EnterpriseSlug = enterprise.Apply(getEnterpriseResult => getEnterpriseResult.Slug), + /// AllowsPublicRepositories = true, + /// Visibility = "selected", + /// SelectedOrganizationIds = new[] + /// { + /// enterpriseOrganization.DatabaseId, + /// }, + /// RestrictedToWorkflows = true, + /// SelectedWorkflows = new[] + /// { + /// "my-organization/my-repo/.github/workflows/cool-workflow.yaml@refs/tags/v1", + /// }, + /// }); + /// + /// }); + /// ``` + /// <!--End PulumiCodeChooser --> + /// + /// ## Import + /// + /// This resource can be imported using the enterprise slug and the ID of the runner group: + /// + /// ```sh + /// $ pulumi import github:index/enterpriseActionsRunnerGroup:EnterpriseActionsRunnerGroup test enterprise-slug/42 + /// ``` + /// + [GithubResourceType("github:index/enterpriseActionsRunnerGroup:EnterpriseActionsRunnerGroup")] + public partial class EnterpriseActionsRunnerGroup : global::Pulumi.CustomResource + { + /// + /// Whether public repositories can be added to the runner group. Defaults to false. + /// + [Output("allowsPublicRepositories")] + public Output AllowsPublicRepositories { get; private set; } = null!; + + /// + /// Whether this is the default runner group + /// + [Output("default")] + public Output Default { get; private set; } = null!; + + /// + /// The slug of the enterprise. + /// + [Output("enterpriseSlug")] + public Output EnterpriseSlug { get; private set; } = null!; + + /// + /// An etag representing the runner group object + /// + [Output("etag")] + public Output Etag { get; private set; } = null!; + + /// + /// Name of the runner group + /// + [Output("name")] + public Output Name { get; private set; } = null!; + + /// + /// If true, the runner group will be restricted to running only the workflows specified in the selected_workflows array. Defaults to false. + /// + [Output("restrictedToWorkflows")] + public Output RestrictedToWorkflows { get; private set; } = null!; + + /// + /// The GitHub API URL for the runner group's runners + /// + [Output("runnersUrl")] + public Output RunnersUrl { get; private set; } = null!; + + /// + /// IDs of the organizations which should be added to the runner group + /// + [Output("selectedOrganizationIds")] + public Output> SelectedOrganizationIds { get; private set; } = null!; + + /// + /// The GitHub API URL for the runner group's selected organizations + /// + [Output("selectedOrganizationsUrl")] + public Output SelectedOrganizationsUrl { get; private set; } = null!; + + /// + /// List of workflows the runner group should be allowed to run. This setting will be ignored unless restricted_to_workflows is set to true. + /// + [Output("selectedWorkflows")] + public Output> SelectedWorkflows { get; private set; } = null!; + + /// + /// Visibility of a runner group to enterprise organizations. Whether the runner group can include `all` or `selected` + /// + [Output("visibility")] + public Output Visibility { get; private set; } = null!; + + + /// + /// Create a EnterpriseActionsRunnerGroup 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 EnterpriseActionsRunnerGroup(string name, EnterpriseActionsRunnerGroupArgs args, CustomResourceOptions? options = null) + : base("github:index/enterpriseActionsRunnerGroup:EnterpriseActionsRunnerGroup", name, args ?? new EnterpriseActionsRunnerGroupArgs(), MakeResourceOptions(options, "")) + { + } + + private EnterpriseActionsRunnerGroup(string name, Input id, EnterpriseActionsRunnerGroupState? state = null, CustomResourceOptions? options = null) + : base("github:index/enterpriseActionsRunnerGroup:EnterpriseActionsRunnerGroup", 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 EnterpriseActionsRunnerGroup 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 EnterpriseActionsRunnerGroup Get(string name, Input id, EnterpriseActionsRunnerGroupState? state = null, CustomResourceOptions? options = null) + { + return new EnterpriseActionsRunnerGroup(name, id, state, options); + } + } + + public sealed class EnterpriseActionsRunnerGroupArgs : global::Pulumi.ResourceArgs + { + /// + /// Whether public repositories can be added to the runner group. Defaults to false. + /// + [Input("allowsPublicRepositories")] + public Input? AllowsPublicRepositories { get; set; } + + /// + /// The slug of the enterprise. + /// + [Input("enterpriseSlug", required: true)] + public Input EnterpriseSlug { get; set; } = null!; + + /// + /// Name of the runner group + /// + [Input("name")] + public Input? Name { get; set; } + + /// + /// If true, the runner group will be restricted to running only the workflows specified in the selected_workflows array. Defaults to false. + /// + [Input("restrictedToWorkflows")] + public Input? RestrictedToWorkflows { get; set; } + + [Input("selectedOrganizationIds")] + private InputList? _selectedOrganizationIds; + + /// + /// IDs of the organizations which should be added to the runner group + /// + public InputList SelectedOrganizationIds + { + get => _selectedOrganizationIds ?? (_selectedOrganizationIds = new InputList()); + set => _selectedOrganizationIds = value; + } + + [Input("selectedWorkflows")] + private InputList? _selectedWorkflows; + + /// + /// List of workflows the runner group should be allowed to run. This setting will be ignored unless restricted_to_workflows is set to true. + /// + public InputList SelectedWorkflows + { + get => _selectedWorkflows ?? (_selectedWorkflows = new InputList()); + set => _selectedWorkflows = value; + } + + /// + /// Visibility of a runner group to enterprise organizations. Whether the runner group can include `all` or `selected` + /// + [Input("visibility", required: true)] + public Input Visibility { get; set; } = null!; + + public EnterpriseActionsRunnerGroupArgs() + { + } + public static new EnterpriseActionsRunnerGroupArgs Empty => new EnterpriseActionsRunnerGroupArgs(); + } + + public sealed class EnterpriseActionsRunnerGroupState : global::Pulumi.ResourceArgs + { + /// + /// Whether public repositories can be added to the runner group. Defaults to false. + /// + [Input("allowsPublicRepositories")] + public Input? AllowsPublicRepositories { get; set; } + + /// + /// Whether this is the default runner group + /// + [Input("default")] + public Input? Default { get; set; } + + /// + /// The slug of the enterprise. + /// + [Input("enterpriseSlug")] + public Input? EnterpriseSlug { get; set; } + + /// + /// An etag representing the runner group object + /// + [Input("etag")] + public Input? Etag { get; set; } + + /// + /// Name of the runner group + /// + [Input("name")] + public Input? Name { get; set; } + + /// + /// If true, the runner group will be restricted to running only the workflows specified in the selected_workflows array. Defaults to false. + /// + [Input("restrictedToWorkflows")] + public Input? RestrictedToWorkflows { get; set; } + + /// + /// The GitHub API URL for the runner group's runners + /// + [Input("runnersUrl")] + public Input? RunnersUrl { get; set; } + + [Input("selectedOrganizationIds")] + private InputList? _selectedOrganizationIds; + + /// + /// IDs of the organizations which should be added to the runner group + /// + public InputList SelectedOrganizationIds + { + get => _selectedOrganizationIds ?? (_selectedOrganizationIds = new InputList()); + set => _selectedOrganizationIds = value; + } + + /// + /// The GitHub API URL for the runner group's selected organizations + /// + [Input("selectedOrganizationsUrl")] + public Input? SelectedOrganizationsUrl { get; set; } + + [Input("selectedWorkflows")] + private InputList? _selectedWorkflows; + + /// + /// List of workflows the runner group should be allowed to run. This setting will be ignored unless restricted_to_workflows is set to true. + /// + public InputList SelectedWorkflows + { + get => _selectedWorkflows ?? (_selectedWorkflows = new InputList()); + set => _selectedWorkflows = value; + } + + /// + /// Visibility of a runner group to enterprise organizations. Whether the runner group can include `all` or `selected` + /// + [Input("visibility")] + public Input? Visibility { get; set; } + + public EnterpriseActionsRunnerGroupState() + { + } + public static new EnterpriseActionsRunnerGroupState Empty => new EnterpriseActionsRunnerGroupState(); + } +} diff --git a/sdk/dotnet/EnterpriseOrganization.cs b/sdk/dotnet/EnterpriseOrganization.cs index 8fe14bb0..775ebc02 100644 --- a/sdk/dotnet/EnterpriseOrganization.cs +++ b/sdk/dotnet/EnterpriseOrganization.cs @@ -62,6 +62,12 @@ public partial class EnterpriseOrganization : global::Pulumi.CustomResource [Output("billingEmail")] public Output BillingEmail { get; private set; } = null!; + /// + /// The ID of the organization. + /// + [Output("databaseId")] + public Output DatabaseId { get; private set; } = null!; + /// /// The description of the organization. /// @@ -200,6 +206,12 @@ public InputList AdminLogins [Input("billingEmail")] public Input? BillingEmail { get; set; } + /// + /// The ID of the organization. + /// + [Input("databaseId")] + public Input? DatabaseId { get; set; } + /// /// The description of the organization. /// diff --git a/sdk/dotnet/GetEnterprise.cs b/sdk/dotnet/GetEnterprise.cs index 63b96268..71591ca3 100644 --- a/sdk/dotnet/GetEnterprise.cs +++ b/sdk/dotnet/GetEnterprise.cs @@ -102,6 +102,10 @@ public sealed class GetEnterpriseResult /// public readonly string CreatedAt; /// + /// The database ID of the enterprise. + /// + public readonly int DatabaseId; + /// /// The description of the enterprise. /// public readonly string Description; @@ -126,6 +130,8 @@ public sealed class GetEnterpriseResult private GetEnterpriseResult( string createdAt, + int databaseId, + string description, string id, @@ -137,6 +143,7 @@ private GetEnterpriseResult( string url) { CreatedAt = createdAt; + DatabaseId = databaseId; Description = description; Id = id; Name = name; diff --git a/sdk/dotnet/Inputs/BranchProtectionV3RequiredPullRequestReviewsArgs.cs b/sdk/dotnet/Inputs/BranchProtectionV3RequiredPullRequestReviewsArgs.cs index 60da6e83..b05de96a 100644 --- a/sdk/dotnet/Inputs/BranchProtectionV3RequiredPullRequestReviewsArgs.cs +++ b/sdk/dotnet/Inputs/BranchProtectionV3RequiredPullRequestReviewsArgs.cs @@ -70,6 +70,12 @@ public InputList DismissalUsers [Input("requireCodeOwnerReviews")] public Input? RequireCodeOwnerReviews { get; set; } + /// + /// Require that the most recent push must be approved by someone other than the last pusher. Defaults to `false` + /// + [Input("requireLastPushApproval")] + public Input? RequireLastPushApproval { get; set; } + /// /// Require x number of approvals to satisfy branch protection requirements. If this is specified it must be a number between 0-6. This requirement matches GitHub's API, see the upstream [documentation](https://developer.github.com/v3/repos/branches/#parameters-1) for more information. /// diff --git a/sdk/dotnet/Inputs/BranchProtectionV3RequiredPullRequestReviewsGetArgs.cs b/sdk/dotnet/Inputs/BranchProtectionV3RequiredPullRequestReviewsGetArgs.cs index 893f1e4a..3839da83 100644 --- a/sdk/dotnet/Inputs/BranchProtectionV3RequiredPullRequestReviewsGetArgs.cs +++ b/sdk/dotnet/Inputs/BranchProtectionV3RequiredPullRequestReviewsGetArgs.cs @@ -70,6 +70,12 @@ public InputList DismissalUsers [Input("requireCodeOwnerReviews")] public Input? RequireCodeOwnerReviews { get; set; } + /// + /// Require that the most recent push must be approved by someone other than the last pusher. Defaults to `false` + /// + [Input("requireLastPushApproval")] + public Input? RequireLastPushApproval { get; set; } + /// /// Require x number of approvals to satisfy branch protection requirements. If this is specified it must be a number between 0-6. This requirement matches GitHub's API, see the upstream [documentation](https://developer.github.com/v3/repos/branches/#parameters-1) for more information. /// diff --git a/sdk/dotnet/Outputs/BranchProtectionV3RequiredPullRequestReviews.cs b/sdk/dotnet/Outputs/BranchProtectionV3RequiredPullRequestReviews.cs index 3558a2fb..ca518f8e 100644 --- a/sdk/dotnet/Outputs/BranchProtectionV3RequiredPullRequestReviews.cs +++ b/sdk/dotnet/Outputs/BranchProtectionV3RequiredPullRequestReviews.cs @@ -40,6 +40,10 @@ public sealed class BranchProtectionV3RequiredPullRequestReviews /// public readonly bool? RequireCodeOwnerReviews; /// + /// Require that the most recent push must be approved by someone other than the last pusher. Defaults to `false` + /// + public readonly bool? RequireLastPushApproval; + /// /// Require x number of approvals to satisfy branch protection requirements. If this is specified it must be a number between 0-6. This requirement matches GitHub's API, see the upstream [documentation](https://developer.github.com/v3/repos/branches/#parameters-1) for more information. /// public readonly int? RequiredApprovingReviewCount; @@ -60,6 +64,8 @@ private BranchProtectionV3RequiredPullRequestReviews( bool? requireCodeOwnerReviews, + bool? requireLastPushApproval, + int? requiredApprovingReviewCount) { BypassPullRequestAllowances = bypassPullRequestAllowances; @@ -69,6 +75,7 @@ private BranchProtectionV3RequiredPullRequestReviews( DismissalUsers = dismissalUsers; IncludeAdmins = includeAdmins; RequireCodeOwnerReviews = requireCodeOwnerReviews; + RequireLastPushApproval = requireLastPushApproval; RequiredApprovingReviewCount = requiredApprovingReviewCount; } } diff --git a/sdk/go/github/enterpriseActionsRunnerGroup.go b/sdk/go/github/enterpriseActionsRunnerGroup.go new file mode 100644 index 00000000..6bbdf48d --- /dev/null +++ b/sdk/go/github/enterpriseActionsRunnerGroup.go @@ -0,0 +1,418 @@ +// 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 GitHub Actions runner groups within your GitHub enterprise. +// You must have admin access to an enterprise to use this resource. +// +// ## 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 { +// enterprise, err := github.GetEnterprise(ctx, &github.GetEnterpriseArgs{ +// Slug: "my-enterprise", +// }, nil) +// if err != nil { +// return err +// } +// enterpriseOrganization, err := github.NewEnterpriseOrganization(ctx, "enterpriseOrganization", &github.EnterpriseOrganizationArgs{ +// EnterpriseId: pulumi.String(enterprise.Id), +// BillingEmail: pulumi.String("octocat@octo.cat"), +// AdminLogins: pulumi.StringArray{ +// pulumi.String("octocat"), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = github.NewEnterpriseActionsRunnerGroup(ctx, "example", &github.EnterpriseActionsRunnerGroupArgs{ +// EnterpriseSlug: pulumi.String(enterprise.Slug), +// AllowsPublicRepositories: pulumi.Bool(true), +// Visibility: pulumi.String("selected"), +// SelectedOrganizationIds: pulumi.IntArray{ +// enterpriseOrganization.DatabaseId, +// }, +// RestrictedToWorkflows: pulumi.Bool(true), +// SelectedWorkflows: pulumi.StringArray{ +// pulumi.String("my-organization/my-repo/.github/workflows/cool-workflow.yaml@refs/tags/v1"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// +// +// ## Import +// +// This resource can be imported using the enterprise slug and the ID of the runner group: +// +// ```sh +// $ pulumi import github:index/enterpriseActionsRunnerGroup:EnterpriseActionsRunnerGroup test enterprise-slug/42 +// ``` +type EnterpriseActionsRunnerGroup struct { + pulumi.CustomResourceState + + // Whether public repositories can be added to the runner group. Defaults to false. + AllowsPublicRepositories pulumi.BoolPtrOutput `pulumi:"allowsPublicRepositories"` + // Whether this is the default runner group + Default pulumi.BoolOutput `pulumi:"default"` + // The slug of the enterprise. + EnterpriseSlug pulumi.StringOutput `pulumi:"enterpriseSlug"` + // An etag representing the runner group object + Etag pulumi.StringOutput `pulumi:"etag"` + // Name of the runner group + Name pulumi.StringOutput `pulumi:"name"` + // If true, the runner group will be restricted to running only the workflows specified in the selectedWorkflows array. Defaults to false. + RestrictedToWorkflows pulumi.BoolPtrOutput `pulumi:"restrictedToWorkflows"` + // The GitHub API URL for the runner group's runners + RunnersUrl pulumi.StringOutput `pulumi:"runnersUrl"` + // IDs of the organizations which should be added to the runner group + SelectedOrganizationIds pulumi.IntArrayOutput `pulumi:"selectedOrganizationIds"` + // The GitHub API URL for the runner group's selected organizations + SelectedOrganizationsUrl pulumi.StringOutput `pulumi:"selectedOrganizationsUrl"` + // List of workflows the runner group should be allowed to run. This setting will be ignored unless restrictedToWorkflows is set to true. + SelectedWorkflows pulumi.StringArrayOutput `pulumi:"selectedWorkflows"` + // Visibility of a runner group to enterprise organizations. Whether the runner group can include `all` or `selected` + Visibility pulumi.StringOutput `pulumi:"visibility"` +} + +// NewEnterpriseActionsRunnerGroup registers a new resource with the given unique name, arguments, and options. +func NewEnterpriseActionsRunnerGroup(ctx *pulumi.Context, + name string, args *EnterpriseActionsRunnerGroupArgs, opts ...pulumi.ResourceOption) (*EnterpriseActionsRunnerGroup, error) { + if args == nil { + return nil, errors.New("missing one or more required arguments") + } + + if args.EnterpriseSlug == nil { + return nil, errors.New("invalid value for required argument 'EnterpriseSlug'") + } + if args.Visibility == nil { + return nil, errors.New("invalid value for required argument 'Visibility'") + } + opts = internal.PkgResourceDefaultOpts(opts) + var resource EnterpriseActionsRunnerGroup + err := ctx.RegisterResource("github:index/enterpriseActionsRunnerGroup:EnterpriseActionsRunnerGroup", name, args, &resource, opts...) + if err != nil { + return nil, err + } + return &resource, nil +} + +// GetEnterpriseActionsRunnerGroup gets an existing EnterpriseActionsRunnerGroup 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 GetEnterpriseActionsRunnerGroup(ctx *pulumi.Context, + name string, id pulumi.IDInput, state *EnterpriseActionsRunnerGroupState, opts ...pulumi.ResourceOption) (*EnterpriseActionsRunnerGroup, error) { + var resource EnterpriseActionsRunnerGroup + err := ctx.ReadResource("github:index/enterpriseActionsRunnerGroup:EnterpriseActionsRunnerGroup", name, id, state, &resource, opts...) + if err != nil { + return nil, err + } + return &resource, nil +} + +// Input properties used for looking up and filtering EnterpriseActionsRunnerGroup resources. +type enterpriseActionsRunnerGroupState struct { + // Whether public repositories can be added to the runner group. Defaults to false. + AllowsPublicRepositories *bool `pulumi:"allowsPublicRepositories"` + // Whether this is the default runner group + Default *bool `pulumi:"default"` + // The slug of the enterprise. + EnterpriseSlug *string `pulumi:"enterpriseSlug"` + // An etag representing the runner group object + Etag *string `pulumi:"etag"` + // Name of the runner group + Name *string `pulumi:"name"` + // If true, the runner group will be restricted to running only the workflows specified in the selectedWorkflows array. Defaults to false. + RestrictedToWorkflows *bool `pulumi:"restrictedToWorkflows"` + // The GitHub API URL for the runner group's runners + RunnersUrl *string `pulumi:"runnersUrl"` + // IDs of the organizations which should be added to the runner group + SelectedOrganizationIds []int `pulumi:"selectedOrganizationIds"` + // The GitHub API URL for the runner group's selected organizations + SelectedOrganizationsUrl *string `pulumi:"selectedOrganizationsUrl"` + // List of workflows the runner group should be allowed to run. This setting will be ignored unless restrictedToWorkflows is set to true. + SelectedWorkflows []string `pulumi:"selectedWorkflows"` + // Visibility of a runner group to enterprise organizations. Whether the runner group can include `all` or `selected` + Visibility *string `pulumi:"visibility"` +} + +type EnterpriseActionsRunnerGroupState struct { + // Whether public repositories can be added to the runner group. Defaults to false. + AllowsPublicRepositories pulumi.BoolPtrInput + // Whether this is the default runner group + Default pulumi.BoolPtrInput + // The slug of the enterprise. + EnterpriseSlug pulumi.StringPtrInput + // An etag representing the runner group object + Etag pulumi.StringPtrInput + // Name of the runner group + Name pulumi.StringPtrInput + // If true, the runner group will be restricted to running only the workflows specified in the selectedWorkflows array. Defaults to false. + RestrictedToWorkflows pulumi.BoolPtrInput + // The GitHub API URL for the runner group's runners + RunnersUrl pulumi.StringPtrInput + // IDs of the organizations which should be added to the runner group + SelectedOrganizationIds pulumi.IntArrayInput + // The GitHub API URL for the runner group's selected organizations + SelectedOrganizationsUrl pulumi.StringPtrInput + // List of workflows the runner group should be allowed to run. This setting will be ignored unless restrictedToWorkflows is set to true. + SelectedWorkflows pulumi.StringArrayInput + // Visibility of a runner group to enterprise organizations. Whether the runner group can include `all` or `selected` + Visibility pulumi.StringPtrInput +} + +func (EnterpriseActionsRunnerGroupState) ElementType() reflect.Type { + return reflect.TypeOf((*enterpriseActionsRunnerGroupState)(nil)).Elem() +} + +type enterpriseActionsRunnerGroupArgs struct { + // Whether public repositories can be added to the runner group. Defaults to false. + AllowsPublicRepositories *bool `pulumi:"allowsPublicRepositories"` + // The slug of the enterprise. + EnterpriseSlug string `pulumi:"enterpriseSlug"` + // Name of the runner group + Name *string `pulumi:"name"` + // If true, the runner group will be restricted to running only the workflows specified in the selectedWorkflows array. Defaults to false. + RestrictedToWorkflows *bool `pulumi:"restrictedToWorkflows"` + // IDs of the organizations which should be added to the runner group + SelectedOrganizationIds []int `pulumi:"selectedOrganizationIds"` + // List of workflows the runner group should be allowed to run. This setting will be ignored unless restrictedToWorkflows is set to true. + SelectedWorkflows []string `pulumi:"selectedWorkflows"` + // Visibility of a runner group to enterprise organizations. Whether the runner group can include `all` or `selected` + Visibility string `pulumi:"visibility"` +} + +// The set of arguments for constructing a EnterpriseActionsRunnerGroup resource. +type EnterpriseActionsRunnerGroupArgs struct { + // Whether public repositories can be added to the runner group. Defaults to false. + AllowsPublicRepositories pulumi.BoolPtrInput + // The slug of the enterprise. + EnterpriseSlug pulumi.StringInput + // Name of the runner group + Name pulumi.StringPtrInput + // If true, the runner group will be restricted to running only the workflows specified in the selectedWorkflows array. Defaults to false. + RestrictedToWorkflows pulumi.BoolPtrInput + // IDs of the organizations which should be added to the runner group + SelectedOrganizationIds pulumi.IntArrayInput + // List of workflows the runner group should be allowed to run. This setting will be ignored unless restrictedToWorkflows is set to true. + SelectedWorkflows pulumi.StringArrayInput + // Visibility of a runner group to enterprise organizations. Whether the runner group can include `all` or `selected` + Visibility pulumi.StringInput +} + +func (EnterpriseActionsRunnerGroupArgs) ElementType() reflect.Type { + return reflect.TypeOf((*enterpriseActionsRunnerGroupArgs)(nil)).Elem() +} + +type EnterpriseActionsRunnerGroupInput interface { + pulumi.Input + + ToEnterpriseActionsRunnerGroupOutput() EnterpriseActionsRunnerGroupOutput + ToEnterpriseActionsRunnerGroupOutputWithContext(ctx context.Context) EnterpriseActionsRunnerGroupOutput +} + +func (*EnterpriseActionsRunnerGroup) ElementType() reflect.Type { + return reflect.TypeOf((**EnterpriseActionsRunnerGroup)(nil)).Elem() +} + +func (i *EnterpriseActionsRunnerGroup) ToEnterpriseActionsRunnerGroupOutput() EnterpriseActionsRunnerGroupOutput { + return i.ToEnterpriseActionsRunnerGroupOutputWithContext(context.Background()) +} + +func (i *EnterpriseActionsRunnerGroup) ToEnterpriseActionsRunnerGroupOutputWithContext(ctx context.Context) EnterpriseActionsRunnerGroupOutput { + return pulumi.ToOutputWithContext(ctx, i).(EnterpriseActionsRunnerGroupOutput) +} + +// EnterpriseActionsRunnerGroupArrayInput is an input type that accepts EnterpriseActionsRunnerGroupArray and EnterpriseActionsRunnerGroupArrayOutput values. +// You can construct a concrete instance of `EnterpriseActionsRunnerGroupArrayInput` via: +// +// EnterpriseActionsRunnerGroupArray{ EnterpriseActionsRunnerGroupArgs{...} } +type EnterpriseActionsRunnerGroupArrayInput interface { + pulumi.Input + + ToEnterpriseActionsRunnerGroupArrayOutput() EnterpriseActionsRunnerGroupArrayOutput + ToEnterpriseActionsRunnerGroupArrayOutputWithContext(context.Context) EnterpriseActionsRunnerGroupArrayOutput +} + +type EnterpriseActionsRunnerGroupArray []EnterpriseActionsRunnerGroupInput + +func (EnterpriseActionsRunnerGroupArray) ElementType() reflect.Type { + return reflect.TypeOf((*[]*EnterpriseActionsRunnerGroup)(nil)).Elem() +} + +func (i EnterpriseActionsRunnerGroupArray) ToEnterpriseActionsRunnerGroupArrayOutput() EnterpriseActionsRunnerGroupArrayOutput { + return i.ToEnterpriseActionsRunnerGroupArrayOutputWithContext(context.Background()) +} + +func (i EnterpriseActionsRunnerGroupArray) ToEnterpriseActionsRunnerGroupArrayOutputWithContext(ctx context.Context) EnterpriseActionsRunnerGroupArrayOutput { + return pulumi.ToOutputWithContext(ctx, i).(EnterpriseActionsRunnerGroupArrayOutput) +} + +// EnterpriseActionsRunnerGroupMapInput is an input type that accepts EnterpriseActionsRunnerGroupMap and EnterpriseActionsRunnerGroupMapOutput values. +// You can construct a concrete instance of `EnterpriseActionsRunnerGroupMapInput` via: +// +// EnterpriseActionsRunnerGroupMap{ "key": EnterpriseActionsRunnerGroupArgs{...} } +type EnterpriseActionsRunnerGroupMapInput interface { + pulumi.Input + + ToEnterpriseActionsRunnerGroupMapOutput() EnterpriseActionsRunnerGroupMapOutput + ToEnterpriseActionsRunnerGroupMapOutputWithContext(context.Context) EnterpriseActionsRunnerGroupMapOutput +} + +type EnterpriseActionsRunnerGroupMap map[string]EnterpriseActionsRunnerGroupInput + +func (EnterpriseActionsRunnerGroupMap) ElementType() reflect.Type { + return reflect.TypeOf((*map[string]*EnterpriseActionsRunnerGroup)(nil)).Elem() +} + +func (i EnterpriseActionsRunnerGroupMap) ToEnterpriseActionsRunnerGroupMapOutput() EnterpriseActionsRunnerGroupMapOutput { + return i.ToEnterpriseActionsRunnerGroupMapOutputWithContext(context.Background()) +} + +func (i EnterpriseActionsRunnerGroupMap) ToEnterpriseActionsRunnerGroupMapOutputWithContext(ctx context.Context) EnterpriseActionsRunnerGroupMapOutput { + return pulumi.ToOutputWithContext(ctx, i).(EnterpriseActionsRunnerGroupMapOutput) +} + +type EnterpriseActionsRunnerGroupOutput struct{ *pulumi.OutputState } + +func (EnterpriseActionsRunnerGroupOutput) ElementType() reflect.Type { + return reflect.TypeOf((**EnterpriseActionsRunnerGroup)(nil)).Elem() +} + +func (o EnterpriseActionsRunnerGroupOutput) ToEnterpriseActionsRunnerGroupOutput() EnterpriseActionsRunnerGroupOutput { + return o +} + +func (o EnterpriseActionsRunnerGroupOutput) ToEnterpriseActionsRunnerGroupOutputWithContext(ctx context.Context) EnterpriseActionsRunnerGroupOutput { + return o +} + +// Whether public repositories can be added to the runner group. Defaults to false. +func (o EnterpriseActionsRunnerGroupOutput) AllowsPublicRepositories() pulumi.BoolPtrOutput { + return o.ApplyT(func(v *EnterpriseActionsRunnerGroup) pulumi.BoolPtrOutput { return v.AllowsPublicRepositories }).(pulumi.BoolPtrOutput) +} + +// Whether this is the default runner group +func (o EnterpriseActionsRunnerGroupOutput) Default() pulumi.BoolOutput { + return o.ApplyT(func(v *EnterpriseActionsRunnerGroup) pulumi.BoolOutput { return v.Default }).(pulumi.BoolOutput) +} + +// The slug of the enterprise. +func (o EnterpriseActionsRunnerGroupOutput) EnterpriseSlug() pulumi.StringOutput { + return o.ApplyT(func(v *EnterpriseActionsRunnerGroup) pulumi.StringOutput { return v.EnterpriseSlug }).(pulumi.StringOutput) +} + +// An etag representing the runner group object +func (o EnterpriseActionsRunnerGroupOutput) Etag() pulumi.StringOutput { + return o.ApplyT(func(v *EnterpriseActionsRunnerGroup) pulumi.StringOutput { return v.Etag }).(pulumi.StringOutput) +} + +// Name of the runner group +func (o EnterpriseActionsRunnerGroupOutput) Name() pulumi.StringOutput { + return o.ApplyT(func(v *EnterpriseActionsRunnerGroup) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput) +} + +// If true, the runner group will be restricted to running only the workflows specified in the selectedWorkflows array. Defaults to false. +func (o EnterpriseActionsRunnerGroupOutput) RestrictedToWorkflows() pulumi.BoolPtrOutput { + return o.ApplyT(func(v *EnterpriseActionsRunnerGroup) pulumi.BoolPtrOutput { return v.RestrictedToWorkflows }).(pulumi.BoolPtrOutput) +} + +// The GitHub API URL for the runner group's runners +func (o EnterpriseActionsRunnerGroupOutput) RunnersUrl() pulumi.StringOutput { + return o.ApplyT(func(v *EnterpriseActionsRunnerGroup) pulumi.StringOutput { return v.RunnersUrl }).(pulumi.StringOutput) +} + +// IDs of the organizations which should be added to the runner group +func (o EnterpriseActionsRunnerGroupOutput) SelectedOrganizationIds() pulumi.IntArrayOutput { + return o.ApplyT(func(v *EnterpriseActionsRunnerGroup) pulumi.IntArrayOutput { return v.SelectedOrganizationIds }).(pulumi.IntArrayOutput) +} + +// The GitHub API URL for the runner group's selected organizations +func (o EnterpriseActionsRunnerGroupOutput) SelectedOrganizationsUrl() pulumi.StringOutput { + return o.ApplyT(func(v *EnterpriseActionsRunnerGroup) pulumi.StringOutput { return v.SelectedOrganizationsUrl }).(pulumi.StringOutput) +} + +// List of workflows the runner group should be allowed to run. This setting will be ignored unless restrictedToWorkflows is set to true. +func (o EnterpriseActionsRunnerGroupOutput) SelectedWorkflows() pulumi.StringArrayOutput { + return o.ApplyT(func(v *EnterpriseActionsRunnerGroup) pulumi.StringArrayOutput { return v.SelectedWorkflows }).(pulumi.StringArrayOutput) +} + +// Visibility of a runner group to enterprise organizations. Whether the runner group can include `all` or `selected` +func (o EnterpriseActionsRunnerGroupOutput) Visibility() pulumi.StringOutput { + return o.ApplyT(func(v *EnterpriseActionsRunnerGroup) pulumi.StringOutput { return v.Visibility }).(pulumi.StringOutput) +} + +type EnterpriseActionsRunnerGroupArrayOutput struct{ *pulumi.OutputState } + +func (EnterpriseActionsRunnerGroupArrayOutput) ElementType() reflect.Type { + return reflect.TypeOf((*[]*EnterpriseActionsRunnerGroup)(nil)).Elem() +} + +func (o EnterpriseActionsRunnerGroupArrayOutput) ToEnterpriseActionsRunnerGroupArrayOutput() EnterpriseActionsRunnerGroupArrayOutput { + return o +} + +func (o EnterpriseActionsRunnerGroupArrayOutput) ToEnterpriseActionsRunnerGroupArrayOutputWithContext(ctx context.Context) EnterpriseActionsRunnerGroupArrayOutput { + return o +} + +func (o EnterpriseActionsRunnerGroupArrayOutput) Index(i pulumi.IntInput) EnterpriseActionsRunnerGroupOutput { + return pulumi.All(o, i).ApplyT(func(vs []interface{}) *EnterpriseActionsRunnerGroup { + return vs[0].([]*EnterpriseActionsRunnerGroup)[vs[1].(int)] + }).(EnterpriseActionsRunnerGroupOutput) +} + +type EnterpriseActionsRunnerGroupMapOutput struct{ *pulumi.OutputState } + +func (EnterpriseActionsRunnerGroupMapOutput) ElementType() reflect.Type { + return reflect.TypeOf((*map[string]*EnterpriseActionsRunnerGroup)(nil)).Elem() +} + +func (o EnterpriseActionsRunnerGroupMapOutput) ToEnterpriseActionsRunnerGroupMapOutput() EnterpriseActionsRunnerGroupMapOutput { + return o +} + +func (o EnterpriseActionsRunnerGroupMapOutput) ToEnterpriseActionsRunnerGroupMapOutputWithContext(ctx context.Context) EnterpriseActionsRunnerGroupMapOutput { + return o +} + +func (o EnterpriseActionsRunnerGroupMapOutput) MapIndex(k pulumi.StringInput) EnterpriseActionsRunnerGroupOutput { + return pulumi.All(o, k).ApplyT(func(vs []interface{}) *EnterpriseActionsRunnerGroup { + return vs[0].(map[string]*EnterpriseActionsRunnerGroup)[vs[1].(string)] + }).(EnterpriseActionsRunnerGroupOutput) +} + +func init() { + pulumi.RegisterInputType(reflect.TypeOf((*EnterpriseActionsRunnerGroupInput)(nil)).Elem(), &EnterpriseActionsRunnerGroup{}) + pulumi.RegisterInputType(reflect.TypeOf((*EnterpriseActionsRunnerGroupArrayInput)(nil)).Elem(), EnterpriseActionsRunnerGroupArray{}) + pulumi.RegisterInputType(reflect.TypeOf((*EnterpriseActionsRunnerGroupMapInput)(nil)).Elem(), EnterpriseActionsRunnerGroupMap{}) + pulumi.RegisterOutputType(EnterpriseActionsRunnerGroupOutput{}) + pulumi.RegisterOutputType(EnterpriseActionsRunnerGroupArrayOutput{}) + pulumi.RegisterOutputType(EnterpriseActionsRunnerGroupMapOutput{}) +} diff --git a/sdk/go/github/enterpriseOrganization.go b/sdk/go/github/enterpriseOrganization.go index 5144d67d..70cac19e 100644 --- a/sdk/go/github/enterpriseOrganization.go +++ b/sdk/go/github/enterpriseOrganization.go @@ -62,6 +62,8 @@ type EnterpriseOrganization struct { AdminLogins pulumi.StringArrayOutput `pulumi:"adminLogins"` // The billing email address. BillingEmail pulumi.StringOutput `pulumi:"billingEmail"` + // The ID of the organization. + DatabaseId pulumi.IntOutput `pulumi:"databaseId"` // The description of the organization. Description pulumi.StringPtrOutput `pulumi:"description"` // The display name of the organization. @@ -115,6 +117,8 @@ type enterpriseOrganizationState struct { AdminLogins []string `pulumi:"adminLogins"` // The billing email address. BillingEmail *string `pulumi:"billingEmail"` + // The ID of the organization. + DatabaseId *int `pulumi:"databaseId"` // The description of the organization. Description *string `pulumi:"description"` // The display name of the organization. @@ -130,6 +134,8 @@ type EnterpriseOrganizationState struct { AdminLogins pulumi.StringArrayInput // The billing email address. BillingEmail pulumi.StringPtrInput + // The ID of the organization. + DatabaseId pulumi.IntPtrInput // The description of the organization. Description pulumi.StringPtrInput // The display name of the organization. @@ -272,6 +278,11 @@ func (o EnterpriseOrganizationOutput) BillingEmail() pulumi.StringOutput { return o.ApplyT(func(v *EnterpriseOrganization) pulumi.StringOutput { return v.BillingEmail }).(pulumi.StringOutput) } +// The ID of the organization. +func (o EnterpriseOrganizationOutput) DatabaseId() pulumi.IntOutput { + return o.ApplyT(func(v *EnterpriseOrganization) pulumi.IntOutput { return v.DatabaseId }).(pulumi.IntOutput) +} + // The description of the organization. func (o EnterpriseOrganizationOutput) Description() pulumi.StringPtrOutput { return o.ApplyT(func(v *EnterpriseOrganization) pulumi.StringPtrOutput { return v.Description }).(pulumi.StringPtrOutput) diff --git a/sdk/go/github/getEnterprise.go b/sdk/go/github/getEnterprise.go index af673ba4..721f2438 100644 --- a/sdk/go/github/getEnterprise.go +++ b/sdk/go/github/getEnterprise.go @@ -60,6 +60,8 @@ type GetEnterpriseArgs struct { type GetEnterpriseResult struct { // The time the enterprise was created. CreatedAt string `pulumi:"createdAt"` + // The database ID of the enterprise. + DatabaseId int `pulumi:"databaseId"` // The description of the enterprise. Description string `pulumi:"description"` // The provider-assigned unique ID for this managed resource. @@ -115,6 +117,11 @@ func (o GetEnterpriseResultOutput) CreatedAt() pulumi.StringOutput { return o.ApplyT(func(v GetEnterpriseResult) string { return v.CreatedAt }).(pulumi.StringOutput) } +// The database ID of the enterprise. +func (o GetEnterpriseResultOutput) DatabaseId() pulumi.IntOutput { + return o.ApplyT(func(v GetEnterpriseResult) int { return v.DatabaseId }).(pulumi.IntOutput) +} + // The description of the enterprise. func (o GetEnterpriseResultOutput) Description() pulumi.StringOutput { return o.ApplyT(func(v GetEnterpriseResult) string { return v.Description }).(pulumi.StringOutput) diff --git a/sdk/go/github/init.go b/sdk/go/github/init.go index 5f4eab0a..4a6863cc 100644 --- a/sdk/go/github/init.go +++ b/sdk/go/github/init.go @@ -77,6 +77,8 @@ func (m *module) Construct(ctx *pulumi.Context, name, typ, urn string) (r pulumi r = &EmuGroupMapping{} case "github:index/enterpriseActionsPermissions:EnterpriseActionsPermissions": r = &EnterpriseActionsPermissions{} + case "github:index/enterpriseActionsRunnerGroup:EnterpriseActionsRunnerGroup": + r = &EnterpriseActionsRunnerGroup{} case "github:index/enterpriseOrganization:EnterpriseOrganization": r = &EnterpriseOrganization{} case "github:index/issue:Issue": @@ -330,6 +332,11 @@ func init() { "index/enterpriseActionsPermissions", &module{version}, ) + pulumi.RegisterResourceModule( + "github", + "index/enterpriseActionsRunnerGroup", + &module{version}, + ) pulumi.RegisterResourceModule( "github", "index/enterpriseOrganization", diff --git a/sdk/go/github/pulumiTypes.go b/sdk/go/github/pulumiTypes.go index d121e3f4..f2161329 100644 --- a/sdk/go/github/pulumiTypes.go +++ b/sdk/go/github/pulumiTypes.go @@ -897,6 +897,8 @@ type BranchProtectionV3RequiredPullRequestReviews struct { IncludeAdmins *bool `pulumi:"includeAdmins"` // Require an approved review in pull requests including files with a designated code owner. Defaults to `false`. RequireCodeOwnerReviews *bool `pulumi:"requireCodeOwnerReviews"` + // Require that the most recent push must be approved by someone other than the last pusher. Defaults to `false` + RequireLastPushApproval *bool `pulumi:"requireLastPushApproval"` // Require x number of approvals to satisfy branch protection requirements. If this is specified it must be a number between 0-6. This requirement matches GitHub's API, see the upstream [documentation](https://developer.github.com/v3/repos/branches/#parameters-1) for more information. RequiredApprovingReviewCount *int `pulumi:"requiredApprovingReviewCount"` } @@ -928,6 +930,8 @@ type BranchProtectionV3RequiredPullRequestReviewsArgs struct { IncludeAdmins pulumi.BoolPtrInput `pulumi:"includeAdmins"` // Require an approved review in pull requests including files with a designated code owner. Defaults to `false`. RequireCodeOwnerReviews pulumi.BoolPtrInput `pulumi:"requireCodeOwnerReviews"` + // Require that the most recent push must be approved by someone other than the last pusher. Defaults to `false` + RequireLastPushApproval pulumi.BoolPtrInput `pulumi:"requireLastPushApproval"` // Require x number of approvals to satisfy branch protection requirements. If this is specified it must be a number between 0-6. This requirement matches GitHub's API, see the upstream [documentation](https://developer.github.com/v3/repos/branches/#parameters-1) for more information. RequiredApprovingReviewCount pulumi.IntPtrInput `pulumi:"requiredApprovingReviewCount"` } @@ -1047,6 +1051,11 @@ func (o BranchProtectionV3RequiredPullRequestReviewsOutput) RequireCodeOwnerRevi return o.ApplyT(func(v BranchProtectionV3RequiredPullRequestReviews) *bool { return v.RequireCodeOwnerReviews }).(pulumi.BoolPtrOutput) } +// Require that the most recent push must be approved by someone other than the last pusher. Defaults to `false` +func (o BranchProtectionV3RequiredPullRequestReviewsOutput) RequireLastPushApproval() pulumi.BoolPtrOutput { + return o.ApplyT(func(v BranchProtectionV3RequiredPullRequestReviews) *bool { return v.RequireLastPushApproval }).(pulumi.BoolPtrOutput) +} + // Require x number of approvals to satisfy branch protection requirements. If this is specified it must be a number between 0-6. This requirement matches GitHub's API, see the upstream [documentation](https://developer.github.com/v3/repos/branches/#parameters-1) for more information. func (o BranchProtectionV3RequiredPullRequestReviewsOutput) RequiredApprovingReviewCount() pulumi.IntPtrOutput { return o.ApplyT(func(v BranchProtectionV3RequiredPullRequestReviews) *int { return v.RequiredApprovingReviewCount }).(pulumi.IntPtrOutput) @@ -1147,6 +1156,16 @@ func (o BranchProtectionV3RequiredPullRequestReviewsPtrOutput) RequireCodeOwnerR }).(pulumi.BoolPtrOutput) } +// Require that the most recent push must be approved by someone other than the last pusher. Defaults to `false` +func (o BranchProtectionV3RequiredPullRequestReviewsPtrOutput) RequireLastPushApproval() pulumi.BoolPtrOutput { + return o.ApplyT(func(v *BranchProtectionV3RequiredPullRequestReviews) *bool { + if v == nil { + return nil + } + return v.RequireLastPushApproval + }).(pulumi.BoolPtrOutput) +} + // Require x number of approvals to satisfy branch protection requirements. If this is specified it must be a number between 0-6. This requirement matches GitHub's API, see the upstream [documentation](https://developer.github.com/v3/repos/branches/#parameters-1) for more information. func (o BranchProtectionV3RequiredPullRequestReviewsPtrOutput) RequiredApprovingReviewCount() pulumi.IntPtrOutput { return o.ApplyT(func(v *BranchProtectionV3RequiredPullRequestReviews) *int { diff --git a/sdk/java/src/main/java/com/pulumi/github/EnterpriseActionsRunnerGroup.java b/sdk/java/src/main/java/com/pulumi/github/EnterpriseActionsRunnerGroup.java new file mode 100644 index 00000000..91f7ea85 --- /dev/null +++ b/sdk/java/src/main/java/com/pulumi/github/EnterpriseActionsRunnerGroup.java @@ -0,0 +1,290 @@ +// *** 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.EnterpriseActionsRunnerGroupArgs; +import com.pulumi.github.Utilities; +import com.pulumi.github.inputs.EnterpriseActionsRunnerGroupState; +import java.lang.Boolean; +import java.lang.Integer; +import java.lang.String; +import java.util.List; +import java.util.Optional; +import javax.annotation.Nullable; + +/** + * This resource allows you to create and manage GitHub Actions runner groups within your GitHub enterprise. + * You must have admin access to an enterprise to use this resource. + * + * ## Example Usage + * + * <!--Start PulumiCodeChooser --> + * ```java + * 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.GetEnterpriseArgs; + * import com.pulumi.github.EnterpriseOrganization; + * import com.pulumi.github.EnterpriseOrganizationArgs; + * import com.pulumi.github.EnterpriseActionsRunnerGroup; + * import com.pulumi.github.EnterpriseActionsRunnerGroupArgs; + * 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 enterprise = GithubFunctions.getEnterprise(GetEnterpriseArgs.builder() + * .slug("my-enterprise") + * .build()); + * + * var enterpriseOrganization = new EnterpriseOrganization("enterpriseOrganization", EnterpriseOrganizationArgs.builder() + * .enterpriseId(enterprise.applyValue(getEnterpriseResult -> getEnterpriseResult.id())) + * .billingEmail("octocat@octo.cat") + * .adminLogins("octocat") + * .build()); + * + * var example = new EnterpriseActionsRunnerGroup("example", EnterpriseActionsRunnerGroupArgs.builder() + * .enterpriseSlug(enterprise.applyValue(getEnterpriseResult -> getEnterpriseResult.slug())) + * .allowsPublicRepositories(true) + * .visibility("selected") + * .selectedOrganizationIds(enterpriseOrganization.databaseId()) + * .restrictedToWorkflows(true) + * .selectedWorkflows("my-organization/my-repo/.github/workflows/cool-workflow.yaml@refs/tags/v1") + * .build()); + * + * } + * } + * ``` + * <!--End PulumiCodeChooser --> + * + * ## Import + * + * This resource can be imported using the enterprise slug and the ID of the runner group: + * + * ```sh + * $ pulumi import github:index/enterpriseActionsRunnerGroup:EnterpriseActionsRunnerGroup test enterprise-slug/42 + * ``` + * + */ +@ResourceType(type="github:index/enterpriseActionsRunnerGroup:EnterpriseActionsRunnerGroup") +public class EnterpriseActionsRunnerGroup extends com.pulumi.resources.CustomResource { + /** + * Whether public repositories can be added to the runner group. Defaults to false. + * + */ + @Export(name="allowsPublicRepositories", refs={Boolean.class}, tree="[0]") + private Output allowsPublicRepositories; + + /** + * @return Whether public repositories can be added to the runner group. Defaults to false. + * + */ + public Output> allowsPublicRepositories() { + return Codegen.optional(this.allowsPublicRepositories); + } + /** + * Whether this is the default runner group + * + */ + @Export(name="default", refs={Boolean.class}, tree="[0]") + private Output default_; + + /** + * @return Whether this is the default runner group + * + */ + public Output default_() { + return this.default_; + } + /** + * The slug of the enterprise. + * + */ + @Export(name="enterpriseSlug", refs={String.class}, tree="[0]") + private Output enterpriseSlug; + + /** + * @return The slug of the enterprise. + * + */ + public Output enterpriseSlug() { + return this.enterpriseSlug; + } + /** + * An etag representing the runner group object + * + */ + @Export(name="etag", refs={String.class}, tree="[0]") + private Output etag; + + /** + * @return An etag representing the runner group object + * + */ + public Output etag() { + return this.etag; + } + /** + * Name of the runner group + * + */ + @Export(name="name", refs={String.class}, tree="[0]") + private Output name; + + /** + * @return Name of the runner group + * + */ + public Output name() { + return this.name; + } + /** + * If true, the runner group will be restricted to running only the workflows specified in the selected_workflows array. Defaults to false. + * + */ + @Export(name="restrictedToWorkflows", refs={Boolean.class}, tree="[0]") + private Output restrictedToWorkflows; + + /** + * @return If true, the runner group will be restricted to running only the workflows specified in the selected_workflows array. Defaults to false. + * + */ + public Output> restrictedToWorkflows() { + return Codegen.optional(this.restrictedToWorkflows); + } + /** + * The GitHub API URL for the runner group's runners + * + */ + @Export(name="runnersUrl", refs={String.class}, tree="[0]") + private Output runnersUrl; + + /** + * @return The GitHub API URL for the runner group's runners + * + */ + public Output runnersUrl() { + return this.runnersUrl; + } + /** + * IDs of the organizations which should be added to the runner group + * + */ + @Export(name="selectedOrganizationIds", refs={List.class,Integer.class}, tree="[0,1]") + private Output> selectedOrganizationIds; + + /** + * @return IDs of the organizations which should be added to the runner group + * + */ + public Output>> selectedOrganizationIds() { + return Codegen.optional(this.selectedOrganizationIds); + } + /** + * The GitHub API URL for the runner group's selected organizations + * + */ + @Export(name="selectedOrganizationsUrl", refs={String.class}, tree="[0]") + private Output selectedOrganizationsUrl; + + /** + * @return The GitHub API URL for the runner group's selected organizations + * + */ + public Output selectedOrganizationsUrl() { + return this.selectedOrganizationsUrl; + } + /** + * List of workflows the runner group should be allowed to run. This setting will be ignored unless restricted_to_workflows is set to true. + * + */ + @Export(name="selectedWorkflows", refs={List.class,String.class}, tree="[0,1]") + private Output> selectedWorkflows; + + /** + * @return List of workflows the runner group should be allowed to run. This setting will be ignored unless restricted_to_workflows is set to true. + * + */ + public Output>> selectedWorkflows() { + return Codegen.optional(this.selectedWorkflows); + } + /** + * Visibility of a runner group to enterprise organizations. Whether the runner group can include `all` or `selected` + * + */ + @Export(name="visibility", refs={String.class}, tree="[0]") + private Output visibility; + + /** + * @return Visibility of a runner group to enterprise organizations. Whether the runner group can include `all` or `selected` + * + */ + public Output visibility() { + return this.visibility; + } + + /** + * + * @param name The _unique_ name of the resulting resource. + */ + public EnterpriseActionsRunnerGroup(String name) { + this(name, EnterpriseActionsRunnerGroupArgs.Empty); + } + /** + * + * @param name The _unique_ name of the resulting resource. + * @param args The arguments to use to populate this resource's properties. + */ + public EnterpriseActionsRunnerGroup(String name, EnterpriseActionsRunnerGroupArgs 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 EnterpriseActionsRunnerGroup(String name, EnterpriseActionsRunnerGroupArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) { + super("github:index/enterpriseActionsRunnerGroup:EnterpriseActionsRunnerGroup", name, args == null ? EnterpriseActionsRunnerGroupArgs.Empty : args, makeResourceOptions(options, Codegen.empty())); + } + + private EnterpriseActionsRunnerGroup(String name, Output id, @Nullable EnterpriseActionsRunnerGroupState state, @Nullable com.pulumi.resources.CustomResourceOptions options) { + super("github:index/enterpriseActionsRunnerGroup:EnterpriseActionsRunnerGroup", name, state, makeResourceOptions(options, id)); + } + + 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 EnterpriseActionsRunnerGroup get(String name, Output id, @Nullable EnterpriseActionsRunnerGroupState state, @Nullable com.pulumi.resources.CustomResourceOptions options) { + return new EnterpriseActionsRunnerGroup(name, id, state, options); + } +} diff --git a/sdk/java/src/main/java/com/pulumi/github/EnterpriseActionsRunnerGroupArgs.java b/sdk/java/src/main/java/com/pulumi/github/EnterpriseActionsRunnerGroupArgs.java new file mode 100644 index 00000000..5e01c72b --- /dev/null +++ b/sdk/java/src/main/java/com/pulumi/github/EnterpriseActionsRunnerGroupArgs.java @@ -0,0 +1,335 @@ +// *** 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.Boolean; +import java.lang.Integer; +import java.lang.String; +import java.util.List; +import java.util.Objects; +import java.util.Optional; +import javax.annotation.Nullable; + + +public final class EnterpriseActionsRunnerGroupArgs extends com.pulumi.resources.ResourceArgs { + + public static final EnterpriseActionsRunnerGroupArgs Empty = new EnterpriseActionsRunnerGroupArgs(); + + /** + * Whether public repositories can be added to the runner group. Defaults to false. + * + */ + @Import(name="allowsPublicRepositories") + private @Nullable Output allowsPublicRepositories; + + /** + * @return Whether public repositories can be added to the runner group. Defaults to false. + * + */ + public Optional> allowsPublicRepositories() { + return Optional.ofNullable(this.allowsPublicRepositories); + } + + /** + * The slug of the enterprise. + * + */ + @Import(name="enterpriseSlug", required=true) + private Output enterpriseSlug; + + /** + * @return The slug of the enterprise. + * + */ + public Output enterpriseSlug() { + return this.enterpriseSlug; + } + + /** + * Name of the runner group + * + */ + @Import(name="name") + private @Nullable Output name; + + /** + * @return Name of the runner group + * + */ + public Optional> name() { + return Optional.ofNullable(this.name); + } + + /** + * If true, the runner group will be restricted to running only the workflows specified in the selected_workflows array. Defaults to false. + * + */ + @Import(name="restrictedToWorkflows") + private @Nullable Output restrictedToWorkflows; + + /** + * @return If true, the runner group will be restricted to running only the workflows specified in the selected_workflows array. Defaults to false. + * + */ + public Optional> restrictedToWorkflows() { + return Optional.ofNullable(this.restrictedToWorkflows); + } + + /** + * IDs of the organizations which should be added to the runner group + * + */ + @Import(name="selectedOrganizationIds") + private @Nullable Output> selectedOrganizationIds; + + /** + * @return IDs of the organizations which should be added to the runner group + * + */ + public Optional>> selectedOrganizationIds() { + return Optional.ofNullable(this.selectedOrganizationIds); + } + + /** + * List of workflows the runner group should be allowed to run. This setting will be ignored unless restricted_to_workflows is set to true. + * + */ + @Import(name="selectedWorkflows") + private @Nullable Output> selectedWorkflows; + + /** + * @return List of workflows the runner group should be allowed to run. This setting will be ignored unless restricted_to_workflows is set to true. + * + */ + public Optional>> selectedWorkflows() { + return Optional.ofNullable(this.selectedWorkflows); + } + + /** + * Visibility of a runner group to enterprise organizations. Whether the runner group can include `all` or `selected` + * + */ + @Import(name="visibility", required=true) + private Output visibility; + + /** + * @return Visibility of a runner group to enterprise organizations. Whether the runner group can include `all` or `selected` + * + */ + public Output visibility() { + return this.visibility; + } + + private EnterpriseActionsRunnerGroupArgs() {} + + private EnterpriseActionsRunnerGroupArgs(EnterpriseActionsRunnerGroupArgs $) { + this.allowsPublicRepositories = $.allowsPublicRepositories; + this.enterpriseSlug = $.enterpriseSlug; + this.name = $.name; + this.restrictedToWorkflows = $.restrictedToWorkflows; + this.selectedOrganizationIds = $.selectedOrganizationIds; + this.selectedWorkflows = $.selectedWorkflows; + this.visibility = $.visibility; + } + + public static Builder builder() { + return new Builder(); + } + public static Builder builder(EnterpriseActionsRunnerGroupArgs defaults) { + return new Builder(defaults); + } + + public static final class Builder { + private EnterpriseActionsRunnerGroupArgs $; + + public Builder() { + $ = new EnterpriseActionsRunnerGroupArgs(); + } + + public Builder(EnterpriseActionsRunnerGroupArgs defaults) { + $ = new EnterpriseActionsRunnerGroupArgs(Objects.requireNonNull(defaults)); + } + + /** + * @param allowsPublicRepositories Whether public repositories can be added to the runner group. Defaults to false. + * + * @return builder + * + */ + public Builder allowsPublicRepositories(@Nullable Output allowsPublicRepositories) { + $.allowsPublicRepositories = allowsPublicRepositories; + return this; + } + + /** + * @param allowsPublicRepositories Whether public repositories can be added to the runner group. Defaults to false. + * + * @return builder + * + */ + public Builder allowsPublicRepositories(Boolean allowsPublicRepositories) { + return allowsPublicRepositories(Output.of(allowsPublicRepositories)); + } + + /** + * @param enterpriseSlug The slug of the enterprise. + * + * @return builder + * + */ + public Builder enterpriseSlug(Output enterpriseSlug) { + $.enterpriseSlug = enterpriseSlug; + return this; + } + + /** + * @param enterpriseSlug The slug of the enterprise. + * + * @return builder + * + */ + public Builder enterpriseSlug(String enterpriseSlug) { + return enterpriseSlug(Output.of(enterpriseSlug)); + } + + /** + * @param name Name of the runner group + * + * @return builder + * + */ + public Builder name(@Nullable Output name) { + $.name = name; + return this; + } + + /** + * @param name Name of the runner group + * + * @return builder + * + */ + public Builder name(String name) { + return name(Output.of(name)); + } + + /** + * @param restrictedToWorkflows If true, the runner group will be restricted to running only the workflows specified in the selected_workflows array. Defaults to false. + * + * @return builder + * + */ + public Builder restrictedToWorkflows(@Nullable Output restrictedToWorkflows) { + $.restrictedToWorkflows = restrictedToWorkflows; + return this; + } + + /** + * @param restrictedToWorkflows If true, the runner group will be restricted to running only the workflows specified in the selected_workflows array. Defaults to false. + * + * @return builder + * + */ + public Builder restrictedToWorkflows(Boolean restrictedToWorkflows) { + return restrictedToWorkflows(Output.of(restrictedToWorkflows)); + } + + /** + * @param selectedOrganizationIds IDs of the organizations which should be added to the runner group + * + * @return builder + * + */ + public Builder selectedOrganizationIds(@Nullable Output> selectedOrganizationIds) { + $.selectedOrganizationIds = selectedOrganizationIds; + return this; + } + + /** + * @param selectedOrganizationIds IDs of the organizations which should be added to the runner group + * + * @return builder + * + */ + public Builder selectedOrganizationIds(List selectedOrganizationIds) { + return selectedOrganizationIds(Output.of(selectedOrganizationIds)); + } + + /** + * @param selectedOrganizationIds IDs of the organizations which should be added to the runner group + * + * @return builder + * + */ + public Builder selectedOrganizationIds(Integer... selectedOrganizationIds) { + return selectedOrganizationIds(List.of(selectedOrganizationIds)); + } + + /** + * @param selectedWorkflows List of workflows the runner group should be allowed to run. This setting will be ignored unless restricted_to_workflows is set to true. + * + * @return builder + * + */ + public Builder selectedWorkflows(@Nullable Output> selectedWorkflows) { + $.selectedWorkflows = selectedWorkflows; + return this; + } + + /** + * @param selectedWorkflows List of workflows the runner group should be allowed to run. This setting will be ignored unless restricted_to_workflows is set to true. + * + * @return builder + * + */ + public Builder selectedWorkflows(List selectedWorkflows) { + return selectedWorkflows(Output.of(selectedWorkflows)); + } + + /** + * @param selectedWorkflows List of workflows the runner group should be allowed to run. This setting will be ignored unless restricted_to_workflows is set to true. + * + * @return builder + * + */ + public Builder selectedWorkflows(String... selectedWorkflows) { + return selectedWorkflows(List.of(selectedWorkflows)); + } + + /** + * @param visibility Visibility of a runner group to enterprise organizations. Whether the runner group can include `all` or `selected` + * + * @return builder + * + */ + public Builder visibility(Output visibility) { + $.visibility = visibility; + return this; + } + + /** + * @param visibility Visibility of a runner group to enterprise organizations. Whether the runner group can include `all` or `selected` + * + * @return builder + * + */ + public Builder visibility(String visibility) { + return visibility(Output.of(visibility)); + } + + public EnterpriseActionsRunnerGroupArgs build() { + if ($.enterpriseSlug == null) { + throw new MissingRequiredPropertyException("EnterpriseActionsRunnerGroupArgs", "enterpriseSlug"); + } + if ($.visibility == null) { + throw new MissingRequiredPropertyException("EnterpriseActionsRunnerGroupArgs", "visibility"); + } + return $; + } + } + +} diff --git a/sdk/java/src/main/java/com/pulumi/github/EnterpriseOrganization.java b/sdk/java/src/main/java/com/pulumi/github/EnterpriseOrganization.java index 1a421eee..69704156 100644 --- a/sdk/java/src/main/java/com/pulumi/github/EnterpriseOrganization.java +++ b/sdk/java/src/main/java/com/pulumi/github/EnterpriseOrganization.java @@ -10,6 +10,7 @@ import com.pulumi.github.EnterpriseOrganizationArgs; import com.pulumi.github.Utilities; import com.pulumi.github.inputs.EnterpriseOrganizationState; +import java.lang.Integer; import java.lang.String; import java.util.List; import java.util.Optional; @@ -94,6 +95,20 @@ public Output> adminLogins() { public Output billingEmail() { return this.billingEmail; } + /** + * The ID of the organization. + * + */ + @Export(name="databaseId", refs={Integer.class}, tree="[0]") + private Output databaseId; + + /** + * @return The ID of the organization. + * + */ + public Output databaseId() { + return this.databaseId; + } /** * The description of the organization. * diff --git a/sdk/java/src/main/java/com/pulumi/github/inputs/BranchProtectionV3RequiredPullRequestReviewsArgs.java b/sdk/java/src/main/java/com/pulumi/github/inputs/BranchProtectionV3RequiredPullRequestReviewsArgs.java index f4caaf70..fe089c74 100644 --- a/sdk/java/src/main/java/com/pulumi/github/inputs/BranchProtectionV3RequiredPullRequestReviewsArgs.java +++ b/sdk/java/src/main/java/com/pulumi/github/inputs/BranchProtectionV3RequiredPullRequestReviewsArgs.java @@ -130,6 +130,21 @@ public Optional> requireCodeOwnerReviews() { return Optional.ofNullable(this.requireCodeOwnerReviews); } + /** + * Require that the most recent push must be approved by someone other than the last pusher. Defaults to `false` + * + */ + @Import(name="requireLastPushApproval") + private @Nullable Output requireLastPushApproval; + + /** + * @return Require that the most recent push must be approved by someone other than the last pusher. Defaults to `false` + * + */ + public Optional> requireLastPushApproval() { + return Optional.ofNullable(this.requireLastPushApproval); + } + /** * Require x number of approvals to satisfy branch protection requirements. If this is specified it must be a number between 0-6. This requirement matches GitHub's API, see the upstream [documentation](https://developer.github.com/v3/repos/branches/#parameters-1) for more information. * @@ -155,6 +170,7 @@ private BranchProtectionV3RequiredPullRequestReviewsArgs(BranchProtectionV3Requi this.dismissalUsers = $.dismissalUsers; this.includeAdmins = $.includeAdmins; this.requireCodeOwnerReviews = $.requireCodeOwnerReviews; + this.requireLastPushApproval = $.requireLastPushApproval; this.requiredApprovingReviewCount = $.requiredApprovingReviewCount; } @@ -360,6 +376,27 @@ public Builder requireCodeOwnerReviews(Boolean requireCodeOwnerReviews) { return requireCodeOwnerReviews(Output.of(requireCodeOwnerReviews)); } + /** + * @param requireLastPushApproval Require that the most recent push must be approved by someone other than the last pusher. Defaults to `false` + * + * @return builder + * + */ + public Builder requireLastPushApproval(@Nullable Output requireLastPushApproval) { + $.requireLastPushApproval = requireLastPushApproval; + return this; + } + + /** + * @param requireLastPushApproval Require that the most recent push must be approved by someone other than the last pusher. Defaults to `false` + * + * @return builder + * + */ + public Builder requireLastPushApproval(Boolean requireLastPushApproval) { + return requireLastPushApproval(Output.of(requireLastPushApproval)); + } + /** * @param requiredApprovingReviewCount Require x number of approvals to satisfy branch protection requirements. If this is specified it must be a number between 0-6. This requirement matches GitHub's API, see the upstream [documentation](https://developer.github.com/v3/repos/branches/#parameters-1) for more information. * diff --git a/sdk/java/src/main/java/com/pulumi/github/inputs/EnterpriseActionsRunnerGroupState.java b/sdk/java/src/main/java/com/pulumi/github/inputs/EnterpriseActionsRunnerGroupState.java new file mode 100644 index 00000000..2c528671 --- /dev/null +++ b/sdk/java/src/main/java/com/pulumi/github/inputs/EnterpriseActionsRunnerGroupState.java @@ -0,0 +1,476 @@ +// *** 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.Boolean; +import java.lang.Integer; +import java.lang.String; +import java.util.List; +import java.util.Objects; +import java.util.Optional; +import javax.annotation.Nullable; + + +public final class EnterpriseActionsRunnerGroupState extends com.pulumi.resources.ResourceArgs { + + public static final EnterpriseActionsRunnerGroupState Empty = new EnterpriseActionsRunnerGroupState(); + + /** + * Whether public repositories can be added to the runner group. Defaults to false. + * + */ + @Import(name="allowsPublicRepositories") + private @Nullable Output allowsPublicRepositories; + + /** + * @return Whether public repositories can be added to the runner group. Defaults to false. + * + */ + public Optional> allowsPublicRepositories() { + return Optional.ofNullable(this.allowsPublicRepositories); + } + + /** + * Whether this is the default runner group + * + */ + @Import(name="default") + private @Nullable Output default_; + + /** + * @return Whether this is the default runner group + * + */ + public Optional> default_() { + return Optional.ofNullable(this.default_); + } + + /** + * The slug of the enterprise. + * + */ + @Import(name="enterpriseSlug") + private @Nullable Output enterpriseSlug; + + /** + * @return The slug of the enterprise. + * + */ + public Optional> enterpriseSlug() { + return Optional.ofNullable(this.enterpriseSlug); + } + + /** + * An etag representing the runner group object + * + */ + @Import(name="etag") + private @Nullable Output etag; + + /** + * @return An etag representing the runner group object + * + */ + public Optional> etag() { + return Optional.ofNullable(this.etag); + } + + /** + * Name of the runner group + * + */ + @Import(name="name") + private @Nullable Output name; + + /** + * @return Name of the runner group + * + */ + public Optional> name() { + return Optional.ofNullable(this.name); + } + + /** + * If true, the runner group will be restricted to running only the workflows specified in the selected_workflows array. Defaults to false. + * + */ + @Import(name="restrictedToWorkflows") + private @Nullable Output restrictedToWorkflows; + + /** + * @return If true, the runner group will be restricted to running only the workflows specified in the selected_workflows array. Defaults to false. + * + */ + public Optional> restrictedToWorkflows() { + return Optional.ofNullable(this.restrictedToWorkflows); + } + + /** + * The GitHub API URL for the runner group's runners + * + */ + @Import(name="runnersUrl") + private @Nullable Output runnersUrl; + + /** + * @return The GitHub API URL for the runner group's runners + * + */ + public Optional> runnersUrl() { + return Optional.ofNullable(this.runnersUrl); + } + + /** + * IDs of the organizations which should be added to the runner group + * + */ + @Import(name="selectedOrganizationIds") + private @Nullable Output> selectedOrganizationIds; + + /** + * @return IDs of the organizations which should be added to the runner group + * + */ + public Optional>> selectedOrganizationIds() { + return Optional.ofNullable(this.selectedOrganizationIds); + } + + /** + * The GitHub API URL for the runner group's selected organizations + * + */ + @Import(name="selectedOrganizationsUrl") + private @Nullable Output selectedOrganizationsUrl; + + /** + * @return The GitHub API URL for the runner group's selected organizations + * + */ + public Optional> selectedOrganizationsUrl() { + return Optional.ofNullable(this.selectedOrganizationsUrl); + } + + /** + * List of workflows the runner group should be allowed to run. This setting will be ignored unless restricted_to_workflows is set to true. + * + */ + @Import(name="selectedWorkflows") + private @Nullable Output> selectedWorkflows; + + /** + * @return List of workflows the runner group should be allowed to run. This setting will be ignored unless restricted_to_workflows is set to true. + * + */ + public Optional>> selectedWorkflows() { + return Optional.ofNullable(this.selectedWorkflows); + } + + /** + * Visibility of a runner group to enterprise organizations. Whether the runner group can include `all` or `selected` + * + */ + @Import(name="visibility") + private @Nullable Output visibility; + + /** + * @return Visibility of a runner group to enterprise organizations. Whether the runner group can include `all` or `selected` + * + */ + public Optional> visibility() { + return Optional.ofNullable(this.visibility); + } + + private EnterpriseActionsRunnerGroupState() {} + + private EnterpriseActionsRunnerGroupState(EnterpriseActionsRunnerGroupState $) { + this.allowsPublicRepositories = $.allowsPublicRepositories; + this.default_ = $.default_; + this.enterpriseSlug = $.enterpriseSlug; + this.etag = $.etag; + this.name = $.name; + this.restrictedToWorkflows = $.restrictedToWorkflows; + this.runnersUrl = $.runnersUrl; + this.selectedOrganizationIds = $.selectedOrganizationIds; + this.selectedOrganizationsUrl = $.selectedOrganizationsUrl; + this.selectedWorkflows = $.selectedWorkflows; + this.visibility = $.visibility; + } + + public static Builder builder() { + return new Builder(); + } + public static Builder builder(EnterpriseActionsRunnerGroupState defaults) { + return new Builder(defaults); + } + + public static final class Builder { + private EnterpriseActionsRunnerGroupState $; + + public Builder() { + $ = new EnterpriseActionsRunnerGroupState(); + } + + public Builder(EnterpriseActionsRunnerGroupState defaults) { + $ = new EnterpriseActionsRunnerGroupState(Objects.requireNonNull(defaults)); + } + + /** + * @param allowsPublicRepositories Whether public repositories can be added to the runner group. Defaults to false. + * + * @return builder + * + */ + public Builder allowsPublicRepositories(@Nullable Output allowsPublicRepositories) { + $.allowsPublicRepositories = allowsPublicRepositories; + return this; + } + + /** + * @param allowsPublicRepositories Whether public repositories can be added to the runner group. Defaults to false. + * + * @return builder + * + */ + public Builder allowsPublicRepositories(Boolean allowsPublicRepositories) { + return allowsPublicRepositories(Output.of(allowsPublicRepositories)); + } + + /** + * @param default_ Whether this is the default runner group + * + * @return builder + * + */ + public Builder default_(@Nullable Output default_) { + $.default_ = default_; + return this; + } + + /** + * @param default_ Whether this is the default runner group + * + * @return builder + * + */ + public Builder default_(Boolean default_) { + return default_(Output.of(default_)); + } + + /** + * @param enterpriseSlug The slug of the enterprise. + * + * @return builder + * + */ + public Builder enterpriseSlug(@Nullable Output enterpriseSlug) { + $.enterpriseSlug = enterpriseSlug; + return this; + } + + /** + * @param enterpriseSlug The slug of the enterprise. + * + * @return builder + * + */ + public Builder enterpriseSlug(String enterpriseSlug) { + return enterpriseSlug(Output.of(enterpriseSlug)); + } + + /** + * @param etag An etag representing the runner group object + * + * @return builder + * + */ + public Builder etag(@Nullable Output etag) { + $.etag = etag; + return this; + } + + /** + * @param etag An etag representing the runner group object + * + * @return builder + * + */ + public Builder etag(String etag) { + return etag(Output.of(etag)); + } + + /** + * @param name Name of the runner group + * + * @return builder + * + */ + public Builder name(@Nullable Output name) { + $.name = name; + return this; + } + + /** + * @param name Name of the runner group + * + * @return builder + * + */ + public Builder name(String name) { + return name(Output.of(name)); + } + + /** + * @param restrictedToWorkflows If true, the runner group will be restricted to running only the workflows specified in the selected_workflows array. Defaults to false. + * + * @return builder + * + */ + public Builder restrictedToWorkflows(@Nullable Output restrictedToWorkflows) { + $.restrictedToWorkflows = restrictedToWorkflows; + return this; + } + + /** + * @param restrictedToWorkflows If true, the runner group will be restricted to running only the workflows specified in the selected_workflows array. Defaults to false. + * + * @return builder + * + */ + public Builder restrictedToWorkflows(Boolean restrictedToWorkflows) { + return restrictedToWorkflows(Output.of(restrictedToWorkflows)); + } + + /** + * @param runnersUrl The GitHub API URL for the runner group's runners + * + * @return builder + * + */ + public Builder runnersUrl(@Nullable Output runnersUrl) { + $.runnersUrl = runnersUrl; + return this; + } + + /** + * @param runnersUrl The GitHub API URL for the runner group's runners + * + * @return builder + * + */ + public Builder runnersUrl(String runnersUrl) { + return runnersUrl(Output.of(runnersUrl)); + } + + /** + * @param selectedOrganizationIds IDs of the organizations which should be added to the runner group + * + * @return builder + * + */ + public Builder selectedOrganizationIds(@Nullable Output> selectedOrganizationIds) { + $.selectedOrganizationIds = selectedOrganizationIds; + return this; + } + + /** + * @param selectedOrganizationIds IDs of the organizations which should be added to the runner group + * + * @return builder + * + */ + public Builder selectedOrganizationIds(List selectedOrganizationIds) { + return selectedOrganizationIds(Output.of(selectedOrganizationIds)); + } + + /** + * @param selectedOrganizationIds IDs of the organizations which should be added to the runner group + * + * @return builder + * + */ + public Builder selectedOrganizationIds(Integer... selectedOrganizationIds) { + return selectedOrganizationIds(List.of(selectedOrganizationIds)); + } + + /** + * @param selectedOrganizationsUrl The GitHub API URL for the runner group's selected organizations + * + * @return builder + * + */ + public Builder selectedOrganizationsUrl(@Nullable Output selectedOrganizationsUrl) { + $.selectedOrganizationsUrl = selectedOrganizationsUrl; + return this; + } + + /** + * @param selectedOrganizationsUrl The GitHub API URL for the runner group's selected organizations + * + * @return builder + * + */ + public Builder selectedOrganizationsUrl(String selectedOrganizationsUrl) { + return selectedOrganizationsUrl(Output.of(selectedOrganizationsUrl)); + } + + /** + * @param selectedWorkflows List of workflows the runner group should be allowed to run. This setting will be ignored unless restricted_to_workflows is set to true. + * + * @return builder + * + */ + public Builder selectedWorkflows(@Nullable Output> selectedWorkflows) { + $.selectedWorkflows = selectedWorkflows; + return this; + } + + /** + * @param selectedWorkflows List of workflows the runner group should be allowed to run. This setting will be ignored unless restricted_to_workflows is set to true. + * + * @return builder + * + */ + public Builder selectedWorkflows(List selectedWorkflows) { + return selectedWorkflows(Output.of(selectedWorkflows)); + } + + /** + * @param selectedWorkflows List of workflows the runner group should be allowed to run. This setting will be ignored unless restricted_to_workflows is set to true. + * + * @return builder + * + */ + public Builder selectedWorkflows(String... selectedWorkflows) { + return selectedWorkflows(List.of(selectedWorkflows)); + } + + /** + * @param visibility Visibility of a runner group to enterprise organizations. Whether the runner group can include `all` or `selected` + * + * @return builder + * + */ + public Builder visibility(@Nullable Output visibility) { + $.visibility = visibility; + return this; + } + + /** + * @param visibility Visibility of a runner group to enterprise organizations. Whether the runner group can include `all` or `selected` + * + * @return builder + * + */ + public Builder visibility(String visibility) { + return visibility(Output.of(visibility)); + } + + public EnterpriseActionsRunnerGroupState build() { + return $; + } + } + +} diff --git a/sdk/java/src/main/java/com/pulumi/github/inputs/EnterpriseOrganizationState.java b/sdk/java/src/main/java/com/pulumi/github/inputs/EnterpriseOrganizationState.java index 4bf7e3a3..b2d8479e 100644 --- a/sdk/java/src/main/java/com/pulumi/github/inputs/EnterpriseOrganizationState.java +++ b/sdk/java/src/main/java/com/pulumi/github/inputs/EnterpriseOrganizationState.java @@ -5,6 +5,7 @@ import com.pulumi.core.Output; import com.pulumi.core.annotations.Import; +import java.lang.Integer; import java.lang.String; import java.util.List; import java.util.Objects; @@ -46,6 +47,21 @@ public Optional> billingEmail() { return Optional.ofNullable(this.billingEmail); } + /** + * The ID of the organization. + * + */ + @Import(name="databaseId") + private @Nullable Output databaseId; + + /** + * @return The ID of the organization. + * + */ + public Optional> databaseId() { + return Optional.ofNullable(this.databaseId); + } + /** * The description of the organization. * @@ -111,6 +127,7 @@ private EnterpriseOrganizationState() {} private EnterpriseOrganizationState(EnterpriseOrganizationState $) { this.adminLogins = $.adminLogins; this.billingEmail = $.billingEmail; + this.databaseId = $.databaseId; this.description = $.description; this.displayName = $.displayName; this.enterpriseId = $.enterpriseId; @@ -187,6 +204,27 @@ public Builder billingEmail(String billingEmail) { return billingEmail(Output.of(billingEmail)); } + /** + * @param databaseId The ID of the organization. + * + * @return builder + * + */ + public Builder databaseId(@Nullable Output databaseId) { + $.databaseId = databaseId; + return this; + } + + /** + * @param databaseId The ID of the organization. + * + * @return builder + * + */ + public Builder databaseId(Integer databaseId) { + return databaseId(Output.of(databaseId)); + } + /** * @param description The description of the organization. * diff --git a/sdk/java/src/main/java/com/pulumi/github/outputs/BranchProtectionV3RequiredPullRequestReviews.java b/sdk/java/src/main/java/com/pulumi/github/outputs/BranchProtectionV3RequiredPullRequestReviews.java index 393bf86c..3c6a570f 100644 --- a/sdk/java/src/main/java/com/pulumi/github/outputs/BranchProtectionV3RequiredPullRequestReviews.java +++ b/sdk/java/src/main/java/com/pulumi/github/outputs/BranchProtectionV3RequiredPullRequestReviews.java @@ -53,6 +53,11 @@ public final class BranchProtectionV3RequiredPullRequestReviews { * */ private @Nullable Boolean requireCodeOwnerReviews; + /** + * @return Require that the most recent push must be approved by someone other than the last pusher. Defaults to `false` + * + */ + private @Nullable Boolean requireLastPushApproval; /** * @return Require x number of approvals to satisfy branch protection requirements. If this is specified it must be a number between 0-6. This requirement matches GitHub's API, see the upstream [documentation](https://developer.github.com/v3/repos/branches/#parameters-1) for more information. * @@ -112,6 +117,13 @@ public Optional includeAdmins() { public Optional requireCodeOwnerReviews() { return Optional.ofNullable(this.requireCodeOwnerReviews); } + /** + * @return Require that the most recent push must be approved by someone other than the last pusher. Defaults to `false` + * + */ + public Optional requireLastPushApproval() { + return Optional.ofNullable(this.requireLastPushApproval); + } /** * @return Require x number of approvals to satisfy branch protection requirements. If this is specified it must be a number between 0-6. This requirement matches GitHub's API, see the upstream [documentation](https://developer.github.com/v3/repos/branches/#parameters-1) for more information. * @@ -136,6 +148,7 @@ public static final class Builder { private @Nullable List dismissalUsers; private @Nullable Boolean includeAdmins; private @Nullable Boolean requireCodeOwnerReviews; + private @Nullable Boolean requireLastPushApproval; private @Nullable Integer requiredApprovingReviewCount; public Builder() {} public Builder(BranchProtectionV3RequiredPullRequestReviews defaults) { @@ -147,6 +160,7 @@ public Builder(BranchProtectionV3RequiredPullRequestReviews defaults) { this.dismissalUsers = defaults.dismissalUsers; this.includeAdmins = defaults.includeAdmins; this.requireCodeOwnerReviews = defaults.requireCodeOwnerReviews; + this.requireLastPushApproval = defaults.requireLastPushApproval; this.requiredApprovingReviewCount = defaults.requiredApprovingReviewCount; } @@ -202,6 +216,12 @@ public Builder requireCodeOwnerReviews(@Nullable Boolean requireCodeOwnerReviews return this; } @CustomType.Setter + public Builder requireLastPushApproval(@Nullable Boolean requireLastPushApproval) { + + this.requireLastPushApproval = requireLastPushApproval; + return this; + } + @CustomType.Setter public Builder requiredApprovingReviewCount(@Nullable Integer requiredApprovingReviewCount) { this.requiredApprovingReviewCount = requiredApprovingReviewCount; @@ -216,6 +236,7 @@ public BranchProtectionV3RequiredPullRequestReviews build() { _resultValue.dismissalUsers = dismissalUsers; _resultValue.includeAdmins = includeAdmins; _resultValue.requireCodeOwnerReviews = requireCodeOwnerReviews; + _resultValue.requireLastPushApproval = requireLastPushApproval; _resultValue.requiredApprovingReviewCount = requiredApprovingReviewCount; return _resultValue; } diff --git a/sdk/java/src/main/java/com/pulumi/github/outputs/GetEnterpriseResult.java b/sdk/java/src/main/java/com/pulumi/github/outputs/GetEnterpriseResult.java index 68c517b4..89dd0e72 100644 --- a/sdk/java/src/main/java/com/pulumi/github/outputs/GetEnterpriseResult.java +++ b/sdk/java/src/main/java/com/pulumi/github/outputs/GetEnterpriseResult.java @@ -5,6 +5,7 @@ import com.pulumi.core.annotations.CustomType; import com.pulumi.exceptions.MissingRequiredPropertyException; +import java.lang.Integer; import java.lang.String; import java.util.Objects; @@ -15,6 +16,11 @@ public final class GetEnterpriseResult { * */ private String createdAt; + /** + * @return The database ID of the enterprise. + * + */ + private Integer databaseId; /** * @return The description of the enterprise. * @@ -49,6 +55,13 @@ private GetEnterpriseResult() {} public String createdAt() { return this.createdAt; } + /** + * @return The database ID of the enterprise. + * + */ + public Integer databaseId() { + return this.databaseId; + } /** * @return The description of the enterprise. * @@ -95,6 +108,7 @@ public static Builder builder(GetEnterpriseResult defaults) { @CustomType.Builder public static final class Builder { private String createdAt; + private Integer databaseId; private String description; private String id; private String name; @@ -104,6 +118,7 @@ public Builder() {} public Builder(GetEnterpriseResult defaults) { Objects.requireNonNull(defaults); this.createdAt = defaults.createdAt; + this.databaseId = defaults.databaseId; this.description = defaults.description; this.id = defaults.id; this.name = defaults.name; @@ -120,6 +135,14 @@ public Builder createdAt(String createdAt) { return this; } @CustomType.Setter + public Builder databaseId(Integer databaseId) { + if (databaseId == null) { + throw new MissingRequiredPropertyException("GetEnterpriseResult", "databaseId"); + } + this.databaseId = databaseId; + return this; + } + @CustomType.Setter public Builder description(String description) { if (description == null) { throw new MissingRequiredPropertyException("GetEnterpriseResult", "description"); @@ -162,6 +185,7 @@ public Builder url(String url) { public GetEnterpriseResult build() { final var _resultValue = new GetEnterpriseResult(); _resultValue.createdAt = createdAt; + _resultValue.databaseId = databaseId; _resultValue.description = description; _resultValue.id = id; _resultValue.name = name; diff --git a/sdk/nodejs/enterpriseActionsRunnerGroup.ts b/sdk/nodejs/enterpriseActionsRunnerGroup.ts new file mode 100644 index 00000000..553e6692 --- /dev/null +++ b/sdk/nodejs/enterpriseActionsRunnerGroup.ts @@ -0,0 +1,249 @@ +// *** 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 GitHub Actions runner groups within your GitHub enterprise. + * You must have admin access to an enterprise to use this resource. + * + * ## Example Usage + * + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const enterprise = github.getEnterprise({ + * slug: "my-enterprise", + * }); + * const enterpriseOrganization = new github.EnterpriseOrganization("enterpriseOrganization", { + * enterpriseId: enterprise.then(enterprise => enterprise.id), + * billingEmail: "octocat@octo.cat", + * adminLogins: ["octocat"], + * }); + * const example = new github.EnterpriseActionsRunnerGroup("example", { + * enterpriseSlug: enterprise.then(enterprise => enterprise.slug), + * allowsPublicRepositories: true, + * visibility: "selected", + * selectedOrganizationIds: [enterpriseOrganization.databaseId], + * restrictedToWorkflows: true, + * selectedWorkflows: ["my-organization/my-repo/.github/workflows/cool-workflow.yaml@refs/tags/v1"], + * }); + * ``` + * + * + * ## Import + * + * This resource can be imported using the enterprise slug and the ID of the runner group: + * + * ```sh + * $ pulumi import github:index/enterpriseActionsRunnerGroup:EnterpriseActionsRunnerGroup test enterprise-slug/42 + * ``` + */ +export class EnterpriseActionsRunnerGroup extends pulumi.CustomResource { + /** + * Get an existing EnterpriseActionsRunnerGroup 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?: EnterpriseActionsRunnerGroupState, opts?: pulumi.CustomResourceOptions): EnterpriseActionsRunnerGroup { + return new EnterpriseActionsRunnerGroup(name, state, { ...opts, id: id }); + } + + /** @internal */ + public static readonly __pulumiType = 'github:index/enterpriseActionsRunnerGroup:EnterpriseActionsRunnerGroup'; + + /** + * Returns true if the given object is an instance of EnterpriseActionsRunnerGroup. 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 EnterpriseActionsRunnerGroup { + if (obj === undefined || obj === null) { + return false; + } + return obj['__pulumiType'] === EnterpriseActionsRunnerGroup.__pulumiType; + } + + /** + * Whether public repositories can be added to the runner group. Defaults to false. + */ + public readonly allowsPublicRepositories!: pulumi.Output; + /** + * Whether this is the default runner group + */ + public /*out*/ readonly default!: pulumi.Output; + /** + * The slug of the enterprise. + */ + public readonly enterpriseSlug!: pulumi.Output; + /** + * An etag representing the runner group object + */ + public /*out*/ readonly etag!: pulumi.Output; + /** + * Name of the runner group + */ + public readonly name!: pulumi.Output; + /** + * If true, the runner group will be restricted to running only the workflows specified in the selectedWorkflows array. Defaults to false. + */ + public readonly restrictedToWorkflows!: pulumi.Output; + /** + * The GitHub API URL for the runner group's runners + */ + public /*out*/ readonly runnersUrl!: pulumi.Output; + /** + * IDs of the organizations which should be added to the runner group + */ + public readonly selectedOrganizationIds!: pulumi.Output; + /** + * The GitHub API URL for the runner group's selected organizations + */ + public /*out*/ readonly selectedOrganizationsUrl!: pulumi.Output; + /** + * List of workflows the runner group should be allowed to run. This setting will be ignored unless restrictedToWorkflows is set to true. + */ + public readonly selectedWorkflows!: pulumi.Output; + /** + * Visibility of a runner group to enterprise organizations. Whether the runner group can include `all` or `selected` + */ + public readonly visibility!: pulumi.Output; + + /** + * Create a EnterpriseActionsRunnerGroup 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: EnterpriseActionsRunnerGroupArgs, opts?: pulumi.CustomResourceOptions) + constructor(name: string, argsOrState?: EnterpriseActionsRunnerGroupArgs | EnterpriseActionsRunnerGroupState, opts?: pulumi.CustomResourceOptions) { + let resourceInputs: pulumi.Inputs = {}; + opts = opts || {}; + if (opts.id) { + const state = argsOrState as EnterpriseActionsRunnerGroupState | undefined; + resourceInputs["allowsPublicRepositories"] = state ? state.allowsPublicRepositories : undefined; + resourceInputs["default"] = state ? state.default : undefined; + resourceInputs["enterpriseSlug"] = state ? state.enterpriseSlug : undefined; + resourceInputs["etag"] = state ? state.etag : undefined; + resourceInputs["name"] = state ? state.name : undefined; + resourceInputs["restrictedToWorkflows"] = state ? state.restrictedToWorkflows : undefined; + resourceInputs["runnersUrl"] = state ? state.runnersUrl : undefined; + resourceInputs["selectedOrganizationIds"] = state ? state.selectedOrganizationIds : undefined; + resourceInputs["selectedOrganizationsUrl"] = state ? state.selectedOrganizationsUrl : undefined; + resourceInputs["selectedWorkflows"] = state ? state.selectedWorkflows : undefined; + resourceInputs["visibility"] = state ? state.visibility : undefined; + } else { + const args = argsOrState as EnterpriseActionsRunnerGroupArgs | undefined; + if ((!args || args.enterpriseSlug === undefined) && !opts.urn) { + throw new Error("Missing required property 'enterpriseSlug'"); + } + if ((!args || args.visibility === undefined) && !opts.urn) { + throw new Error("Missing required property 'visibility'"); + } + resourceInputs["allowsPublicRepositories"] = args ? args.allowsPublicRepositories : undefined; + resourceInputs["enterpriseSlug"] = args ? args.enterpriseSlug : undefined; + resourceInputs["name"] = args ? args.name : undefined; + resourceInputs["restrictedToWorkflows"] = args ? args.restrictedToWorkflows : undefined; + resourceInputs["selectedOrganizationIds"] = args ? args.selectedOrganizationIds : undefined; + resourceInputs["selectedWorkflows"] = args ? args.selectedWorkflows : undefined; + resourceInputs["visibility"] = args ? args.visibility : undefined; + resourceInputs["default"] = undefined /*out*/; + resourceInputs["etag"] = undefined /*out*/; + resourceInputs["runnersUrl"] = undefined /*out*/; + resourceInputs["selectedOrganizationsUrl"] = undefined /*out*/; + } + opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); + super(EnterpriseActionsRunnerGroup.__pulumiType, name, resourceInputs, opts); + } +} + +/** + * Input properties used for looking up and filtering EnterpriseActionsRunnerGroup resources. + */ +export interface EnterpriseActionsRunnerGroupState { + /** + * Whether public repositories can be added to the runner group. Defaults to false. + */ + allowsPublicRepositories?: pulumi.Input; + /** + * Whether this is the default runner group + */ + default?: pulumi.Input; + /** + * The slug of the enterprise. + */ + enterpriseSlug?: pulumi.Input; + /** + * An etag representing the runner group object + */ + etag?: pulumi.Input; + /** + * Name of the runner group + */ + name?: pulumi.Input; + /** + * If true, the runner group will be restricted to running only the workflows specified in the selectedWorkflows array. Defaults to false. + */ + restrictedToWorkflows?: pulumi.Input; + /** + * The GitHub API URL for the runner group's runners + */ + runnersUrl?: pulumi.Input; + /** + * IDs of the organizations which should be added to the runner group + */ + selectedOrganizationIds?: pulumi.Input[]>; + /** + * The GitHub API URL for the runner group's selected organizations + */ + selectedOrganizationsUrl?: pulumi.Input; + /** + * List of workflows the runner group should be allowed to run. This setting will be ignored unless restrictedToWorkflows is set to true. + */ + selectedWorkflows?: pulumi.Input[]>; + /** + * Visibility of a runner group to enterprise organizations. Whether the runner group can include `all` or `selected` + */ + visibility?: pulumi.Input; +} + +/** + * The set of arguments for constructing a EnterpriseActionsRunnerGroup resource. + */ +export interface EnterpriseActionsRunnerGroupArgs { + /** + * Whether public repositories can be added to the runner group. Defaults to false. + */ + allowsPublicRepositories?: pulumi.Input; + /** + * The slug of the enterprise. + */ + enterpriseSlug: pulumi.Input; + /** + * Name of the runner group + */ + name?: pulumi.Input; + /** + * If true, the runner group will be restricted to running only the workflows specified in the selectedWorkflows array. Defaults to false. + */ + restrictedToWorkflows?: pulumi.Input; + /** + * IDs of the organizations which should be added to the runner group + */ + selectedOrganizationIds?: pulumi.Input[]>; + /** + * List of workflows the runner group should be allowed to run. This setting will be ignored unless restrictedToWorkflows is set to true. + */ + selectedWorkflows?: pulumi.Input[]>; + /** + * Visibility of a runner group to enterprise organizations. Whether the runner group can include `all` or `selected` + */ + visibility: pulumi.Input; +} diff --git a/sdk/nodejs/enterpriseOrganization.ts b/sdk/nodejs/enterpriseOrganization.ts index 876a4998..eca10a09 100644 --- a/sdk/nodejs/enterpriseOrganization.ts +++ b/sdk/nodejs/enterpriseOrganization.ts @@ -68,6 +68,10 @@ export class EnterpriseOrganization extends pulumi.CustomResource { * The billing email address. */ public readonly billingEmail!: pulumi.Output; + /** + * The ID of the organization. + */ + public /*out*/ readonly databaseId!: pulumi.Output; /** * The description of the organization. */ @@ -100,6 +104,7 @@ export class EnterpriseOrganization extends pulumi.CustomResource { const state = argsOrState as EnterpriseOrganizationState | undefined; resourceInputs["adminLogins"] = state ? state.adminLogins : undefined; resourceInputs["billingEmail"] = state ? state.billingEmail : undefined; + resourceInputs["databaseId"] = state ? state.databaseId : undefined; resourceInputs["description"] = state ? state.description : undefined; resourceInputs["displayName"] = state ? state.displayName : undefined; resourceInputs["enterpriseId"] = state ? state.enterpriseId : undefined; @@ -121,6 +126,7 @@ export class EnterpriseOrganization extends pulumi.CustomResource { resourceInputs["displayName"] = args ? args.displayName : undefined; resourceInputs["enterpriseId"] = args ? args.enterpriseId : undefined; resourceInputs["name"] = args ? args.name : undefined; + resourceInputs["databaseId"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(EnterpriseOrganization.__pulumiType, name, resourceInputs, opts); @@ -139,6 +145,10 @@ export interface EnterpriseOrganizationState { * The billing email address. */ billingEmail?: pulumi.Input; + /** + * The ID of the organization. + */ + databaseId?: pulumi.Input; /** * The description of the organization. */ diff --git a/sdk/nodejs/getEnterprise.ts b/sdk/nodejs/getEnterprise.ts index 55952f64..175138a1 100644 --- a/sdk/nodejs/getEnterprise.ts +++ b/sdk/nodejs/getEnterprise.ts @@ -46,6 +46,10 @@ export interface GetEnterpriseResult { * The time the enterprise was created. */ readonly createdAt: string; + /** + * The database ID of the enterprise. + */ + readonly databaseId: number; /** * The description of the enterprise. */ diff --git a/sdk/nodejs/index.ts b/sdk/nodejs/index.ts index 5448fce3..19236736 100644 --- a/sdk/nodejs/index.ts +++ b/sdk/nodejs/index.ts @@ -145,6 +145,11 @@ export type EnterpriseActionsPermissions = import("./enterpriseActionsPermission export const EnterpriseActionsPermissions: typeof import("./enterpriseActionsPermissions").EnterpriseActionsPermissions = null as any; utilities.lazyLoad(exports, ["EnterpriseActionsPermissions"], () => require("./enterpriseActionsPermissions")); +export { EnterpriseActionsRunnerGroupArgs, EnterpriseActionsRunnerGroupState } from "./enterpriseActionsRunnerGroup"; +export type EnterpriseActionsRunnerGroup = import("./enterpriseActionsRunnerGroup").EnterpriseActionsRunnerGroup; +export const EnterpriseActionsRunnerGroup: typeof import("./enterpriseActionsRunnerGroup").EnterpriseActionsRunnerGroup = null as any; +utilities.lazyLoad(exports, ["EnterpriseActionsRunnerGroup"], () => require("./enterpriseActionsRunnerGroup")); + export { EnterpriseOrganizationArgs, EnterpriseOrganizationState } from "./enterpriseOrganization"; export type EnterpriseOrganization = import("./enterpriseOrganization").EnterpriseOrganization; export const EnterpriseOrganization: typeof import("./enterpriseOrganization").EnterpriseOrganization = null as any; @@ -730,6 +735,8 @@ const _module = { return new EmuGroupMapping(name, undefined, { urn }) case "github:index/enterpriseActionsPermissions:EnterpriseActionsPermissions": return new EnterpriseActionsPermissions(name, undefined, { urn }) + case "github:index/enterpriseActionsRunnerGroup:EnterpriseActionsRunnerGroup": + return new EnterpriseActionsRunnerGroup(name, undefined, { urn }) case "github:index/enterpriseOrganization:EnterpriseOrganization": return new EnterpriseOrganization(name, undefined, { urn }) case "github:index/issue:Issue": @@ -845,6 +852,7 @@ pulumi.runtime.registerResourceModule("github", "index/dependabotOrganizationSec pulumi.runtime.registerResourceModule("github", "index/dependabotSecret", _module) pulumi.runtime.registerResourceModule("github", "index/emuGroupMapping", _module) pulumi.runtime.registerResourceModule("github", "index/enterpriseActionsPermissions", _module) +pulumi.runtime.registerResourceModule("github", "index/enterpriseActionsRunnerGroup", _module) pulumi.runtime.registerResourceModule("github", "index/enterpriseOrganization", _module) pulumi.runtime.registerResourceModule("github", "index/issue", _module) pulumi.runtime.registerResourceModule("github", "index/issueLabel", _module) diff --git a/sdk/nodejs/tsconfig.json b/sdk/nodejs/tsconfig.json index 5db7975f..6bbdbd1c 100644 --- a/sdk/nodejs/tsconfig.json +++ b/sdk/nodejs/tsconfig.json @@ -43,6 +43,7 @@ "dependabotSecret.ts", "emuGroupMapping.ts", "enterpriseActionsPermissions.ts", + "enterpriseActionsRunnerGroup.ts", "enterpriseOrganization.ts", "getActionsEnvironmentSecrets.ts", "getActionsEnvironmentVariables.ts", diff --git a/sdk/nodejs/types/input.ts b/sdk/nodejs/types/input.ts index 097ec9ab..136200b6 100644 --- a/sdk/nodejs/types/input.ts +++ b/sdk/nodejs/types/input.ts @@ -131,6 +131,10 @@ export interface BranchProtectionV3RequiredPullRequestReviews { * Require an approved review in pull requests including files with a designated code owner. Defaults to `false`. */ requireCodeOwnerReviews?: pulumi.Input; + /** + * Require that the most recent push must be approved by someone other than the last pusher. Defaults to `false` + */ + requireLastPushApproval?: pulumi.Input; /** * Require x number of approvals to satisfy branch protection requirements. If this is specified it must be a number between 0-6. This requirement matches GitHub's API, see the upstream [documentation](https://developer.github.com/v3/repos/branches/#parameters-1) for more information. */ diff --git a/sdk/nodejs/types/output.ts b/sdk/nodejs/types/output.ts index 0ddf2361..79976835 100644 --- a/sdk/nodejs/types/output.ts +++ b/sdk/nodejs/types/output.ts @@ -131,6 +131,10 @@ export interface BranchProtectionV3RequiredPullRequestReviews { * Require an approved review in pull requests including files with a designated code owner. Defaults to `false`. */ requireCodeOwnerReviews?: boolean; + /** + * Require that the most recent push must be approved by someone other than the last pusher. Defaults to `false` + */ + requireLastPushApproval?: boolean; /** * Require x number of approvals to satisfy branch protection requirements. If this is specified it must be a number between 0-6. This requirement matches GitHub's API, see the upstream [documentation](https://developer.github.com/v3/repos/branches/#parameters-1) for more information. */ diff --git a/sdk/python/pulumi_github/__init__.py b/sdk/python/pulumi_github/__init__.py index e19846a4..03b2012e 100644 --- a/sdk/python/pulumi_github/__init__.py +++ b/sdk/python/pulumi_github/__init__.py @@ -33,6 +33,7 @@ from .dependabot_secret import * from .emu_group_mapping import * from .enterprise_actions_permissions import * +from .enterprise_actions_runner_group import * from .enterprise_organization import * from .get_actions_environment_secrets import * from .get_actions_environment_variables import * @@ -373,6 +374,14 @@ "github:index/enterpriseActionsPermissions:EnterpriseActionsPermissions": "EnterpriseActionsPermissions" } }, + { + "pkg": "github", + "mod": "index/enterpriseActionsRunnerGroup", + "fqn": "pulumi_github", + "classes": { + "github:index/enterpriseActionsRunnerGroup:EnterpriseActionsRunnerGroup": "EnterpriseActionsRunnerGroup" + } + }, { "pkg": "github", "mod": "index/enterpriseOrganization", diff --git a/sdk/python/pulumi_github/_inputs.py b/sdk/python/pulumi_github/_inputs.py index b1eef14e..5ca6adeb 100644 --- a/sdk/python/pulumi_github/_inputs.py +++ b/sdk/python/pulumi_github/_inputs.py @@ -419,6 +419,7 @@ def __init__(__self__, *, dismissal_users: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None, include_admins: Optional[pulumi.Input[bool]] = None, require_code_owner_reviews: Optional[pulumi.Input[bool]] = None, + require_last_push_approval: Optional[pulumi.Input[bool]] = None, required_approving_review_count: Optional[pulumi.Input[int]] = None): """ :param pulumi.Input['BranchProtectionV3RequiredPullRequestReviewsBypassPullRequestAllowancesArgs'] bypass_pull_request_allowances: Allow specific users, teams, or apps to bypass pull request requirements. See Bypass Pull Request Allowances below for details. @@ -428,6 +429,7 @@ def __init__(__self__, *, Always use `slug` of the team, **not** its name. Each team already **has** to have access to the repository. :param pulumi.Input[Sequence[pulumi.Input[str]]] dismissal_users: The list of user logins with dismissal access :param pulumi.Input[bool] require_code_owner_reviews: Require an approved review in pull requests including files with a designated code owner. Defaults to `false`. + :param pulumi.Input[bool] require_last_push_approval: Require that the most recent push must be approved by someone other than the last pusher. Defaults to `false` :param pulumi.Input[int] required_approving_review_count: Require x number of approvals to satisfy branch protection requirements. If this is specified it must be a number between 0-6. This requirement matches GitHub's API, see the upstream [documentation](https://developer.github.com/v3/repos/branches/#parameters-1) for more information. """ if bypass_pull_request_allowances is not None: @@ -447,6 +449,8 @@ def __init__(__self__, *, pulumi.set(__self__, "include_admins", include_admins) if require_code_owner_reviews is not None: pulumi.set(__self__, "require_code_owner_reviews", require_code_owner_reviews) + if require_last_push_approval is not None: + pulumi.set(__self__, "require_last_push_approval", require_last_push_approval) if required_approving_review_count is not None: pulumi.set(__self__, "required_approving_review_count", required_approving_review_count) @@ -535,6 +539,18 @@ def require_code_owner_reviews(self) -> Optional[pulumi.Input[bool]]: def require_code_owner_reviews(self, value: Optional[pulumi.Input[bool]]): pulumi.set(self, "require_code_owner_reviews", value) + @property + @pulumi.getter(name="requireLastPushApproval") + def require_last_push_approval(self) -> Optional[pulumi.Input[bool]]: + """ + Require that the most recent push must be approved by someone other than the last pusher. Defaults to `false` + """ + return pulumi.get(self, "require_last_push_approval") + + @require_last_push_approval.setter + def require_last_push_approval(self, value: Optional[pulumi.Input[bool]]): + pulumi.set(self, "require_last_push_approval", value) + @property @pulumi.getter(name="requiredApprovingReviewCount") def required_approving_review_count(self) -> Optional[pulumi.Input[int]]: diff --git a/sdk/python/pulumi_github/enterprise_actions_runner_group.py b/sdk/python/pulumi_github/enterprise_actions_runner_group.py new file mode 100644 index 00000000..48fcb335 --- /dev/null +++ b/sdk/python/pulumi_github/enterprise_actions_runner_group.py @@ -0,0 +1,603 @@ +# 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 pulumi +import pulumi.runtime +from typing import Any, Mapping, Optional, Sequence, Union, overload +from . import _utilities + +__all__ = ['EnterpriseActionsRunnerGroupArgs', 'EnterpriseActionsRunnerGroup'] + +@pulumi.input_type +class EnterpriseActionsRunnerGroupArgs: + def __init__(__self__, *, + enterprise_slug: pulumi.Input[str], + visibility: pulumi.Input[str], + allows_public_repositories: Optional[pulumi.Input[bool]] = None, + name: Optional[pulumi.Input[str]] = None, + restricted_to_workflows: Optional[pulumi.Input[bool]] = None, + selected_organization_ids: Optional[pulumi.Input[Sequence[pulumi.Input[int]]]] = None, + selected_workflows: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None): + """ + The set of arguments for constructing a EnterpriseActionsRunnerGroup resource. + :param pulumi.Input[str] enterprise_slug: The slug of the enterprise. + :param pulumi.Input[str] visibility: Visibility of a runner group to enterprise organizations. Whether the runner group can include `all` or `selected` + :param pulumi.Input[bool] allows_public_repositories: Whether public repositories can be added to the runner group. Defaults to false. + :param pulumi.Input[str] name: Name of the runner group + :param pulumi.Input[bool] restricted_to_workflows: If true, the runner group will be restricted to running only the workflows specified in the selected_workflows array. Defaults to false. + :param pulumi.Input[Sequence[pulumi.Input[int]]] selected_organization_ids: IDs of the organizations which should be added to the runner group + :param pulumi.Input[Sequence[pulumi.Input[str]]] selected_workflows: List of workflows the runner group should be allowed to run. This setting will be ignored unless restricted_to_workflows is set to true. + """ + pulumi.set(__self__, "enterprise_slug", enterprise_slug) + pulumi.set(__self__, "visibility", visibility) + if allows_public_repositories is not None: + pulumi.set(__self__, "allows_public_repositories", allows_public_repositories) + if name is not None: + pulumi.set(__self__, "name", name) + if restricted_to_workflows is not None: + pulumi.set(__self__, "restricted_to_workflows", restricted_to_workflows) + if selected_organization_ids is not None: + pulumi.set(__self__, "selected_organization_ids", selected_organization_ids) + if selected_workflows is not None: + pulumi.set(__self__, "selected_workflows", selected_workflows) + + @property + @pulumi.getter(name="enterpriseSlug") + def enterprise_slug(self) -> pulumi.Input[str]: + """ + The slug of the enterprise. + """ + return pulumi.get(self, "enterprise_slug") + + @enterprise_slug.setter + def enterprise_slug(self, value: pulumi.Input[str]): + pulumi.set(self, "enterprise_slug", value) + + @property + @pulumi.getter + def visibility(self) -> pulumi.Input[str]: + """ + Visibility of a runner group to enterprise organizations. Whether the runner group can include `all` or `selected` + """ + return pulumi.get(self, "visibility") + + @visibility.setter + def visibility(self, value: pulumi.Input[str]): + pulumi.set(self, "visibility", value) + + @property + @pulumi.getter(name="allowsPublicRepositories") + def allows_public_repositories(self) -> Optional[pulumi.Input[bool]]: + """ + Whether public repositories can be added to the runner group. Defaults to false. + """ + return pulumi.get(self, "allows_public_repositories") + + @allows_public_repositories.setter + def allows_public_repositories(self, value: Optional[pulumi.Input[bool]]): + pulumi.set(self, "allows_public_repositories", value) + + @property + @pulumi.getter + def name(self) -> Optional[pulumi.Input[str]]: + """ + Name of the runner group + """ + return pulumi.get(self, "name") + + @name.setter + def name(self, value: Optional[pulumi.Input[str]]): + pulumi.set(self, "name", value) + + @property + @pulumi.getter(name="restrictedToWorkflows") + def restricted_to_workflows(self) -> Optional[pulumi.Input[bool]]: + """ + If true, the runner group will be restricted to running only the workflows specified in the selected_workflows array. Defaults to false. + """ + return pulumi.get(self, "restricted_to_workflows") + + @restricted_to_workflows.setter + def restricted_to_workflows(self, value: Optional[pulumi.Input[bool]]): + pulumi.set(self, "restricted_to_workflows", value) + + @property + @pulumi.getter(name="selectedOrganizationIds") + def selected_organization_ids(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[int]]]]: + """ + IDs of the organizations which should be added to the runner group + """ + return pulumi.get(self, "selected_organization_ids") + + @selected_organization_ids.setter + def selected_organization_ids(self, value: Optional[pulumi.Input[Sequence[pulumi.Input[int]]]]): + pulumi.set(self, "selected_organization_ids", value) + + @property + @pulumi.getter(name="selectedWorkflows") + def selected_workflows(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]: + """ + List of workflows the runner group should be allowed to run. This setting will be ignored unless restricted_to_workflows is set to true. + """ + return pulumi.get(self, "selected_workflows") + + @selected_workflows.setter + def selected_workflows(self, value: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]): + pulumi.set(self, "selected_workflows", value) + + +@pulumi.input_type +class _EnterpriseActionsRunnerGroupState: + def __init__(__self__, *, + allows_public_repositories: Optional[pulumi.Input[bool]] = None, + default: Optional[pulumi.Input[bool]] = None, + enterprise_slug: Optional[pulumi.Input[str]] = None, + etag: Optional[pulumi.Input[str]] = None, + name: Optional[pulumi.Input[str]] = None, + restricted_to_workflows: Optional[pulumi.Input[bool]] = None, + runners_url: Optional[pulumi.Input[str]] = None, + selected_organization_ids: Optional[pulumi.Input[Sequence[pulumi.Input[int]]]] = None, + selected_organizations_url: Optional[pulumi.Input[str]] = None, + selected_workflows: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None, + visibility: Optional[pulumi.Input[str]] = None): + """ + Input properties used for looking up and filtering EnterpriseActionsRunnerGroup resources. + :param pulumi.Input[bool] allows_public_repositories: Whether public repositories can be added to the runner group. Defaults to false. + :param pulumi.Input[bool] default: Whether this is the default runner group + :param pulumi.Input[str] enterprise_slug: The slug of the enterprise. + :param pulumi.Input[str] etag: An etag representing the runner group object + :param pulumi.Input[str] name: Name of the runner group + :param pulumi.Input[bool] restricted_to_workflows: If true, the runner group will be restricted to running only the workflows specified in the selected_workflows array. Defaults to false. + :param pulumi.Input[str] runners_url: The GitHub API URL for the runner group's runners + :param pulumi.Input[Sequence[pulumi.Input[int]]] selected_organization_ids: IDs of the organizations which should be added to the runner group + :param pulumi.Input[str] selected_organizations_url: The GitHub API URL for the runner group's selected organizations + :param pulumi.Input[Sequence[pulumi.Input[str]]] selected_workflows: List of workflows the runner group should be allowed to run. This setting will be ignored unless restricted_to_workflows is set to true. + :param pulumi.Input[str] visibility: Visibility of a runner group to enterprise organizations. Whether the runner group can include `all` or `selected` + """ + if allows_public_repositories is not None: + pulumi.set(__self__, "allows_public_repositories", allows_public_repositories) + if default is not None: + pulumi.set(__self__, "default", default) + if enterprise_slug is not None: + pulumi.set(__self__, "enterprise_slug", enterprise_slug) + if etag is not None: + pulumi.set(__self__, "etag", etag) + if name is not None: + pulumi.set(__self__, "name", name) + if restricted_to_workflows is not None: + pulumi.set(__self__, "restricted_to_workflows", restricted_to_workflows) + if runners_url is not None: + pulumi.set(__self__, "runners_url", runners_url) + if selected_organization_ids is not None: + pulumi.set(__self__, "selected_organization_ids", selected_organization_ids) + if selected_organizations_url is not None: + pulumi.set(__self__, "selected_organizations_url", selected_organizations_url) + if selected_workflows is not None: + pulumi.set(__self__, "selected_workflows", selected_workflows) + if visibility is not None: + pulumi.set(__self__, "visibility", visibility) + + @property + @pulumi.getter(name="allowsPublicRepositories") + def allows_public_repositories(self) -> Optional[pulumi.Input[bool]]: + """ + Whether public repositories can be added to the runner group. Defaults to false. + """ + return pulumi.get(self, "allows_public_repositories") + + @allows_public_repositories.setter + def allows_public_repositories(self, value: Optional[pulumi.Input[bool]]): + pulumi.set(self, "allows_public_repositories", value) + + @property + @pulumi.getter + def default(self) -> Optional[pulumi.Input[bool]]: + """ + Whether this is the default runner group + """ + return pulumi.get(self, "default") + + @default.setter + def default(self, value: Optional[pulumi.Input[bool]]): + pulumi.set(self, "default", value) + + @property + @pulumi.getter(name="enterpriseSlug") + def enterprise_slug(self) -> Optional[pulumi.Input[str]]: + """ + The slug of the enterprise. + """ + return pulumi.get(self, "enterprise_slug") + + @enterprise_slug.setter + def enterprise_slug(self, value: Optional[pulumi.Input[str]]): + pulumi.set(self, "enterprise_slug", value) + + @property + @pulumi.getter + def etag(self) -> Optional[pulumi.Input[str]]: + """ + An etag representing the runner group object + """ + return pulumi.get(self, "etag") + + @etag.setter + def etag(self, value: Optional[pulumi.Input[str]]): + pulumi.set(self, "etag", value) + + @property + @pulumi.getter + def name(self) -> Optional[pulumi.Input[str]]: + """ + Name of the runner group + """ + return pulumi.get(self, "name") + + @name.setter + def name(self, value: Optional[pulumi.Input[str]]): + pulumi.set(self, "name", value) + + @property + @pulumi.getter(name="restrictedToWorkflows") + def restricted_to_workflows(self) -> Optional[pulumi.Input[bool]]: + """ + If true, the runner group will be restricted to running only the workflows specified in the selected_workflows array. Defaults to false. + """ + return pulumi.get(self, "restricted_to_workflows") + + @restricted_to_workflows.setter + def restricted_to_workflows(self, value: Optional[pulumi.Input[bool]]): + pulumi.set(self, "restricted_to_workflows", value) + + @property + @pulumi.getter(name="runnersUrl") + def runners_url(self) -> Optional[pulumi.Input[str]]: + """ + The GitHub API URL for the runner group's runners + """ + return pulumi.get(self, "runners_url") + + @runners_url.setter + def runners_url(self, value: Optional[pulumi.Input[str]]): + pulumi.set(self, "runners_url", value) + + @property + @pulumi.getter(name="selectedOrganizationIds") + def selected_organization_ids(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[int]]]]: + """ + IDs of the organizations which should be added to the runner group + """ + return pulumi.get(self, "selected_organization_ids") + + @selected_organization_ids.setter + def selected_organization_ids(self, value: Optional[pulumi.Input[Sequence[pulumi.Input[int]]]]): + pulumi.set(self, "selected_organization_ids", value) + + @property + @pulumi.getter(name="selectedOrganizationsUrl") + def selected_organizations_url(self) -> Optional[pulumi.Input[str]]: + """ + The GitHub API URL for the runner group's selected organizations + """ + return pulumi.get(self, "selected_organizations_url") + + @selected_organizations_url.setter + def selected_organizations_url(self, value: Optional[pulumi.Input[str]]): + pulumi.set(self, "selected_organizations_url", value) + + @property + @pulumi.getter(name="selectedWorkflows") + def selected_workflows(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]: + """ + List of workflows the runner group should be allowed to run. This setting will be ignored unless restricted_to_workflows is set to true. + """ + return pulumi.get(self, "selected_workflows") + + @selected_workflows.setter + def selected_workflows(self, value: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]): + pulumi.set(self, "selected_workflows", value) + + @property + @pulumi.getter + def visibility(self) -> Optional[pulumi.Input[str]]: + """ + Visibility of a runner group to enterprise organizations. Whether the runner group can include `all` or `selected` + """ + return pulumi.get(self, "visibility") + + @visibility.setter + def visibility(self, value: Optional[pulumi.Input[str]]): + pulumi.set(self, "visibility", value) + + +class EnterpriseActionsRunnerGroup(pulumi.CustomResource): + @overload + def __init__(__self__, + resource_name: str, + opts: Optional[pulumi.ResourceOptions] = None, + allows_public_repositories: Optional[pulumi.Input[bool]] = None, + enterprise_slug: Optional[pulumi.Input[str]] = None, + name: Optional[pulumi.Input[str]] = None, + restricted_to_workflows: Optional[pulumi.Input[bool]] = None, + selected_organization_ids: Optional[pulumi.Input[Sequence[pulumi.Input[int]]]] = None, + selected_workflows: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None, + visibility: Optional[pulumi.Input[str]] = None, + __props__=None): + """ + This resource allows you to create and manage GitHub Actions runner groups within your GitHub enterprise. + You must have admin access to an enterprise to use this resource. + + ## Example Usage + + + ```python + import pulumi + import pulumi_github as github + + enterprise = github.get_enterprise(slug="my-enterprise") + enterprise_organization = github.EnterpriseOrganization("enterpriseOrganization", + enterprise_id=enterprise.id, + billing_email="octocat@octo.cat", + admin_logins=["octocat"]) + example = github.EnterpriseActionsRunnerGroup("example", + enterprise_slug=enterprise.slug, + allows_public_repositories=True, + visibility="selected", + selected_organization_ids=[enterprise_organization.database_id], + restricted_to_workflows=True, + selected_workflows=["my-organization/my-repo/.github/workflows/cool-workflow.yaml@refs/tags/v1"]) + ``` + + + ## Import + + This resource can be imported using the enterprise slug and the ID of the runner group: + + ```sh + $ pulumi import github:index/enterpriseActionsRunnerGroup:EnterpriseActionsRunnerGroup test enterprise-slug/42 + ``` + + :param str resource_name: The name of the resource. + :param pulumi.ResourceOptions opts: Options for the resource. + :param pulumi.Input[bool] allows_public_repositories: Whether public repositories can be added to the runner group. Defaults to false. + :param pulumi.Input[str] enterprise_slug: The slug of the enterprise. + :param pulumi.Input[str] name: Name of the runner group + :param pulumi.Input[bool] restricted_to_workflows: If true, the runner group will be restricted to running only the workflows specified in the selected_workflows array. Defaults to false. + :param pulumi.Input[Sequence[pulumi.Input[int]]] selected_organization_ids: IDs of the organizations which should be added to the runner group + :param pulumi.Input[Sequence[pulumi.Input[str]]] selected_workflows: List of workflows the runner group should be allowed to run. This setting will be ignored unless restricted_to_workflows is set to true. + :param pulumi.Input[str] visibility: Visibility of a runner group to enterprise organizations. Whether the runner group can include `all` or `selected` + """ + ... + @overload + def __init__(__self__, + resource_name: str, + args: EnterpriseActionsRunnerGroupArgs, + opts: Optional[pulumi.ResourceOptions] = None): + """ + This resource allows you to create and manage GitHub Actions runner groups within your GitHub enterprise. + You must have admin access to an enterprise to use this resource. + + ## Example Usage + + + ```python + import pulumi + import pulumi_github as github + + enterprise = github.get_enterprise(slug="my-enterprise") + enterprise_organization = github.EnterpriseOrganization("enterpriseOrganization", + enterprise_id=enterprise.id, + billing_email="octocat@octo.cat", + admin_logins=["octocat"]) + example = github.EnterpriseActionsRunnerGroup("example", + enterprise_slug=enterprise.slug, + allows_public_repositories=True, + visibility="selected", + selected_organization_ids=[enterprise_organization.database_id], + restricted_to_workflows=True, + selected_workflows=["my-organization/my-repo/.github/workflows/cool-workflow.yaml@refs/tags/v1"]) + ``` + + + ## Import + + This resource can be imported using the enterprise slug and the ID of the runner group: + + ```sh + $ pulumi import github:index/enterpriseActionsRunnerGroup:EnterpriseActionsRunnerGroup test enterprise-slug/42 + ``` + + :param str resource_name: The name of the resource. + :param EnterpriseActionsRunnerGroupArgs 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(EnterpriseActionsRunnerGroupArgs, 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, + allows_public_repositories: Optional[pulumi.Input[bool]] = None, + enterprise_slug: Optional[pulumi.Input[str]] = None, + name: Optional[pulumi.Input[str]] = None, + restricted_to_workflows: Optional[pulumi.Input[bool]] = None, + selected_organization_ids: Optional[pulumi.Input[Sequence[pulumi.Input[int]]]] = None, + selected_workflows: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None, + visibility: 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__ = EnterpriseActionsRunnerGroupArgs.__new__(EnterpriseActionsRunnerGroupArgs) + + __props__.__dict__["allows_public_repositories"] = allows_public_repositories + if enterprise_slug is None and not opts.urn: + raise TypeError("Missing required property 'enterprise_slug'") + __props__.__dict__["enterprise_slug"] = enterprise_slug + __props__.__dict__["name"] = name + __props__.__dict__["restricted_to_workflows"] = restricted_to_workflows + __props__.__dict__["selected_organization_ids"] = selected_organization_ids + __props__.__dict__["selected_workflows"] = selected_workflows + if visibility is None and not opts.urn: + raise TypeError("Missing required property 'visibility'") + __props__.__dict__["visibility"] = visibility + __props__.__dict__["default"] = None + __props__.__dict__["etag"] = None + __props__.__dict__["runners_url"] = None + __props__.__dict__["selected_organizations_url"] = None + super(EnterpriseActionsRunnerGroup, __self__).__init__( + 'github:index/enterpriseActionsRunnerGroup:EnterpriseActionsRunnerGroup', + resource_name, + __props__, + opts) + + @staticmethod + def get(resource_name: str, + id: pulumi.Input[str], + opts: Optional[pulumi.ResourceOptions] = None, + allows_public_repositories: Optional[pulumi.Input[bool]] = None, + default: Optional[pulumi.Input[bool]] = None, + enterprise_slug: Optional[pulumi.Input[str]] = None, + etag: Optional[pulumi.Input[str]] = None, + name: Optional[pulumi.Input[str]] = None, + restricted_to_workflows: Optional[pulumi.Input[bool]] = None, + runners_url: Optional[pulumi.Input[str]] = None, + selected_organization_ids: Optional[pulumi.Input[Sequence[pulumi.Input[int]]]] = None, + selected_organizations_url: Optional[pulumi.Input[str]] = None, + selected_workflows: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None, + visibility: Optional[pulumi.Input[str]] = None) -> 'EnterpriseActionsRunnerGroup': + """ + Get an existing EnterpriseActionsRunnerGroup 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[bool] allows_public_repositories: Whether public repositories can be added to the runner group. Defaults to false. + :param pulumi.Input[bool] default: Whether this is the default runner group + :param pulumi.Input[str] enterprise_slug: The slug of the enterprise. + :param pulumi.Input[str] etag: An etag representing the runner group object + :param pulumi.Input[str] name: Name of the runner group + :param pulumi.Input[bool] restricted_to_workflows: If true, the runner group will be restricted to running only the workflows specified in the selected_workflows array. Defaults to false. + :param pulumi.Input[str] runners_url: The GitHub API URL for the runner group's runners + :param pulumi.Input[Sequence[pulumi.Input[int]]] selected_organization_ids: IDs of the organizations which should be added to the runner group + :param pulumi.Input[str] selected_organizations_url: The GitHub API URL for the runner group's selected organizations + :param pulumi.Input[Sequence[pulumi.Input[str]]] selected_workflows: List of workflows the runner group should be allowed to run. This setting will be ignored unless restricted_to_workflows is set to true. + :param pulumi.Input[str] visibility: Visibility of a runner group to enterprise organizations. Whether the runner group can include `all` or `selected` + """ + opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id)) + + __props__ = _EnterpriseActionsRunnerGroupState.__new__(_EnterpriseActionsRunnerGroupState) + + __props__.__dict__["allows_public_repositories"] = allows_public_repositories + __props__.__dict__["default"] = default + __props__.__dict__["enterprise_slug"] = enterprise_slug + __props__.__dict__["etag"] = etag + __props__.__dict__["name"] = name + __props__.__dict__["restricted_to_workflows"] = restricted_to_workflows + __props__.__dict__["runners_url"] = runners_url + __props__.__dict__["selected_organization_ids"] = selected_organization_ids + __props__.__dict__["selected_organizations_url"] = selected_organizations_url + __props__.__dict__["selected_workflows"] = selected_workflows + __props__.__dict__["visibility"] = visibility + return EnterpriseActionsRunnerGroup(resource_name, opts=opts, __props__=__props__) + + @property + @pulumi.getter(name="allowsPublicRepositories") + def allows_public_repositories(self) -> pulumi.Output[Optional[bool]]: + """ + Whether public repositories can be added to the runner group. Defaults to false. + """ + return pulumi.get(self, "allows_public_repositories") + + @property + @pulumi.getter + def default(self) -> pulumi.Output[bool]: + """ + Whether this is the default runner group + """ + return pulumi.get(self, "default") + + @property + @pulumi.getter(name="enterpriseSlug") + def enterprise_slug(self) -> pulumi.Output[str]: + """ + The slug of the enterprise. + """ + return pulumi.get(self, "enterprise_slug") + + @property + @pulumi.getter + def etag(self) -> pulumi.Output[str]: + """ + An etag representing the runner group object + """ + return pulumi.get(self, "etag") + + @property + @pulumi.getter + def name(self) -> pulumi.Output[str]: + """ + Name of the runner group + """ + return pulumi.get(self, "name") + + @property + @pulumi.getter(name="restrictedToWorkflows") + def restricted_to_workflows(self) -> pulumi.Output[Optional[bool]]: + """ + If true, the runner group will be restricted to running only the workflows specified in the selected_workflows array. Defaults to false. + """ + return pulumi.get(self, "restricted_to_workflows") + + @property + @pulumi.getter(name="runnersUrl") + def runners_url(self) -> pulumi.Output[str]: + """ + The GitHub API URL for the runner group's runners + """ + return pulumi.get(self, "runners_url") + + @property + @pulumi.getter(name="selectedOrganizationIds") + def selected_organization_ids(self) -> pulumi.Output[Optional[Sequence[int]]]: + """ + IDs of the organizations which should be added to the runner group + """ + return pulumi.get(self, "selected_organization_ids") + + @property + @pulumi.getter(name="selectedOrganizationsUrl") + def selected_organizations_url(self) -> pulumi.Output[str]: + """ + The GitHub API URL for the runner group's selected organizations + """ + return pulumi.get(self, "selected_organizations_url") + + @property + @pulumi.getter(name="selectedWorkflows") + def selected_workflows(self) -> pulumi.Output[Optional[Sequence[str]]]: + """ + List of workflows the runner group should be allowed to run. This setting will be ignored unless restricted_to_workflows is set to true. + """ + return pulumi.get(self, "selected_workflows") + + @property + @pulumi.getter + def visibility(self) -> pulumi.Output[str]: + """ + Visibility of a runner group to enterprise organizations. Whether the runner group can include `all` or `selected` + """ + return pulumi.get(self, "visibility") + diff --git a/sdk/python/pulumi_github/enterprise_organization.py b/sdk/python/pulumi_github/enterprise_organization.py index 1c3c3331..5c1c252c 100644 --- a/sdk/python/pulumi_github/enterprise_organization.py +++ b/sdk/python/pulumi_github/enterprise_organization.py @@ -117,6 +117,7 @@ class _EnterpriseOrganizationState: def __init__(__self__, *, admin_logins: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None, billing_email: Optional[pulumi.Input[str]] = None, + database_id: Optional[pulumi.Input[int]] = None, description: Optional[pulumi.Input[str]] = None, display_name: Optional[pulumi.Input[str]] = None, enterprise_id: Optional[pulumi.Input[str]] = None, @@ -125,6 +126,7 @@ def __init__(__self__, *, Input properties used for looking up and filtering EnterpriseOrganization resources. :param pulumi.Input[Sequence[pulumi.Input[str]]] admin_logins: List of organization owner usernames. :param pulumi.Input[str] billing_email: The billing email address. + :param pulumi.Input[int] database_id: The ID of the organization. :param pulumi.Input[str] description: The description of the organization. :param pulumi.Input[str] display_name: The display name of the organization. :param pulumi.Input[str] enterprise_id: The ID of the enterprise. @@ -134,6 +136,8 @@ def __init__(__self__, *, pulumi.set(__self__, "admin_logins", admin_logins) if billing_email is not None: pulumi.set(__self__, "billing_email", billing_email) + if database_id is not None: + pulumi.set(__self__, "database_id", database_id) if description is not None: pulumi.set(__self__, "description", description) if display_name is not None: @@ -167,6 +171,18 @@ def billing_email(self) -> Optional[pulumi.Input[str]]: def billing_email(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "billing_email", value) + @property + @pulumi.getter(name="databaseId") + def database_id(self) -> Optional[pulumi.Input[int]]: + """ + The ID of the organization. + """ + return pulumi.get(self, "database_id") + + @database_id.setter + def database_id(self, value: Optional[pulumi.Input[int]]): + pulumi.set(self, "database_id", value) + @property @pulumi.getter def description(self) -> Optional[pulumi.Input[str]]: @@ -339,6 +355,7 @@ def _internal_init(__self__, raise TypeError("Missing required property 'enterprise_id'") __props__.__dict__["enterprise_id"] = enterprise_id __props__.__dict__["name"] = name + __props__.__dict__["database_id"] = None super(EnterpriseOrganization, __self__).__init__( 'github:index/enterpriseOrganization:EnterpriseOrganization', resource_name, @@ -351,6 +368,7 @@ def get(resource_name: str, opts: Optional[pulumi.ResourceOptions] = None, admin_logins: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None, billing_email: Optional[pulumi.Input[str]] = None, + database_id: Optional[pulumi.Input[int]] = None, description: Optional[pulumi.Input[str]] = None, display_name: Optional[pulumi.Input[str]] = None, enterprise_id: Optional[pulumi.Input[str]] = None, @@ -364,6 +382,7 @@ def get(resource_name: str, :param pulumi.ResourceOptions opts: Options for the resource. :param pulumi.Input[Sequence[pulumi.Input[str]]] admin_logins: List of organization owner usernames. :param pulumi.Input[str] billing_email: The billing email address. + :param pulumi.Input[int] database_id: The ID of the organization. :param pulumi.Input[str] description: The description of the organization. :param pulumi.Input[str] display_name: The display name of the organization. :param pulumi.Input[str] enterprise_id: The ID of the enterprise. @@ -375,6 +394,7 @@ def get(resource_name: str, __props__.__dict__["admin_logins"] = admin_logins __props__.__dict__["billing_email"] = billing_email + __props__.__dict__["database_id"] = database_id __props__.__dict__["description"] = description __props__.__dict__["display_name"] = display_name __props__.__dict__["enterprise_id"] = enterprise_id @@ -397,6 +417,14 @@ def billing_email(self) -> pulumi.Output[str]: """ return pulumi.get(self, "billing_email") + @property + @pulumi.getter(name="databaseId") + def database_id(self) -> pulumi.Output[int]: + """ + The ID of the organization. + """ + return pulumi.get(self, "database_id") + @property @pulumi.getter def description(self) -> pulumi.Output[Optional[str]]: diff --git a/sdk/python/pulumi_github/get_enterprise.py b/sdk/python/pulumi_github/get_enterprise.py index 695c43fc..eb6b8ff1 100644 --- a/sdk/python/pulumi_github/get_enterprise.py +++ b/sdk/python/pulumi_github/get_enterprise.py @@ -21,10 +21,13 @@ class GetEnterpriseResult: """ A collection of values returned by getEnterprise. """ - def __init__(__self__, created_at=None, description=None, id=None, name=None, slug=None, url=None): + def __init__(__self__, created_at=None, database_id=None, description=None, id=None, name=None, slug=None, url=None): if created_at and not isinstance(created_at, str): raise TypeError("Expected argument 'created_at' to be a str") pulumi.set(__self__, "created_at", created_at) + if database_id and not isinstance(database_id, int): + raise TypeError("Expected argument 'database_id' to be a int") + pulumi.set(__self__, "database_id", database_id) if description and not isinstance(description, str): raise TypeError("Expected argument 'description' to be a str") pulumi.set(__self__, "description", description) @@ -49,6 +52,14 @@ def created_at(self) -> str: """ return pulumi.get(self, "created_at") + @property + @pulumi.getter(name="databaseId") + def database_id(self) -> int: + """ + The database ID of the enterprise. + """ + return pulumi.get(self, "database_id") + @property @pulumi.getter def description(self) -> str: @@ -97,6 +108,7 @@ def __await__(self): yield self return GetEnterpriseResult( created_at=self.created_at, + database_id=self.database_id, description=self.description, id=self.id, name=self.name, @@ -130,6 +142,7 @@ def get_enterprise(slug: Optional[str] = None, return AwaitableGetEnterpriseResult( created_at=pulumi.get(__ret__, 'created_at'), + database_id=pulumi.get(__ret__, 'database_id'), description=pulumi.get(__ret__, 'description'), id=pulumi.get(__ret__, 'id'), name=pulumi.get(__ret__, 'name'), diff --git a/sdk/python/pulumi_github/outputs.py b/sdk/python/pulumi_github/outputs.py index c5a0cac5..84850acc 100644 --- a/sdk/python/pulumi_github/outputs.py +++ b/sdk/python/pulumi_github/outputs.py @@ -499,6 +499,8 @@ def __key_warning(key: str): suggest = "include_admins" elif key == "requireCodeOwnerReviews": suggest = "require_code_owner_reviews" + elif key == "requireLastPushApproval": + suggest = "require_last_push_approval" elif key == "requiredApprovingReviewCount": suggest = "required_approving_review_count" @@ -521,6 +523,7 @@ def __init__(__self__, *, dismissal_users: Optional[Sequence[str]] = None, include_admins: Optional[bool] = None, require_code_owner_reviews: Optional[bool] = None, + require_last_push_approval: Optional[bool] = None, required_approving_review_count: Optional[int] = None): """ :param 'BranchProtectionV3RequiredPullRequestReviewsBypassPullRequestAllowancesArgs' bypass_pull_request_allowances: Allow specific users, teams, or apps to bypass pull request requirements. See Bypass Pull Request Allowances below for details. @@ -530,6 +533,7 @@ def __init__(__self__, *, Always use `slug` of the team, **not** its name. Each team already **has** to have access to the repository. :param Sequence[str] dismissal_users: The list of user logins with dismissal access :param bool require_code_owner_reviews: Require an approved review in pull requests including files with a designated code owner. Defaults to `false`. + :param bool require_last_push_approval: Require that the most recent push must be approved by someone other than the last pusher. Defaults to `false` :param int required_approving_review_count: Require x number of approvals to satisfy branch protection requirements. If this is specified it must be a number between 0-6. This requirement matches GitHub's API, see the upstream [documentation](https://developer.github.com/v3/repos/branches/#parameters-1) for more information. """ if bypass_pull_request_allowances is not None: @@ -546,6 +550,8 @@ def __init__(__self__, *, pulumi.set(__self__, "include_admins", include_admins) if require_code_owner_reviews is not None: pulumi.set(__self__, "require_code_owner_reviews", require_code_owner_reviews) + if require_last_push_approval is not None: + pulumi.set(__self__, "require_last_push_approval", require_last_push_approval) if required_approving_review_count is not None: pulumi.set(__self__, "required_approving_review_count", required_approving_review_count) @@ -606,6 +612,14 @@ def require_code_owner_reviews(self) -> Optional[bool]: """ return pulumi.get(self, "require_code_owner_reviews") + @property + @pulumi.getter(name="requireLastPushApproval") + def require_last_push_approval(self) -> Optional[bool]: + """ + Require that the most recent push must be approved by someone other than the last pusher. Defaults to `false` + """ + return pulumi.get(self, "require_last_push_approval") + @property @pulumi.getter(name="requiredApprovingReviewCount") def required_approving_review_count(self) -> Optional[int]: diff --git a/upstream b/upstream index dd57a50f..e1f5feb6 160000 --- a/upstream +++ b/upstream @@ -1 +1 @@ -Subproject commit dd57a50fc5136dc20ce4f4fb22126bfceedf5ab2 +Subproject commit e1f5feb680d80d23367040f6c0362efa0952024a