diff --git a/provider/go.mod b/provider/go.mod index cde82969..46d9cc94 100644 --- a/provider/go.mod +++ b/provider/go.mod @@ -5,7 +5,7 @@ go 1.21 require ( github.com/hashicorp/terraform-plugin-sdk v1.17.2 github.com/integrations/terraform-provider-github/v5 v5.40.0 - github.com/pulumi/pulumi-terraform-bridge/v3 v3.63.0 + github.com/pulumi/pulumi-terraform-bridge/v3 v3.63.1 github.com/pulumi/pulumi/sdk/v3 v3.90.1 ) diff --git a/provider/go.sum b/provider/go.sum index 71626e11..8e3aa912 100644 --- a/provider/go.sum +++ b/provider/go.sum @@ -1991,8 +1991,8 @@ github.com/pulumi/pulumi-java/pkg v0.9.8 h1:c8mYsalnRXA2Ibgvv6scefOn6mW1Vb0UT0mc github.com/pulumi/pulumi-java/pkg v0.9.8/go.mod h1:c6rSw/+q4O0IImgJ9axxoC6QesbPYWBaG5gimbHouUQ= github.com/pulumi/pulumi-terraform-bridge/testing v0.0.1 h1:SCg1gjfY9N4yn8U8peIUYATifjoDABkyR7H9lmefsfc= github.com/pulumi/pulumi-terraform-bridge/testing v0.0.1/go.mod h1:7OeUPH8rpt5ipyj9EFcnXpuzQ8SHL0dyqdfa8nOacdk= -github.com/pulumi/pulumi-terraform-bridge/v3 v3.63.0 h1:otdmkNsMGyZ+proUZClznZo+cEchkSSkmaGcq+Gf+6s= -github.com/pulumi/pulumi-terraform-bridge/v3 v3.63.0/go.mod h1:6YVbDo019OeHkQWo9MnUbBy6cCgCQeoXZDjmR9SYmUA= +github.com/pulumi/pulumi-terraform-bridge/v3 v3.63.1 h1:hBgediyT2LdS5yfD5AMiCmBJ/TYP94Xxv6a4TcAfV0g= +github.com/pulumi/pulumi-terraform-bridge/v3 v3.63.1/go.mod h1:6YVbDo019OeHkQWo9MnUbBy6cCgCQeoXZDjmR9SYmUA= github.com/pulumi/pulumi-terraform-bridge/x/muxer v0.0.4 h1:rIzMmtcVpPX8ynaz6/nW5AHNY63DiNfCohqmxWvMpM4= github.com/pulumi/pulumi-terraform-bridge/x/muxer v0.0.4/go.mod h1:Kt8RIZWa/N8rW3+0g6NrqCBmF3o+HuIhFaZpssEkG6w= github.com/pulumi/pulumi-yaml v1.2.2 h1:W6BeUBLhDrJ2GSU0em1AUVelG9PBI4ABY61DdhJOO3E= diff --git a/sdk/dotnet/ActionsEnvironmentSecret.cs b/sdk/dotnet/ActionsEnvironmentSecret.cs index d8a5107c..f3d30b38 100644 --- a/sdk/dotnet/ActionsEnvironmentSecret.cs +++ b/sdk/dotnet/ActionsEnvironmentSecret.cs @@ -10,6 +10,63 @@ namespace Pulumi.Github { /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleSecretActionsEnvironmentSecret = new Github.ActionsEnvironmentSecret("exampleSecretActionsEnvironmentSecret", new() + /// { + /// Environment = "example_environment", + /// SecretName = "example_secret_name", + /// PlaintextValue = @var.Some_secret_string, + /// }); + /// + /// var exampleSecretIndex_actionsEnvironmentSecretActionsEnvironmentSecret = new Github.ActionsEnvironmentSecret("exampleSecretIndex/actionsEnvironmentSecretActionsEnvironmentSecret", new() + /// { + /// Environment = "example_environment", + /// SecretName = "example_secret_name", + /// EncryptedValue = @var.Some_encrypted_secret_string, + /// }); + /// + /// }); + /// ``` + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var repo = Github.GetRepository.Invoke(new() + /// { + /// FullName = "my-org/repo", + /// }); + /// + /// var repoEnvironment = new Github.RepositoryEnvironment("repoEnvironment", new() + /// { + /// Repository = repo.Apply(getRepositoryResult => getRepositoryResult.Name), + /// Environment = "example_environment", + /// }); + /// + /// var testSecret = new Github.ActionsEnvironmentSecret("testSecret", new() + /// { + /// Repository = repo.Apply(getRepositoryResult => getRepositoryResult.Name), + /// Environment = repoEnvironment.Environment, + /// SecretName = "test_secret_name", + /// PlaintextValue = "%s", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// This resource does not support importing. If you'd like to help contribute it, please visit our [GitHub page](https://github.com/integrations/terraform-provider-github)! diff --git a/sdk/dotnet/ActionsEnvironmentVariable.cs b/sdk/dotnet/ActionsEnvironmentVariable.cs index 99b6ad17..30616970 100644 --- a/sdk/dotnet/ActionsEnvironmentVariable.cs +++ b/sdk/dotnet/ActionsEnvironmentVariable.cs @@ -13,6 +13,56 @@ namespace Pulumi.Github /// This resource allows you to create and manage GitHub Actions variables within your GitHub repository environments. /// You must have write access to a repository to use this resource. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleVariable = new Github.ActionsEnvironmentVariable("exampleVariable", new() + /// { + /// Environment = "example_environment", + /// Value = "example_variable_value", + /// VariableName = "example_variable_name", + /// }); + /// + /// }); + /// ``` + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var repo = Github.GetRepository.Invoke(new() + /// { + /// FullName = "my-org/repo", + /// }); + /// + /// var repoEnvironment = new Github.RepositoryEnvironment("repoEnvironment", new() + /// { + /// Repository = repo.Apply(getRepositoryResult => getRepositoryResult.Name), + /// Environment = "example_environment", + /// }); + /// + /// var exampleVariable = new Github.ActionsEnvironmentVariable("exampleVariable", new() + /// { + /// Repository = repo.Apply(getRepositoryResult => getRepositoryResult.Name), + /// Environment = repoEnvironment.Environment, + /// VariableName = "example_variable_name", + /// Value = "example_variable_value", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// This resource can be imported using an ID made up of the repository name, environment name, and variable name: diff --git a/sdk/dotnet/ActionsOrganizationOidcSubjectClaimCustomizationTemplate.cs b/sdk/dotnet/ActionsOrganizationOidcSubjectClaimCustomizationTemplate.cs index bf100736..fa424a8a 100644 --- a/sdk/dotnet/ActionsOrganizationOidcSubjectClaimCustomizationTemplate.cs +++ b/sdk/dotnet/ActionsOrganizationOidcSubjectClaimCustomizationTemplate.cs @@ -16,6 +16,29 @@ namespace Pulumi.Github /// More information on integrating GitHub with cloud providers using OpenID Connect and a list of available claims is /// available in the [Actions documentation](https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/about-security-hardening-with-openid-connect). /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleTemplate = new Github.ActionsOrganizationOidcSubjectClaimCustomizationTemplate("exampleTemplate", new() + /// { + /// IncludeClaimKeys = new[] + /// { + /// "actor", + /// "context", + /// "repository_owner", + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// This resource can be imported using the organization's name. diff --git a/sdk/dotnet/ActionsOrganizationPermissions.cs b/sdk/dotnet/ActionsOrganizationPermissions.cs index 7b702c06..90a06a69 100644 --- a/sdk/dotnet/ActionsOrganizationPermissions.cs +++ b/sdk/dotnet/ActionsOrganizationPermissions.cs @@ -13,6 +13,44 @@ namespace Pulumi.Github /// This resource allows you to create and manage GitHub Actions permissions within your GitHub enterprise organizations. /// You must have admin access to an organization to use this resource. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = new Github.Repository("example"); + /// + /// var test = new Github.ActionsOrganizationPermissions("test", new() + /// { + /// AllowedActions = "selected", + /// EnabledRepositories = "selected", + /// AllowedActionsConfig = new Github.Inputs.ActionsOrganizationPermissionsAllowedActionsConfigArgs + /// { + /// GithubOwnedAllowed = true, + /// PatternsAlloweds = new[] + /// { + /// "actions/cache@*", + /// "actions/checkout@*", + /// }, + /// VerifiedAllowed = true, + /// }, + /// EnabledRepositoriesConfig = new Github.Inputs.ActionsOrganizationPermissionsEnabledRepositoriesConfigArgs + /// { + /// RepositoryIds = new[] + /// { + /// example.RepoId, + /// }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// This resource can be imported using the ID of the GitHub organization: diff --git a/sdk/dotnet/ActionsOrganizationSecret.cs b/sdk/dotnet/ActionsOrganizationSecret.cs index f385e55c..e44784bf 100644 --- a/sdk/dotnet/ActionsOrganizationSecret.cs +++ b/sdk/dotnet/ActionsOrganizationSecret.cs @@ -10,6 +10,71 @@ namespace Pulumi.Github { /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleSecretActionsOrganizationSecret = new Github.ActionsOrganizationSecret("exampleSecretActionsOrganizationSecret", new() + /// { + /// SecretName = "example_secret_name", + /// Visibility = "private", + /// PlaintextValue = @var.Some_secret_string, + /// }); + /// + /// var exampleSecretIndex_actionsOrganizationSecretActionsOrganizationSecret = new Github.ActionsOrganizationSecret("exampleSecretIndex/actionsOrganizationSecretActionsOrganizationSecret", new() + /// { + /// SecretName = "example_secret_name", + /// Visibility = "private", + /// EncryptedValue = @var.Some_encrypted_secret_string, + /// }); + /// + /// }); + /// ``` + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var repo = Github.GetRepository.Invoke(new() + /// { + /// FullName = "my-org/repo", + /// }); + /// + /// var exampleSecretActionsOrganizationSecret = new Github.ActionsOrganizationSecret("exampleSecretActionsOrganizationSecret", new() + /// { + /// SecretName = "example_secret_name", + /// Visibility = "selected", + /// PlaintextValue = @var.Some_secret_string, + /// SelectedRepositoryIds = new[] + /// { + /// repo.Apply(getRepositoryResult => getRepositoryResult.RepoId), + /// }, + /// }); + /// + /// var exampleSecretIndex_actionsOrganizationSecretActionsOrganizationSecret = new Github.ActionsOrganizationSecret("exampleSecretIndex/actionsOrganizationSecretActionsOrganizationSecret", new() + /// { + /// SecretName = "example_secret_name", + /// Visibility = "selected", + /// EncryptedValue = @var.Some_encrypted_secret_string, + /// SelectedRepositoryIds = new[] + /// { + /// repo.Apply(getRepositoryResult => getRepositoryResult.RepoId), + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// This resource can be imported using an ID made up of the secret name: diff --git a/sdk/dotnet/ActionsOrganizationSecretRepositories.cs b/sdk/dotnet/ActionsOrganizationSecretRepositories.cs index 07769a12..3f582789 100644 --- a/sdk/dotnet/ActionsOrganizationSecretRepositories.cs +++ b/sdk/dotnet/ActionsOrganizationSecretRepositories.cs @@ -15,6 +15,33 @@ namespace Pulumi.Github /// /// This resource is only applicable when `visibility` of the existing organization secret has been set to `selected`. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var repo = Github.GetRepository.Invoke(new() + /// { + /// FullName = "my-org/repo", + /// }); + /// + /// var orgSecretRepos = new Github.ActionsOrganizationSecretRepositories("orgSecretRepos", new() + /// { + /// SecretName = "existing_secret_name", + /// SelectedRepositoryIds = new[] + /// { + /// repo.Apply(getRepositoryResult => getRepositoryResult.RepoId), + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// This resource can be imported using an ID made up of the secret name: diff --git a/sdk/dotnet/ActionsOrganizationVariable.cs b/sdk/dotnet/ActionsOrganizationVariable.cs index 849f6cfa..6dc6bbf1 100644 --- a/sdk/dotnet/ActionsOrganizationVariable.cs +++ b/sdk/dotnet/ActionsOrganizationVariable.cs @@ -13,6 +13,53 @@ namespace Pulumi.Github /// This resource allows you to create and manage GitHub Actions variables within your GitHub organization. /// You must have write access to a repository to use this resource. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleVariable = new Github.ActionsOrganizationVariable("exampleVariable", new() + /// { + /// Value = "example_variable_value", + /// VariableName = "example_variable_name", + /// Visibility = "private", + /// }); + /// + /// }); + /// ``` + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var repo = Github.GetRepository.Invoke(new() + /// { + /// FullName = "my-org/repo", + /// }); + /// + /// var exampleVariable = new Github.ActionsOrganizationVariable("exampleVariable", new() + /// { + /// VariableName = "example_variable_name", + /// Visibility = "selected", + /// Value = "example_variable_value", + /// SelectedRepositoryIds = new[] + /// { + /// repo.Apply(getRepositoryResult => getRepositoryResult.RepoId), + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// This resource can be imported using an ID made up of the variable name: diff --git a/sdk/dotnet/ActionsRepositoryAccessLevel.cs b/sdk/dotnet/ActionsRepositoryAccessLevel.cs index 82afab45..307ff39c 100644 --- a/sdk/dotnet/ActionsRepositoryAccessLevel.cs +++ b/sdk/dotnet/ActionsRepositoryAccessLevel.cs @@ -13,6 +13,30 @@ namespace Pulumi.Github /// This resource allows you to set the access level of a non-public repositories actions and reusable workflows for use in other repositories. /// You must have admin access to a repository to use this resource. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = new Github.Repository("example", new() + /// { + /// Visibility = "private", + /// }); + /// + /// var test = new Github.ActionsRepositoryAccessLevel("test", new() + /// { + /// AccessLevel = "user", + /// Repository = example.Name, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// This resource can be imported using the name of the GitHub repository: diff --git a/sdk/dotnet/ActionsRepositoryOidcSubjectClaimCustomizationTemplate.cs b/sdk/dotnet/ActionsRepositoryOidcSubjectClaimCustomizationTemplate.cs index 82a905ec..ada9db3b 100644 --- a/sdk/dotnet/ActionsRepositoryOidcSubjectClaimCustomizationTemplate.cs +++ b/sdk/dotnet/ActionsRepositoryOidcSubjectClaimCustomizationTemplate.cs @@ -24,6 +24,33 @@ namespace Pulumi.Github /// | `false` | Set | `include_claim_keys` | /// | `false` | Unset | Organization's default if set, otherwise GitHub's default | /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = new Github.Repository("example"); + /// + /// var exampleTemplate = new Github.ActionsRepositoryOidcSubjectClaimCustomizationTemplate("exampleTemplate", new() + /// { + /// Repository = example.Name, + /// UseDefault = false, + /// IncludeClaimKeys = new[] + /// { + /// "actor", + /// "context", + /// "repository_owner", + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// This resource can be imported using the repository's name. diff --git a/sdk/dotnet/ActionsRepositoryPermissions.cs b/sdk/dotnet/ActionsRepositoryPermissions.cs index da934fac..d0631f7c 100644 --- a/sdk/dotnet/ActionsRepositoryPermissions.cs +++ b/sdk/dotnet/ActionsRepositoryPermissions.cs @@ -13,6 +13,37 @@ namespace Pulumi.Github /// This resource allows you to enable and manage GitHub Actions permissions for a given repository. /// You must have admin access to an repository to use this resource. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = new Github.Repository("example"); + /// + /// var test = new Github.ActionsRepositoryPermissions("test", new() + /// { + /// AllowedActions = "selected", + /// AllowedActionsConfig = new Github.Inputs.ActionsRepositoryPermissionsAllowedActionsConfigArgs + /// { + /// GithubOwnedAllowed = true, + /// PatternsAlloweds = new[] + /// { + /// "actions/cache@*", + /// "actions/checkout@*", + /// }, + /// VerifiedAllowed = true, + /// }, + /// Repository = example.Name, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// This resource can be imported using the name of the GitHub repository: diff --git a/sdk/dotnet/ActionsRunnerGroup.cs b/sdk/dotnet/ActionsRunnerGroup.cs index a835fa7c..670dd96e 100644 --- a/sdk/dotnet/ActionsRunnerGroup.cs +++ b/sdk/dotnet/ActionsRunnerGroup.cs @@ -13,6 +13,30 @@ namespace Pulumi.Github /// This resource allows you to create and manage GitHub Actions runner groups within your GitHub enterprise organizations. /// You must have admin access to an organization to use this resource. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleRepository = new Github.Repository("exampleRepository"); + /// + /// var exampleActionsRunnerGroup = new Github.ActionsRunnerGroup("exampleActionsRunnerGroup", new() + /// { + /// Visibility = "selected", + /// SelectedRepositoryIds = new[] + /// { + /// exampleRepository.RepoId, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// This resource can be imported using the ID of the runner group: diff --git a/sdk/dotnet/ActionsSecret.cs b/sdk/dotnet/ActionsSecret.cs index e41af0e6..82f21d8c 100644 --- a/sdk/dotnet/ActionsSecret.cs +++ b/sdk/dotnet/ActionsSecret.cs @@ -10,6 +10,38 @@ namespace Pulumi.Github { /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var examplePublicKey = Github.GetActionsPublicKey.Invoke(new() + /// { + /// Repository = "example_repository", + /// }); + /// + /// var exampleSecretActionsSecret = new Github.ActionsSecret("exampleSecretActionsSecret", new() + /// { + /// Repository = "example_repository", + /// SecretName = "example_secret_name", + /// PlaintextValue = @var.Some_secret_string, + /// }); + /// + /// var exampleSecretIndex_actionsSecretActionsSecret = new Github.ActionsSecret("exampleSecretIndex/actionsSecretActionsSecret", new() + /// { + /// Repository = "example_repository", + /// SecretName = "example_secret_name", + /// EncryptedValue = @var.Some_encrypted_secret_string, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// This resource can be imported using an ID made up of the `repository` and `secret_name`: diff --git a/sdk/dotnet/ActionsVariable.cs b/sdk/dotnet/ActionsVariable.cs index ed0303f4..52800607 100644 --- a/sdk/dotnet/ActionsVariable.cs +++ b/sdk/dotnet/ActionsVariable.cs @@ -13,6 +13,26 @@ namespace Pulumi.Github /// This resource allows you to create and manage GitHub Actions variables within your GitHub repositories. /// You must have write access to a repository to use this resource. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleVariable = new Github.ActionsVariable("exampleVariable", new() + /// { + /// Repository = "example_repository", + /// Value = "example_variable_value", + /// VariableName = "example_variable_name", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// GitHub Actions variables can be imported using an ID made up of `repository:variable_name`, e.g. diff --git a/sdk/dotnet/AppInstallationRepository.cs b/sdk/dotnet/AppInstallationRepository.cs index be051e95..30c06de5 100644 --- a/sdk/dotnet/AppInstallationRepository.cs +++ b/sdk/dotnet/AppInstallationRepository.cs @@ -22,6 +22,28 @@ namespace Pulumi.Github /// by the following the instructions at this /// [link](https://docs.github.com/en/github/setting-up-and-managing-organizations-and-teams/reviewing-your-organizations-installed-integrations). /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// // Create a repository. + /// var someRepo = new Github.Repository("someRepo"); + /// + /// var someAppRepo = new Github.AppInstallationRepository("someAppRepo", new() + /// { + /// InstallationId = "1234567", + /// Repository = someRepo.Name, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// GitHub App Installation Repository can be imported using an ID made up of `installation_id:repository`, e.g. diff --git a/sdk/dotnet/Branch.cs b/sdk/dotnet/Branch.cs index 1ae8b3ca..cdd6cd86 100644 --- a/sdk/dotnet/Branch.cs +++ b/sdk/dotnet/Branch.cs @@ -15,6 +15,25 @@ namespace Pulumi.Github /// Additional constraints can be applied to ensure your branch is created from /// another branch or commit. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var development = new Github.Branch("development", new() + /// { + /// BranchName = "development", + /// Repository = "example", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// GitHub Branch can be imported using an ID made up of `repository:branch`, e.g. diff --git a/sdk/dotnet/BranchDefault.cs b/sdk/dotnet/BranchDefault.cs index f21a681d..fb63e8a6 100644 --- a/sdk/dotnet/BranchDefault.cs +++ b/sdk/dotnet/BranchDefault.cs @@ -16,6 +16,65 @@ namespace Pulumi.Github /// /// Note that use of this resource is incompatible with the `default_branch` option of the `github.Repository` resource. Using both will result in plans always showing a diff. /// + /// ## Example Usage + /// + /// Basic usage: + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = new Github.Repository("example", new() + /// { + /// Description = "My awesome codebase", + /// AutoInit = true, + /// }); + /// + /// var development = new Github.Branch("development", new() + /// { + /// Repository = example.Name, + /// BranchName = "development", + /// }); + /// + /// var @default = new Github.BranchDefault("default", new() + /// { + /// Repository = example.Name, + /// Branch = development.BranchName, + /// }); + /// + /// }); + /// ``` + /// + /// Renaming to a branch that doesn't exist: + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = new Github.Repository("example", new() + /// { + /// Description = "My awesome codebase", + /// AutoInit = true, + /// }); + /// + /// var @default = new Github.BranchDefault("default", new() + /// { + /// Repository = example.Name, + /// Branch = "development", + /// Rename = true, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// GitHub Branch Defaults can be imported using an ID made up of `repository`, e.g. diff --git a/sdk/dotnet/BranchProtection.cs b/sdk/dotnet/BranchProtection.cs index 3458a603..dcb6554c 100644 --- a/sdk/dotnet/BranchProtection.cs +++ b/sdk/dotnet/BranchProtection.cs @@ -10,6 +10,84 @@ namespace Pulumi.Github { /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleRepository = new Github.Repository("exampleRepository"); + /// + /// var exampleUser = Github.GetUser.Invoke(new() + /// { + /// Username = "example", + /// }); + /// + /// var exampleTeam = new Github.Team("exampleTeam"); + /// + /// // Protect the main branch of the foo repository. Additionally, require that + /// // the "ci/travis" context to be passing and only allow the engineers team merge + /// // to the branch. + /// var exampleBranchProtection = new Github.BranchProtection("exampleBranchProtection", new() + /// { + /// RepositoryId = exampleRepository.NodeId, + /// Pattern = "main", + /// EnforceAdmins = true, + /// AllowsDeletions = true, + /// RequiredStatusChecks = new[] + /// { + /// new Github.Inputs.BranchProtectionRequiredStatusCheckArgs + /// { + /// Strict = false, + /// Contexts = new[] + /// { + /// "ci/travis", + /// }, + /// }, + /// }, + /// RequiredPullRequestReviews = new[] + /// { + /// new Github.Inputs.BranchProtectionRequiredPullRequestReviewArgs + /// { + /// DismissStaleReviews = true, + /// RestrictDismissals = true, + /// DismissalRestrictions = new[] + /// { + /// exampleUser.Apply(getUserResult => getUserResult.NodeId), + /// exampleTeam.NodeId, + /// "/exampleuser", + /// "exampleorganization/exampleteam", + /// }, + /// }, + /// }, + /// PushRestrictions = new[] + /// { + /// exampleUser.Apply(getUserResult => getUserResult.NodeId), + /// "/exampleuser", + /// "exampleorganization/exampleteam", + /// }, + /// ForcePushBypassers = new[] + /// { + /// exampleUser.Apply(getUserResult => getUserResult.NodeId), + /// "/exampleuser", + /// "exampleorganization/exampleteam", + /// }, + /// }); + /// + /// var exampleTeamRepository = new Github.TeamRepository("exampleTeamRepository", new() + /// { + /// TeamId = exampleTeam.Id, + /// Repository = exampleRepository.Name, + /// Permission = "pull", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// GitHub Branch Protection can be imported using an ID made up of `repository:pattern`, e.g. diff --git a/sdk/dotnet/BranchProtectionV3.cs b/sdk/dotnet/BranchProtectionV3.cs index d0b846e6..d2a613de 100644 --- a/sdk/dotnet/BranchProtectionV3.cs +++ b/sdk/dotnet/BranchProtectionV3.cs @@ -16,6 +16,115 @@ namespace Pulumi.Github /// /// This resource allows you to configure branch protection for repositories in your organization. When applied, the branch will be protected from forced pushes and deletion. Additional constraints, such as required status checks or restrictions on users, teams, and apps, can also be configured. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// // Protect the main branch of the foo repository. Only allow a specific user to merge to the branch. + /// var example = new Github.BranchProtectionV3("example", new() + /// { + /// Repository = github_repository.Example.Name, + /// Branch = "main", + /// Restrictions = new Github.Inputs.BranchProtectionV3RestrictionsArgs + /// { + /// Users = new[] + /// { + /// "foo-user", + /// }, + /// }, + /// }); + /// + /// }); + /// ``` + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleRepository = new Github.Repository("exampleRepository"); + /// + /// var exampleTeam = new Github.Team("exampleTeam"); + /// + /// // Protect the main branch of the foo repository. Additionally, require that + /// // the "ci/check" check ran by the Github Actions app is passing and only allow + /// // the engineers team merge to the branch. + /// var exampleBranchProtectionV3 = new Github.BranchProtectionV3("exampleBranchProtectionV3", new() + /// { + /// Repository = exampleRepository.Name, + /// Branch = "main", + /// EnforceAdmins = true, + /// RequiredStatusChecks = new Github.Inputs.BranchProtectionV3RequiredStatusChecksArgs + /// { + /// Strict = false, + /// Checks = new[] + /// { + /// "ci/check:824642007264", + /// }, + /// }, + /// RequiredPullRequestReviews = new Github.Inputs.BranchProtectionV3RequiredPullRequestReviewsArgs + /// { + /// DismissStaleReviews = true, + /// DismissalUsers = new[] + /// { + /// "foo-user", + /// }, + /// DismissalTeams = new[] + /// { + /// exampleTeam.Slug, + /// }, + /// BypassPullRequestAllowances = new Github.Inputs.BranchProtectionV3RequiredPullRequestReviewsBypassPullRequestAllowancesArgs + /// { + /// Users = new[] + /// { + /// "foo-user", + /// }, + /// Teams = new[] + /// { + /// exampleTeam.Slug, + /// }, + /// Apps = new[] + /// { + /// "foo-app", + /// }, + /// }, + /// }, + /// Restrictions = new Github.Inputs.BranchProtectionV3RestrictionsArgs + /// { + /// Users = new[] + /// { + /// "foo-user", + /// }, + /// Teams = new[] + /// { + /// exampleTeam.Slug, + /// }, + /// Apps = new[] + /// { + /// "foo-app", + /// }, + /// }, + /// }); + /// + /// var exampleTeamRepository = new Github.TeamRepository("exampleTeamRepository", new() + /// { + /// TeamId = exampleTeam.Id, + /// Repository = exampleRepository.Name, + /// Permission = "pull", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// GitHub Branch Protection can be imported using an ID made up of `repository:branch`, e.g. diff --git a/sdk/dotnet/CodespacesOrganizationSecret.cs b/sdk/dotnet/CodespacesOrganizationSecret.cs index 0629b1ab..97d3fcd4 100644 --- a/sdk/dotnet/CodespacesOrganizationSecret.cs +++ b/sdk/dotnet/CodespacesOrganizationSecret.cs @@ -10,6 +10,71 @@ namespace Pulumi.Github { /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleSecretCodespacesOrganizationSecret = new Github.CodespacesOrganizationSecret("exampleSecretCodespacesOrganizationSecret", new() + /// { + /// SecretName = "example_secret_name", + /// Visibility = "private", + /// PlaintextValue = @var.Some_secret_string, + /// }); + /// + /// var exampleSecretIndex_codespacesOrganizationSecretCodespacesOrganizationSecret = new Github.CodespacesOrganizationSecret("exampleSecretIndex/codespacesOrganizationSecretCodespacesOrganizationSecret", new() + /// { + /// SecretName = "example_secret_name", + /// Visibility = "private", + /// EncryptedValue = @var.Some_encrypted_secret_string, + /// }); + /// + /// }); + /// ``` + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var repo = Github.GetRepository.Invoke(new() + /// { + /// FullName = "my-org/repo", + /// }); + /// + /// var exampleSecretCodespacesOrganizationSecret = new Github.CodespacesOrganizationSecret("exampleSecretCodespacesOrganizationSecret", new() + /// { + /// SecretName = "example_secret_name", + /// Visibility = "selected", + /// PlaintextValue = @var.Some_secret_string, + /// SelectedRepositoryIds = new[] + /// { + /// repo.Apply(getRepositoryResult => getRepositoryResult.RepoId), + /// }, + /// }); + /// + /// var exampleSecretIndex_codespacesOrganizationSecretCodespacesOrganizationSecret = new Github.CodespacesOrganizationSecret("exampleSecretIndex/codespacesOrganizationSecretCodespacesOrganizationSecret", new() + /// { + /// SecretName = "example_secret_name", + /// Visibility = "selected", + /// EncryptedValue = @var.Some_encrypted_secret_string, + /// SelectedRepositoryIds = new[] + /// { + /// repo.Apply(getRepositoryResult => getRepositoryResult.RepoId), + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// This resource can be imported using an ID made up of the secret name diff --git a/sdk/dotnet/CodespacesOrganizationSecretRepositories.cs b/sdk/dotnet/CodespacesOrganizationSecretRepositories.cs index d260a209..928b048c 100644 --- a/sdk/dotnet/CodespacesOrganizationSecretRepositories.cs +++ b/sdk/dotnet/CodespacesOrganizationSecretRepositories.cs @@ -16,6 +16,33 @@ namespace Pulumi.Github /// /// This resource is only applicable when `visibility` of the existing organization secret has been set to `selected`. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var repo = Github.GetRepository.Invoke(new() + /// { + /// FullName = "my-org/repo", + /// }); + /// + /// var orgSecretRepos = new Github.CodespacesOrganizationSecretRepositories("orgSecretRepos", new() + /// { + /// SecretName = "existing_secret_name", + /// SelectedRepositoryIds = new[] + /// { + /// repo.Apply(getRepositoryResult => getRepositoryResult.RepoId), + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// This resource can be imported using an ID made up of the secret name: diff --git a/sdk/dotnet/CodespacesSecret.cs b/sdk/dotnet/CodespacesSecret.cs index b5ef3ba9..cf9c32a6 100644 --- a/sdk/dotnet/CodespacesSecret.cs +++ b/sdk/dotnet/CodespacesSecret.cs @@ -10,6 +10,38 @@ namespace Pulumi.Github { /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var examplePublicKey = Github.GetCodespacesPublicKey.Invoke(new() + /// { + /// Repository = "example_repository", + /// }); + /// + /// var exampleSecretCodespacesSecret = new Github.CodespacesSecret("exampleSecretCodespacesSecret", new() + /// { + /// Repository = "example_repository", + /// SecretName = "example_secret_name", + /// PlaintextValue = @var.Some_secret_string, + /// }); + /// + /// var exampleSecretIndex_codespacesSecretCodespacesSecret = new Github.CodespacesSecret("exampleSecretIndex/codespacesSecretCodespacesSecret", new() + /// { + /// Repository = "example_repository", + /// SecretName = "example_secret_name", + /// EncryptedValue = @var.Some_encrypted_secret_string, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// This resource can be imported using an ID made up of the `repository` and `secret_name`: diff --git a/sdk/dotnet/CodespacesUserSecret.cs b/sdk/dotnet/CodespacesUserSecret.cs index ab2b4527..b0d07d4b 100644 --- a/sdk/dotnet/CodespacesUserSecret.cs +++ b/sdk/dotnet/CodespacesUserSecret.cs @@ -10,6 +10,44 @@ namespace Pulumi.Github { /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var repo = Github.GetRepository.Invoke(new() + /// { + /// FullName = "my-org/repo", + /// }); + /// + /// var exampleSecretCodespacesUserSecret = new Github.CodespacesUserSecret("exampleSecretCodespacesUserSecret", new() + /// { + /// SecretName = "example_secret_name", + /// PlaintextValue = @var.Some_secret_string, + /// SelectedRepositoryIds = new[] + /// { + /// repo.Apply(getRepositoryResult => getRepositoryResult.RepoId), + /// }, + /// }); + /// + /// var exampleSecretIndex_codespacesUserSecretCodespacesUserSecret = new Github.CodespacesUserSecret("exampleSecretIndex/codespacesUserSecretCodespacesUserSecret", new() + /// { + /// SecretName = "example_secret_name", + /// EncryptedValue = @var.Some_encrypted_secret_string, + /// SelectedRepositoryIds = new[] + /// { + /// repo.Apply(getRepositoryResult => getRepositoryResult.RepoId), + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// This resource can be imported using an ID made up of the secret name diff --git a/sdk/dotnet/EmuGroupMapping.cs b/sdk/dotnet/EmuGroupMapping.cs index 5f7d804e..46ec3eb6 100644 --- a/sdk/dotnet/EmuGroupMapping.cs +++ b/sdk/dotnet/EmuGroupMapping.cs @@ -12,6 +12,26 @@ namespace Pulumi.Github /// /// This resource manages mappings between external groups for enterprise managed users and GitHub teams. It wraps the API detailed [here](https://docs.github.com/en/rest/reference/teams#external-groups). Note that this is a distinct resource from `github.TeamSyncGroupMapping`. `github.EmuGroupMapping` is special to the Enterprise Managed User (EMU) external group feature, whereas `github.TeamSyncGroupMapping` is specific to Identity Provider Groups. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleEmuGroupMapping = new Github.EmuGroupMapping("exampleEmuGroupMapping", new() + /// { + /// GroupId = 28836, + /// TeamSlug = "emu-test-team", + /// }); + /// + /// // The GitHub team name to modify + /// }); + /// ``` + /// /// ## Import /// /// GitHub EMU External Group Mappings can be imported using the external `group_id`, e.g. diff --git a/sdk/dotnet/EnterpriseOrganization.cs b/sdk/dotnet/EnterpriseOrganization.cs index 0ba14c01..a119da79 100644 --- a/sdk/dotnet/EnterpriseOrganization.cs +++ b/sdk/dotnet/EnterpriseOrganization.cs @@ -12,6 +12,31 @@ namespace Pulumi.Github /// /// This resource allows you to create and manage a GitHub enterprise organization. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var org = new Github.EnterpriseOrganization("org", new() + /// { + /// EnterpriseId = data.Github_enterprise.Enterprise.Id, + /// DisplayName = "Some Awesome Org", + /// Description = "Organization created with terraform", + /// BillingEmail = "jon@winteriscoming.com", + /// AdminLogins = new[] + /// { + /// "jon-snow", + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// GitHub Enterprise Organization can be imported using the `slug` of the enterprise, combined with the `orgname` of the organization, separated by a `/` character. diff --git a/sdk/dotnet/GetActionsEnvironmentSecrets.cs b/sdk/dotnet/GetActionsEnvironmentSecrets.cs index ce48d38c..5e75031b 100644 --- a/sdk/dotnet/GetActionsEnvironmentSecrets.cs +++ b/sdk/dotnet/GetActionsEnvironmentSecrets.cs @@ -13,12 +13,58 @@ public static class GetActionsEnvironmentSecrets { /// /// Use this data source to retrieve the list of secrets of the repository environment. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Github.GetActionsEnvironmentSecrets.Invoke(new() + /// { + /// Environment = "exampleEnvironment", + /// Name = "exampleRepo", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetActionsEnvironmentSecretsArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("github:index/getActionsEnvironmentSecrets:getActionsEnvironmentSecrets", args ?? new GetActionsEnvironmentSecretsArgs(), options.WithDefaults()); /// /// Use this data source to retrieve the list of secrets of the repository environment. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Github.GetActionsEnvironmentSecrets.Invoke(new() + /// { + /// Environment = "exampleEnvironment", + /// Name = "exampleRepo", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetActionsEnvironmentSecretsInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("github:index/getActionsEnvironmentSecrets:getActionsEnvironmentSecrets", args ?? new GetActionsEnvironmentSecretsInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/GetActionsEnvironmentVariables.cs b/sdk/dotnet/GetActionsEnvironmentVariables.cs index 9d8b157e..610c3734 100644 --- a/sdk/dotnet/GetActionsEnvironmentVariables.cs +++ b/sdk/dotnet/GetActionsEnvironmentVariables.cs @@ -13,12 +13,58 @@ public static class GetActionsEnvironmentVariables { /// /// Use this data source to retrieve the list of variables of the repository environment. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Github.GetActionsEnvironmentVariables.Invoke(new() + /// { + /// Environment = "exampleEnvironment", + /// Name = "exampleRepo", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetActionsEnvironmentVariablesArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("github:index/getActionsEnvironmentVariables:getActionsEnvironmentVariables", args ?? new GetActionsEnvironmentVariablesArgs(), options.WithDefaults()); /// /// Use this data source to retrieve the list of variables of the repository environment. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Github.GetActionsEnvironmentVariables.Invoke(new() + /// { + /// Environment = "exampleEnvironment", + /// Name = "exampleRepo", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetActionsEnvironmentVariablesInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("github:index/getActionsEnvironmentVariables:getActionsEnvironmentVariables", args ?? new GetActionsEnvironmentVariablesInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/GetActionsOrganizationOidcSubjectClaimCustomizationTemplate.cs b/sdk/dotnet/GetActionsOrganizationOidcSubjectClaimCustomizationTemplate.cs index 449edabf..f5c7119a 100644 --- a/sdk/dotnet/GetActionsOrganizationOidcSubjectClaimCustomizationTemplate.cs +++ b/sdk/dotnet/GetActionsOrganizationOidcSubjectClaimCustomizationTemplate.cs @@ -13,12 +13,50 @@ public static class GetActionsOrganizationOidcSubjectClaimCustomizationTemplate { /// /// Use this data source to retrieve the OpenID Connect subject claim customization template for an organization + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Github.GetActionsOrganizationOidcSubjectClaimCustomizationTemplate.Invoke(); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("github:index/getActionsOrganizationOidcSubjectClaimCustomizationTemplate:getActionsOrganizationOidcSubjectClaimCustomizationTemplate", InvokeArgs.Empty, options.WithDefaults()); /// /// Use this data source to retrieve the OpenID Connect subject claim customization template for an organization + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Github.GetActionsOrganizationOidcSubjectClaimCustomizationTemplate.Invoke(); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("github:index/getActionsOrganizationOidcSubjectClaimCustomizationTemplate:getActionsOrganizationOidcSubjectClaimCustomizationTemplate", InvokeArgs.Empty, options.WithDefaults()); diff --git a/sdk/dotnet/GetActionsOrganizationPublicKey.cs b/sdk/dotnet/GetActionsOrganizationPublicKey.cs index cf78c7d2..7cedaa19 100644 --- a/sdk/dotnet/GetActionsOrganizationPublicKey.cs +++ b/sdk/dotnet/GetActionsOrganizationPublicKey.cs @@ -14,6 +14,25 @@ public static class GetActionsOrganizationPublicKey /// /// Use this data source to retrieve information about a GitHub Actions Organization public key. This data source is required to be used with other GitHub secrets interactions. /// Note that the provider `token` must have admin rights to an organization to retrieve it's action public key. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Github.GetActionsOrganizationPublicKey.Invoke(); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("github:index/getActionsOrganizationPublicKey:getActionsOrganizationPublicKey", InvokeArgs.Empty, options.WithDefaults()); @@ -21,6 +40,25 @@ public static Task InvokeAsync(InvokeOpti /// /// Use this data source to retrieve information about a GitHub Actions Organization public key. This data source is required to be used with other GitHub secrets interactions. /// Note that the provider `token` must have admin rights to an organization to retrieve it's action public key. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Github.GetActionsOrganizationPublicKey.Invoke(); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("github:index/getActionsOrganizationPublicKey:getActionsOrganizationPublicKey", InvokeArgs.Empty, options.WithDefaults()); diff --git a/sdk/dotnet/GetActionsOrganizationRegistrationToken.cs b/sdk/dotnet/GetActionsOrganizationRegistrationToken.cs index 68ec49fa..85f5bd75 100644 --- a/sdk/dotnet/GetActionsOrganizationRegistrationToken.cs +++ b/sdk/dotnet/GetActionsOrganizationRegistrationToken.cs @@ -13,12 +13,50 @@ public static class GetActionsOrganizationRegistrationToken { /// /// Use this data source to retrieve a GitHub Actions organization registration token. This token can then be used to register a self-hosted runner. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Github.GetActionsOrganizationRegistrationToken.Invoke(); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("github:index/getActionsOrganizationRegistrationToken:getActionsOrganizationRegistrationToken", InvokeArgs.Empty, options.WithDefaults()); /// /// Use this data source to retrieve a GitHub Actions organization registration token. This token can then be used to register a self-hosted runner. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Github.GetActionsOrganizationRegistrationToken.Invoke(); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("github:index/getActionsOrganizationRegistrationToken:getActionsOrganizationRegistrationToken", InvokeArgs.Empty, options.WithDefaults()); diff --git a/sdk/dotnet/GetActionsOrganizationSecrets.cs b/sdk/dotnet/GetActionsOrganizationSecrets.cs index 8aa14405..6e3b9dbe 100644 --- a/sdk/dotnet/GetActionsOrganizationSecrets.cs +++ b/sdk/dotnet/GetActionsOrganizationSecrets.cs @@ -13,12 +13,50 @@ public static class GetActionsOrganizationSecrets { /// /// Use this data source to retrieve the list of secrets of the organization. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Github.GetActionsOrganizationSecrets.Invoke(); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("github:index/getActionsOrganizationSecrets:getActionsOrganizationSecrets", InvokeArgs.Empty, options.WithDefaults()); /// /// Use this data source to retrieve the list of secrets of the organization. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Github.GetActionsOrganizationSecrets.Invoke(); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("github:index/getActionsOrganizationSecrets:getActionsOrganizationSecrets", InvokeArgs.Empty, options.WithDefaults()); diff --git a/sdk/dotnet/GetActionsOrganizationVariables.cs b/sdk/dotnet/GetActionsOrganizationVariables.cs index 7fdb1d49..3d037bf8 100644 --- a/sdk/dotnet/GetActionsOrganizationVariables.cs +++ b/sdk/dotnet/GetActionsOrganizationVariables.cs @@ -13,12 +13,50 @@ public static class GetActionsOrganizationVariables { /// /// Use this data source to retrieve the list of variables of the organization. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Github.GetActionsOrganizationVariables.Invoke(); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("github:index/getActionsOrganizationVariables:getActionsOrganizationVariables", InvokeArgs.Empty, options.WithDefaults()); /// /// Use this data source to retrieve the list of variables of the organization. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Github.GetActionsOrganizationVariables.Invoke(); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("github:index/getActionsOrganizationVariables:getActionsOrganizationVariables", InvokeArgs.Empty, options.WithDefaults()); diff --git a/sdk/dotnet/GetActionsPublicKey.cs b/sdk/dotnet/GetActionsPublicKey.cs index 9130a178..02ad735c 100644 --- a/sdk/dotnet/GetActionsPublicKey.cs +++ b/sdk/dotnet/GetActionsPublicKey.cs @@ -14,6 +14,28 @@ public static class GetActionsPublicKey /// /// Use this data source to retrieve information about a GitHub Actions public key. This data source is required to be used with other GitHub secrets interactions. /// Note that the provider `token` must have admin rights to a repository to retrieve it's action public key. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Github.GetActionsPublicKey.Invoke(new() + /// { + /// Repository = "example_repo", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetActionsPublicKeyArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("github:index/getActionsPublicKey:getActionsPublicKey", args ?? new GetActionsPublicKeyArgs(), options.WithDefaults()); @@ -21,6 +43,28 @@ public static Task InvokeAsync(GetActionsPublicKeyArg /// /// Use this data source to retrieve information about a GitHub Actions public key. This data source is required to be used with other GitHub secrets interactions. /// Note that the provider `token` must have admin rights to a repository to retrieve it's action public key. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Github.GetActionsPublicKey.Invoke(new() + /// { + /// Repository = "example_repo", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetActionsPublicKeyInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("github:index/getActionsPublicKey:getActionsPublicKey", args ?? new GetActionsPublicKeyInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/GetActionsRegistrationToken.cs b/sdk/dotnet/GetActionsRegistrationToken.cs index aa31e039..4fcda3be 100644 --- a/sdk/dotnet/GetActionsRegistrationToken.cs +++ b/sdk/dotnet/GetActionsRegistrationToken.cs @@ -13,12 +13,56 @@ public static class GetActionsRegistrationToken { /// /// Use this data source to retrieve a GitHub Actions repository registration token. This token can then be used to register a self-hosted runner. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Github.GetActionsRegistrationToken.Invoke(new() + /// { + /// Repository = "example_repo", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetActionsRegistrationTokenArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("github:index/getActionsRegistrationToken:getActionsRegistrationToken", args ?? new GetActionsRegistrationTokenArgs(), options.WithDefaults()); /// /// Use this data source to retrieve a GitHub Actions repository registration token. This token can then be used to register a self-hosted runner. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Github.GetActionsRegistrationToken.Invoke(new() + /// { + /// Repository = "example_repo", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetActionsRegistrationTokenInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("github:index/getActionsRegistrationToken:getActionsRegistrationToken", args ?? new GetActionsRegistrationTokenInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/GetActionsRepositoryOidcSubjectClaimCustomizationTemplate.cs b/sdk/dotnet/GetActionsRepositoryOidcSubjectClaimCustomizationTemplate.cs index 5c595d74..1c11c701 100644 --- a/sdk/dotnet/GetActionsRepositoryOidcSubjectClaimCustomizationTemplate.cs +++ b/sdk/dotnet/GetActionsRepositoryOidcSubjectClaimCustomizationTemplate.cs @@ -13,12 +13,56 @@ public static class GetActionsRepositoryOidcSubjectClaimCustomizationTemplate { /// /// Use this data source to retrieve the OpenID Connect subject claim customization template for a repository + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Github.GetActionsRepositoryOidcSubjectClaimCustomizationTemplate.Invoke(new() + /// { + /// Name = "example_repository", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetActionsRepositoryOidcSubjectClaimCustomizationTemplateArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("github:index/getActionsRepositoryOidcSubjectClaimCustomizationTemplate:getActionsRepositoryOidcSubjectClaimCustomizationTemplate", args ?? new GetActionsRepositoryOidcSubjectClaimCustomizationTemplateArgs(), options.WithDefaults()); /// /// Use this data source to retrieve the OpenID Connect subject claim customization template for a repository + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Github.GetActionsRepositoryOidcSubjectClaimCustomizationTemplate.Invoke(new() + /// { + /// Name = "example_repository", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetActionsRepositoryOidcSubjectClaimCustomizationTemplateInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("github:index/getActionsRepositoryOidcSubjectClaimCustomizationTemplate:getActionsRepositoryOidcSubjectClaimCustomizationTemplate", args ?? new GetActionsRepositoryOidcSubjectClaimCustomizationTemplateInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/GetActionsSecrets.cs b/sdk/dotnet/GetActionsSecrets.cs index 80ad5534..c129c818 100644 --- a/sdk/dotnet/GetActionsSecrets.cs +++ b/sdk/dotnet/GetActionsSecrets.cs @@ -13,12 +13,56 @@ public static class GetActionsSecrets { /// /// Use this data source to retrieve the list of secrets for a GitHub repository. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Github.GetActionsSecrets.Invoke(new() + /// { + /// Name = "example", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetActionsSecretsArgs? args = null, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("github:index/getActionsSecrets:getActionsSecrets", args ?? new GetActionsSecretsArgs(), options.WithDefaults()); /// /// Use this data source to retrieve the list of secrets for a GitHub repository. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Github.GetActionsSecrets.Invoke(new() + /// { + /// Name = "example", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetActionsSecretsInvokeArgs? args = null, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("github:index/getActionsSecrets:getActionsSecrets", args ?? new GetActionsSecretsInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/GetActionsVariables.cs b/sdk/dotnet/GetActionsVariables.cs index d7bce2c2..c4c18cd7 100644 --- a/sdk/dotnet/GetActionsVariables.cs +++ b/sdk/dotnet/GetActionsVariables.cs @@ -13,12 +13,56 @@ public static class GetActionsVariables { /// /// Use this data source to retrieve the list of variables for a GitHub repository. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Github.GetActionsVariables.Invoke(new() + /// { + /// Name = "example", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetActionsVariablesArgs? args = null, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("github:index/getActionsVariables:getActionsVariables", args ?? new GetActionsVariablesArgs(), options.WithDefaults()); /// /// Use this data source to retrieve the list of variables for a GitHub repository. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Github.GetActionsVariables.Invoke(new() + /// { + /// Name = "example", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetActionsVariablesInvokeArgs? args = null, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("github:index/getActionsVariables:getActionsVariables", args ?? new GetActionsVariablesInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/GetAppToken.cs b/sdk/dotnet/GetAppToken.cs index 4d5f5f92..871e8a33 100644 --- a/sdk/dotnet/GetAppToken.cs +++ b/sdk/dotnet/GetAppToken.cs @@ -13,12 +13,62 @@ public static class GetAppToken { /// /// Use this data source to generate a [GitHub App JWT](https://docs.github.com/en/apps/creating-github-apps/authenticating-with-a-github-app/generating-a-json-web-token-jwt-for-a-github-app). + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.IO; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var @this = Github.GetAppToken.Invoke(new() + /// { + /// AppId = "123456", + /// InstallationId = "78910", + /// PemFile = File.ReadAllText("foo/bar.pem"), + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetAppTokenArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("github:index/getAppToken:getAppToken", args ?? new GetAppTokenArgs(), options.WithDefaults()); /// /// Use this data source to generate a [GitHub App JWT](https://docs.github.com/en/apps/creating-github-apps/authenticating-with-a-github-app/generating-a-json-web-token-jwt-for-a-github-app). + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.IO; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var @this = Github.GetAppToken.Invoke(new() + /// { + /// AppId = "123456", + /// InstallationId = "78910", + /// PemFile = File.ReadAllText("foo/bar.pem"), + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetAppTokenInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("github:index/getAppToken:getAppToken", args ?? new GetAppTokenInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/GetBranch.cs b/sdk/dotnet/GetBranch.cs index 4882c0f2..5738654e 100644 --- a/sdk/dotnet/GetBranch.cs +++ b/sdk/dotnet/GetBranch.cs @@ -13,12 +13,58 @@ public static class GetBranch { /// /// Use this data source to retrieve information about a repository branch. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var development = Github.GetBranch.Invoke(new() + /// { + /// Branch = "development", + /// Repository = "example", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetBranchArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("github:index/getBranch:getBranch", args ?? new GetBranchArgs(), options.WithDefaults()); /// /// Use this data source to retrieve information about a repository branch. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var development = Github.GetBranch.Invoke(new() + /// { + /// Branch = "development", + /// Repository = "example", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetBranchInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("github:index/getBranch:getBranch", args ?? new GetBranchInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/GetBranchProtectionRules.cs b/sdk/dotnet/GetBranchProtectionRules.cs index 35dec3b8..b3316d60 100644 --- a/sdk/dotnet/GetBranchProtectionRules.cs +++ b/sdk/dotnet/GetBranchProtectionRules.cs @@ -13,12 +13,56 @@ public static class GetBranchProtectionRules { /// /// Use this data source to retrieve a list of repository branch protection rules. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Github.GetBranchProtectionRules.Invoke(new() + /// { + /// Repository = "example", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetBranchProtectionRulesArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("github:index/getBranchProtectionRules:getBranchProtectionRules", args ?? new GetBranchProtectionRulesArgs(), options.WithDefaults()); /// /// Use this data source to retrieve a list of repository branch protection rules. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Github.GetBranchProtectionRules.Invoke(new() + /// { + /// Repository = "example", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetBranchProtectionRulesInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("github:index/getBranchProtectionRules:getBranchProtectionRules", args ?? new GetBranchProtectionRulesInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/GetCodespacesOrganizationPublicKey.cs b/sdk/dotnet/GetCodespacesOrganizationPublicKey.cs index 5fb62e44..cce25b91 100644 --- a/sdk/dotnet/GetCodespacesOrganizationPublicKey.cs +++ b/sdk/dotnet/GetCodespacesOrganizationPublicKey.cs @@ -14,6 +14,25 @@ public static class GetCodespacesOrganizationPublicKey /// /// Use this data source to retrieve information about a GitHub Codespaces Organization public key. This data source is required to be used with other GitHub secrets interactions. /// Note that the provider `token` must have admin rights to an organization to retrieve it's Codespaces public key. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Github.GetCodespacesOrganizationPublicKey.Invoke(); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("github:index/getCodespacesOrganizationPublicKey:getCodespacesOrganizationPublicKey", InvokeArgs.Empty, options.WithDefaults()); @@ -21,6 +40,25 @@ public static Task InvokeAsync(InvokeO /// /// Use this data source to retrieve information about a GitHub Codespaces Organization public key. This data source is required to be used with other GitHub secrets interactions. /// Note that the provider `token` must have admin rights to an organization to retrieve it's Codespaces public key. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Github.GetCodespacesOrganizationPublicKey.Invoke(); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("github:index/getCodespacesOrganizationPublicKey:getCodespacesOrganizationPublicKey", InvokeArgs.Empty, options.WithDefaults()); diff --git a/sdk/dotnet/GetCodespacesOrganizationSecrets.cs b/sdk/dotnet/GetCodespacesOrganizationSecrets.cs index 00cb585f..4477a8f3 100644 --- a/sdk/dotnet/GetCodespacesOrganizationSecrets.cs +++ b/sdk/dotnet/GetCodespacesOrganizationSecrets.cs @@ -13,12 +13,50 @@ public static class GetCodespacesOrganizationSecrets { /// /// Use this data source to retrieve the list of codespaces secrets of the organization. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Github.GetCodespacesOrganizationSecrets.Invoke(); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("github:index/getCodespacesOrganizationSecrets:getCodespacesOrganizationSecrets", InvokeArgs.Empty, options.WithDefaults()); /// /// Use this data source to retrieve the list of codespaces secrets of the organization. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Github.GetCodespacesOrganizationSecrets.Invoke(); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("github:index/getCodespacesOrganizationSecrets:getCodespacesOrganizationSecrets", InvokeArgs.Empty, options.WithDefaults()); diff --git a/sdk/dotnet/GetCodespacesPublicKey.cs b/sdk/dotnet/GetCodespacesPublicKey.cs index 2d12fdb0..6c814abd 100644 --- a/sdk/dotnet/GetCodespacesPublicKey.cs +++ b/sdk/dotnet/GetCodespacesPublicKey.cs @@ -14,6 +14,28 @@ public static class GetCodespacesPublicKey /// /// Use this data source to retrieve information about a GitHub Codespaces public key. This data source is required to be used with other GitHub secrets interactions. /// Note that the provider `token` must have admin rights to a repository to retrieve it's Codespaces public key. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Github.GetCodespacesPublicKey.Invoke(new() + /// { + /// Repository = "example_repo", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetCodespacesPublicKeyArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("github:index/getCodespacesPublicKey:getCodespacesPublicKey", args ?? new GetCodespacesPublicKeyArgs(), options.WithDefaults()); @@ -21,6 +43,28 @@ public static Task InvokeAsync(GetCodespacesPublic /// /// Use this data source to retrieve information about a GitHub Codespaces public key. This data source is required to be used with other GitHub secrets interactions. /// Note that the provider `token` must have admin rights to a repository to retrieve it's Codespaces public key. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Github.GetCodespacesPublicKey.Invoke(new() + /// { + /// Repository = "example_repo", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetCodespacesPublicKeyInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("github:index/getCodespacesPublicKey:getCodespacesPublicKey", args ?? new GetCodespacesPublicKeyInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/GetCodespacesSecrets.cs b/sdk/dotnet/GetCodespacesSecrets.cs index dea287d4..9bd0900a 100644 --- a/sdk/dotnet/GetCodespacesSecrets.cs +++ b/sdk/dotnet/GetCodespacesSecrets.cs @@ -13,12 +13,66 @@ public static class GetCodespacesSecrets { /// /// Use this data source to retrieve the list of codespaces secrets for a GitHub repository. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Github.GetCodespacesSecrets.Invoke(new() + /// { + /// Name = "example_repository", + /// }); + /// + /// var example2 = Github.GetCodespacesSecrets.Invoke(new() + /// { + /// FullName = "org/example_repository", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetCodespacesSecretsArgs? args = null, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("github:index/getCodespacesSecrets:getCodespacesSecrets", args ?? new GetCodespacesSecretsArgs(), options.WithDefaults()); /// /// Use this data source to retrieve the list of codespaces secrets for a GitHub repository. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Github.GetCodespacesSecrets.Invoke(new() + /// { + /// Name = "example_repository", + /// }); + /// + /// var example2 = Github.GetCodespacesSecrets.Invoke(new() + /// { + /// FullName = "org/example_repository", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetCodespacesSecretsInvokeArgs? args = null, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("github:index/getCodespacesSecrets:getCodespacesSecrets", args ?? new GetCodespacesSecretsInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/GetCodespacesUserPublicKey.cs b/sdk/dotnet/GetCodespacesUserPublicKey.cs index 8dc31a5c..b740141e 100644 --- a/sdk/dotnet/GetCodespacesUserPublicKey.cs +++ b/sdk/dotnet/GetCodespacesUserPublicKey.cs @@ -14,6 +14,25 @@ public static class GetCodespacesUserPublicKey /// /// Use this data source to retrieve information about a GitHub Codespaces User public key. This data source is required to be used with other GitHub secrets interactions. /// Note that the provider `token` must have admin rights to an user to retrieve it's Codespaces public key. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Github.GetCodespacesUserPublicKey.Invoke(); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("github:index/getCodespacesUserPublicKey:getCodespacesUserPublicKey", InvokeArgs.Empty, options.WithDefaults()); @@ -21,6 +40,25 @@ public static Task InvokeAsync(InvokeOptions? /// /// Use this data source to retrieve information about a GitHub Codespaces User public key. This data source is required to be used with other GitHub secrets interactions. /// Note that the provider `token` must have admin rights to an user to retrieve it's Codespaces public key. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Github.GetCodespacesUserPublicKey.Invoke(); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("github:index/getCodespacesUserPublicKey:getCodespacesUserPublicKey", InvokeArgs.Empty, options.WithDefaults()); diff --git a/sdk/dotnet/GetCodespacesUserSecrets.cs b/sdk/dotnet/GetCodespacesUserSecrets.cs index f4750f2b..5776be99 100644 --- a/sdk/dotnet/GetCodespacesUserSecrets.cs +++ b/sdk/dotnet/GetCodespacesUserSecrets.cs @@ -13,12 +13,50 @@ public static class GetCodespacesUserSecrets { /// /// Use this data source to retrieve the list of codespaces secrets of the user. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Github.GetCodespacesUserSecrets.Invoke(); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("github:index/getCodespacesUserSecrets:getCodespacesUserSecrets", InvokeArgs.Empty, options.WithDefaults()); /// /// Use this data source to retrieve the list of codespaces secrets of the user. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Github.GetCodespacesUserSecrets.Invoke(); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("github:index/getCodespacesUserSecrets:getCodespacesUserSecrets", InvokeArgs.Empty, options.WithDefaults()); diff --git a/sdk/dotnet/GetCollaborators.cs b/sdk/dotnet/GetCollaborators.cs index e2b06368..73bcfbc6 100644 --- a/sdk/dotnet/GetCollaborators.cs +++ b/sdk/dotnet/GetCollaborators.cs @@ -13,12 +13,58 @@ public static class GetCollaborators { /// /// Use this data source to retrieve the collaborators for a given repository. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var test = Github.GetCollaborators.Invoke(new() + /// { + /// Owner = "example_owner", + /// Repository = "example_repository", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetCollaboratorsArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("github:index/getCollaborators:getCollaborators", args ?? new GetCollaboratorsArgs(), options.WithDefaults()); /// /// Use this data source to retrieve the collaborators for a given repository. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var test = Github.GetCollaborators.Invoke(new() + /// { + /// Owner = "example_owner", + /// Repository = "example_repository", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetCollaboratorsInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("github:index/getCollaborators:getCollaborators", args ?? new GetCollaboratorsInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/GetDependabotOrganizationPublicKey.cs b/sdk/dotnet/GetDependabotOrganizationPublicKey.cs index 5dc89f1f..b00201de 100644 --- a/sdk/dotnet/GetDependabotOrganizationPublicKey.cs +++ b/sdk/dotnet/GetDependabotOrganizationPublicKey.cs @@ -14,6 +14,25 @@ public static class GetDependabotOrganizationPublicKey /// /// Use this data source to retrieve information about a GitHub Dependabot Organization public key. This data source is required to be used with other GitHub secrets interactions. /// Note that the provider `token` must have admin rights to an organization to retrieve it's Dependabot public key. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Github.GetDependabotOrganizationPublicKey.Invoke(); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("github:index/getDependabotOrganizationPublicKey:getDependabotOrganizationPublicKey", InvokeArgs.Empty, options.WithDefaults()); @@ -21,6 +40,25 @@ public static Task InvokeAsync(InvokeO /// /// Use this data source to retrieve information about a GitHub Dependabot Organization public key. This data source is required to be used with other GitHub secrets interactions. /// Note that the provider `token` must have admin rights to an organization to retrieve it's Dependabot public key. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Github.GetDependabotOrganizationPublicKey.Invoke(); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("github:index/getDependabotOrganizationPublicKey:getDependabotOrganizationPublicKey", InvokeArgs.Empty, options.WithDefaults()); diff --git a/sdk/dotnet/GetDependabotOrganizationSecrets.cs b/sdk/dotnet/GetDependabotOrganizationSecrets.cs index 14719e91..1d05a0d3 100644 --- a/sdk/dotnet/GetDependabotOrganizationSecrets.cs +++ b/sdk/dotnet/GetDependabotOrganizationSecrets.cs @@ -13,12 +13,50 @@ public static class GetDependabotOrganizationSecrets { /// /// Use this data source to retrieve the list of dependabot secrets of the organization. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Github.GetDependabotOrganizationSecrets.Invoke(); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("github:index/getDependabotOrganizationSecrets:getDependabotOrganizationSecrets", InvokeArgs.Empty, options.WithDefaults()); /// /// Use this data source to retrieve the list of dependabot secrets of the organization. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Github.GetDependabotOrganizationSecrets.Invoke(); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("github:index/getDependabotOrganizationSecrets:getDependabotOrganizationSecrets", InvokeArgs.Empty, options.WithDefaults()); diff --git a/sdk/dotnet/GetDependabotSecrets.cs b/sdk/dotnet/GetDependabotSecrets.cs index 332f04ce..e41f55c6 100644 --- a/sdk/dotnet/GetDependabotSecrets.cs +++ b/sdk/dotnet/GetDependabotSecrets.cs @@ -13,12 +13,56 @@ public static class GetDependabotSecrets { /// /// Use this data source to retrieve the list of dependabot secrets for a GitHub repository. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Github.GetDependabotSecrets.Invoke(new() + /// { + /// Name = "example", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetDependabotSecretsArgs? args = null, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("github:index/getDependabotSecrets:getDependabotSecrets", args ?? new GetDependabotSecretsArgs(), options.WithDefaults()); /// /// Use this data source to retrieve the list of dependabot secrets for a GitHub repository. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Github.GetDependabotSecrets.Invoke(new() + /// { + /// Name = "example", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetDependabotSecretsInvokeArgs? args = null, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("github:index/getDependabotSecrets:getDependabotSecrets", args ?? new GetDependabotSecretsInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/GetEnterprise.cs b/sdk/dotnet/GetEnterprise.cs index fb43c29f..9a01e6d6 100644 --- a/sdk/dotnet/GetEnterprise.cs +++ b/sdk/dotnet/GetEnterprise.cs @@ -13,12 +13,56 @@ public static class GetEnterprise { /// /// Use this data source to retrieve basic information about a GitHub enterprise. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Github.GetEnterprise.Invoke(new() + /// { + /// Slug = "example-co", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetEnterpriseArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("github:index/getEnterprise:getEnterprise", args ?? new GetEnterpriseArgs(), options.WithDefaults()); /// /// Use this data source to retrieve basic information about a GitHub enterprise. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Github.GetEnterprise.Invoke(new() + /// { + /// Slug = "example-co", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetEnterpriseInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("github:index/getEnterprise:getEnterprise", args ?? new GetEnterpriseInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/GetExternalGroups.cs b/sdk/dotnet/GetExternalGroups.cs index c842e1c2..16591602 100644 --- a/sdk/dotnet/GetExternalGroups.cs +++ b/sdk/dotnet/GetExternalGroups.cs @@ -13,12 +13,62 @@ public static class GetExternalGroups { /// /// Use this data source to retrieve external groups belonging to an organization. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleExternalGroups = Github.GetExternalGroups.Invoke(); + /// + /// var localGroups = exampleExternalGroups; + /// + /// return new Dictionary<string, object?> + /// { + /// ["groups"] = localGroups, + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("github:index/getExternalGroups:getExternalGroups", InvokeArgs.Empty, options.WithDefaults()); /// /// Use this data source to retrieve external groups belonging to an organization. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleExternalGroups = Github.GetExternalGroups.Invoke(); + /// + /// var localGroups = exampleExternalGroups; + /// + /// return new Dictionary<string, object?> + /// { + /// ["groups"] = localGroups, + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("github:index/getExternalGroups:getExternalGroups", InvokeArgs.Empty, options.WithDefaults()); diff --git a/sdk/dotnet/GetGithubApp.cs b/sdk/dotnet/GetGithubApp.cs index 1bad5c12..f738a244 100644 --- a/sdk/dotnet/GetGithubApp.cs +++ b/sdk/dotnet/GetGithubApp.cs @@ -13,12 +13,56 @@ public static class GetGithubApp { /// /// Use this data source to retrieve information about an app. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var foobar = Github.GetGithubApp.Invoke(new() + /// { + /// Slug = "foobar", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetGithubAppArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("github:index/getGithubApp:getGithubApp", args ?? new GetGithubAppArgs(), options.WithDefaults()); /// /// Use this data source to retrieve information about an app. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var foobar = Github.GetGithubApp.Invoke(new() + /// { + /// Slug = "foobar", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetGithubAppInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("github:index/getGithubApp:getGithubApp", args ?? new GetGithubAppInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/GetIpRanges.cs b/sdk/dotnet/GetIpRanges.cs index 0210df74..fe7531be 100644 --- a/sdk/dotnet/GetIpRanges.cs +++ b/sdk/dotnet/GetIpRanges.cs @@ -13,12 +13,50 @@ public static class GetIpRanges { /// /// Use this data source to retrieve information about GitHub's IP addresses. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var test = Github.GetIpRanges.Invoke(); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("github:index/getIpRanges:getIpRanges", InvokeArgs.Empty, options.WithDefaults()); /// /// Use this data source to retrieve information about GitHub's IP addresses. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var test = Github.GetIpRanges.Invoke(); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("github:index/getIpRanges:getIpRanges", InvokeArgs.Empty, options.WithDefaults()); diff --git a/sdk/dotnet/GetMembership.cs b/sdk/dotnet/GetMembership.cs index 5c0663d5..ccf5442e 100644 --- a/sdk/dotnet/GetMembership.cs +++ b/sdk/dotnet/GetMembership.cs @@ -16,6 +16,28 @@ public static class GetMembership /// as what role they have within it. /// If the user's membership in the organization is pending their acceptance of an invite, /// the role they would have once they accept will be returned. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var membershipForSomeUser = Github.GetMembership.Invoke(new() + /// { + /// Username = "SomeUser", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetMembershipArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("github:index/getMembership:getMembership", args ?? new GetMembershipArgs(), options.WithDefaults()); @@ -25,6 +47,28 @@ public static Task InvokeAsync(GetMembershipArgs args, Invo /// as what role they have within it. /// If the user's membership in the organization is pending their acceptance of an invite, /// the role they would have once they accept will be returned. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var membershipForSomeUser = Github.GetMembership.Invoke(new() + /// { + /// Username = "SomeUser", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetMembershipInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("github:index/getMembership:getMembership", args ?? new GetMembershipInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/GetOrganization.cs b/sdk/dotnet/GetOrganization.cs index bd02730a..4e3977c0 100644 --- a/sdk/dotnet/GetOrganization.cs +++ b/sdk/dotnet/GetOrganization.cs @@ -13,12 +13,56 @@ public static class GetOrganization { /// /// Use this data source to retrieve basic information about a GitHub Organization. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Github.GetOrganization.Invoke(new() + /// { + /// Name = "github", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetOrganizationArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("github:index/getOrganization:getOrganization", args ?? new GetOrganizationArgs(), options.WithDefaults()); /// /// Use this data source to retrieve basic information about a GitHub Organization. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Github.GetOrganization.Invoke(new() + /// { + /// Name = "github", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetOrganizationInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("github:index/getOrganization:getOrganization", args ?? new GetOrganizationInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/GetOrganizationCustomRole.cs b/sdk/dotnet/GetOrganizationCustomRole.cs index 243bafac..71161e71 100644 --- a/sdk/dotnet/GetOrganizationCustomRole.cs +++ b/sdk/dotnet/GetOrganizationCustomRole.cs @@ -15,6 +15,28 @@ public static class GetOrganizationCustomRole /// Use this data source to retrieve information about a custom role in a GitHub Organization. /// /// > Note: Custom roles are currently only available in GitHub Enterprise Cloud. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Github.GetOrganizationCustomRole.Invoke(new() + /// { + /// Name = "example", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetOrganizationCustomRoleArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("github:index/getOrganizationCustomRole:getOrganizationCustomRole", args ?? new GetOrganizationCustomRoleArgs(), options.WithDefaults()); @@ -23,6 +45,28 @@ public static Task InvokeAsync(GetOrganizationC /// Use this data source to retrieve information about a custom role in a GitHub Organization. /// /// > Note: Custom roles are currently only available in GitHub Enterprise Cloud. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Github.GetOrganizationCustomRole.Invoke(new() + /// { + /// Name = "example", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetOrganizationCustomRoleInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("github:index/getOrganizationCustomRole:getOrganizationCustomRole", args ?? new GetOrganizationCustomRoleInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/GetOrganizationExternalIdentities.cs b/sdk/dotnet/GetOrganizationExternalIdentities.cs index 624a7413..58f42ec0 100644 --- a/sdk/dotnet/GetOrganizationExternalIdentities.cs +++ b/sdk/dotnet/GetOrganizationExternalIdentities.cs @@ -14,6 +14,25 @@ public static class GetOrganizationExternalIdentities /// /// Use this data source to retrieve each organization member's SAML or SCIM user /// attributes. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var all = Github.GetOrganizationExternalIdentities.Invoke(); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("github:index/getOrganizationExternalIdentities:getOrganizationExternalIdentities", InvokeArgs.Empty, options.WithDefaults()); @@ -21,6 +40,25 @@ public static Task InvokeAsync(InvokeOp /// /// Use this data source to retrieve each organization member's SAML or SCIM user /// attributes. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var all = Github.GetOrganizationExternalIdentities.Invoke(); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("github:index/getOrganizationExternalIdentities:getOrganizationExternalIdentities", InvokeArgs.Empty, options.WithDefaults()); diff --git a/sdk/dotnet/GetOrganizationIpAllowList.cs b/sdk/dotnet/GetOrganizationIpAllowList.cs index a230387f..f8fa70bc 100644 --- a/sdk/dotnet/GetOrganizationIpAllowList.cs +++ b/sdk/dotnet/GetOrganizationIpAllowList.cs @@ -15,6 +15,25 @@ public static class GetOrganizationIpAllowList /// Use this data source to retrieve information about the IP allow list of an organization. /// The allow list for IP addresses will block access to private resources via the web, API, /// and Git from any IP addresses that are not on the allow list. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var all = Github.GetOrganizationIpAllowList.Invoke(); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("github:index/getOrganizationIpAllowList:getOrganizationIpAllowList", InvokeArgs.Empty, options.WithDefaults()); @@ -23,6 +42,25 @@ public static Task InvokeAsync(InvokeOptions? /// Use this data source to retrieve information about the IP allow list of an organization. /// The allow list for IP addresses will block access to private resources via the web, API, /// and Git from any IP addresses that are not on the allow list. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var all = Github.GetOrganizationIpAllowList.Invoke(); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("github:index/getOrganizationIpAllowList:getOrganizationIpAllowList", InvokeArgs.Empty, options.WithDefaults()); diff --git a/sdk/dotnet/GetOrganizationTeamSyncGroups.cs b/sdk/dotnet/GetOrganizationTeamSyncGroups.cs index 533bba5c..fd49171f 100644 --- a/sdk/dotnet/GetOrganizationTeamSyncGroups.cs +++ b/sdk/dotnet/GetOrganizationTeamSyncGroups.cs @@ -13,12 +13,50 @@ public static class GetOrganizationTeamSyncGroups { /// /// Use this data source to retrieve the identity provider (IdP) groups for an organization. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var test = Github.GetOrganizationTeamSyncGroups.Invoke(); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("github:index/getOrganizationTeamSyncGroups:getOrganizationTeamSyncGroups", InvokeArgs.Empty, options.WithDefaults()); /// /// Use this data source to retrieve the identity provider (IdP) groups for an organization. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var test = Github.GetOrganizationTeamSyncGroups.Invoke(); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("github:index/getOrganizationTeamSyncGroups:getOrganizationTeamSyncGroups", InvokeArgs.Empty, options.WithDefaults()); diff --git a/sdk/dotnet/GetOrganizationTeams.cs b/sdk/dotnet/GetOrganizationTeams.cs index 0942d392..4090a316 100644 --- a/sdk/dotnet/GetOrganizationTeams.cs +++ b/sdk/dotnet/GetOrganizationTeams.cs @@ -13,12 +13,90 @@ public static class GetOrganizationTeams { /// /// Use this data source to retrieve information about all GitHub teams in an organization. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// To retrieve *all* teams of the organization: + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var all = Github.GetOrganizationTeams.Invoke(); + /// + /// }); + /// ``` + /// + /// To retrieve only the team's at the root of the organization: + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var rootTeams = Github.GetOrganizationTeams.Invoke(new() + /// { + /// RootTeamsOnly = true, + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetOrganizationTeamsArgs? args = null, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("github:index/getOrganizationTeams:getOrganizationTeams", args ?? new GetOrganizationTeamsArgs(), options.WithDefaults()); /// /// Use this data source to retrieve information about all GitHub teams in an organization. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// To retrieve *all* teams of the organization: + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var all = Github.GetOrganizationTeams.Invoke(); + /// + /// }); + /// ``` + /// + /// To retrieve only the team's at the root of the organization: + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var rootTeams = Github.GetOrganizationTeams.Invoke(new() + /// { + /// RootTeamsOnly = true, + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetOrganizationTeamsInvokeArgs? args = null, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("github:index/getOrganizationTeams:getOrganizationTeams", args ?? new GetOrganizationTeamsInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/GetOrganizationWebhooks.cs b/sdk/dotnet/GetOrganizationWebhooks.cs index c2c12dfa..46217470 100644 --- a/sdk/dotnet/GetOrganizationWebhooks.cs +++ b/sdk/dotnet/GetOrganizationWebhooks.cs @@ -13,12 +13,54 @@ public static class GetOrganizationWebhooks { /// /// Use this data source to retrieve all webhooks of the organization. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// To retrieve *all* webhooks of the organization: + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var all = Github.GetOrganizationWebhooks.Invoke(); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("github:index/getOrganizationWebhooks:getOrganizationWebhooks", InvokeArgs.Empty, options.WithDefaults()); /// /// Use this data source to retrieve all webhooks of the organization. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// To retrieve *all* webhooks of the organization: + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var all = Github.GetOrganizationWebhooks.Invoke(); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("github:index/getOrganizationWebhooks:getOrganizationWebhooks", InvokeArgs.Empty, options.WithDefaults()); diff --git a/sdk/dotnet/GetRef.cs b/sdk/dotnet/GetRef.cs index 4831b812..0bddf5dc 100644 --- a/sdk/dotnet/GetRef.cs +++ b/sdk/dotnet/GetRef.cs @@ -13,12 +13,60 @@ public static class GetRef { /// /// Use this data source to retrieve information about a repository ref. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var development = Github.GetRef.Invoke(new() + /// { + /// Owner = "example", + /// Ref = "heads/development", + /// Repository = "example", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetRefArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("github:index/getRef:getRef", args ?? new GetRefArgs(), options.WithDefaults()); /// /// Use this data source to retrieve information about a repository ref. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var development = Github.GetRef.Invoke(new() + /// { + /// Owner = "example", + /// Ref = "heads/development", + /// Repository = "example", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetRefInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("github:index/getRef:getRef", args ?? new GetRefInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/GetRepositories.cs b/sdk/dotnet/GetRepositories.cs index 5405ac0c..f6baa59a 100644 --- a/sdk/dotnet/GetRepositories.cs +++ b/sdk/dotnet/GetRepositories.cs @@ -16,6 +16,29 @@ public static class GetRepositories /// [as documented in official API docs](https://developer.github.com/v3/search/#about-the-search-api). /// /// Use this data source to retrieve a list of GitHub repositories using a search query. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Github.GetRepositories.Invoke(new() + /// { + /// IncludeRepoId = true, + /// Query = "org:hashicorp language:Go", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetRepositoriesArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("github:index/getRepositories:getRepositories", args ?? new GetRepositoriesArgs(), options.WithDefaults()); @@ -25,6 +48,29 @@ public static Task InvokeAsync(GetRepositoriesArgs args, /// [as documented in official API docs](https://developer.github.com/v3/search/#about-the-search-api). /// /// Use this data source to retrieve a list of GitHub repositories using a search query. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Github.GetRepositories.Invoke(new() + /// { + /// IncludeRepoId = true, + /// Query = "org:hashicorp language:Go", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetRepositoriesInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("github:index/getRepositories:getRepositories", args ?? new GetRepositoriesInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/GetRepository.cs b/sdk/dotnet/GetRepository.cs index de9a2197..f15ec29b 100644 --- a/sdk/dotnet/GetRepository.cs +++ b/sdk/dotnet/GetRepository.cs @@ -13,12 +13,56 @@ public static class GetRepository { /// /// Use this data source to retrieve information about a GitHub repository. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Github.GetRepository.Invoke(new() + /// { + /// FullName = "hashicorp/terraform", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetRepositoryArgs? args = null, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("github:index/getRepository:getRepository", args ?? new GetRepositoryArgs(), options.WithDefaults()); /// /// Use this data source to retrieve information about a GitHub repository. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Github.GetRepository.Invoke(new() + /// { + /// FullName = "hashicorp/terraform", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetRepositoryInvokeArgs? args = null, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("github:index/getRepository:getRepository", args ?? new GetRepositoryInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/GetRepositoryAutolinkReferences.cs b/sdk/dotnet/GetRepositoryAutolinkReferences.cs index 6a7c1f17..18df7c67 100644 --- a/sdk/dotnet/GetRepositoryAutolinkReferences.cs +++ b/sdk/dotnet/GetRepositoryAutolinkReferences.cs @@ -13,12 +13,56 @@ public static class GetRepositoryAutolinkReferences { /// /// Use this data source to retrieve autolink references for a repository. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Github.GetRepositoryAutolinkReferences.Invoke(new() + /// { + /// Repository = "example-repository", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetRepositoryAutolinkReferencesArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("github:index/getRepositoryAutolinkReferences:getRepositoryAutolinkReferences", args ?? new GetRepositoryAutolinkReferencesArgs(), options.WithDefaults()); /// /// Use this data source to retrieve autolink references for a repository. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Github.GetRepositoryAutolinkReferences.Invoke(new() + /// { + /// Repository = "example-repository", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetRepositoryAutolinkReferencesInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("github:index/getRepositoryAutolinkReferences:getRepositoryAutolinkReferences", args ?? new GetRepositoryAutolinkReferencesInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/GetRepositoryBranches.cs b/sdk/dotnet/GetRepositoryBranches.cs index 099b162f..b89736cd 100644 --- a/sdk/dotnet/GetRepositoryBranches.cs +++ b/sdk/dotnet/GetRepositoryBranches.cs @@ -13,12 +13,56 @@ public static class GetRepositoryBranches { /// /// Use this data source to retrieve information about branches in a repository. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Github.GetRepositoryBranches.Invoke(new() + /// { + /// Repository = "example-repository", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetRepositoryBranchesArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("github:index/getRepositoryBranches:getRepositoryBranches", args ?? new GetRepositoryBranchesArgs(), options.WithDefaults()); /// /// Use this data source to retrieve information about branches in a repository. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Github.GetRepositoryBranches.Invoke(new() + /// { + /// Repository = "example-repository", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetRepositoryBranchesInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("github:index/getRepositoryBranches:getRepositoryBranches", args ?? new GetRepositoryBranchesInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/GetRepositoryDeployKeys.cs b/sdk/dotnet/GetRepositoryDeployKeys.cs index 3f79631a..1f2c051f 100644 --- a/sdk/dotnet/GetRepositoryDeployKeys.cs +++ b/sdk/dotnet/GetRepositoryDeployKeys.cs @@ -13,12 +13,56 @@ public static class GetRepositoryDeployKeys { /// /// Use this data source to retrieve all deploy keys of a repository. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Github.GetRepositoryDeployKeys.Invoke(new() + /// { + /// Repository = "example-repository", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetRepositoryDeployKeysArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("github:index/getRepositoryDeployKeys:getRepositoryDeployKeys", args ?? new GetRepositoryDeployKeysArgs(), options.WithDefaults()); /// /// Use this data source to retrieve all deploy keys of a repository. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Github.GetRepositoryDeployKeys.Invoke(new() + /// { + /// Repository = "example-repository", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetRepositoryDeployKeysInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("github:index/getRepositoryDeployKeys:getRepositoryDeployKeys", args ?? new GetRepositoryDeployKeysInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/GetRepositoryDeploymentBranchPolicies.cs b/sdk/dotnet/GetRepositoryDeploymentBranchPolicies.cs index 4081156c..695ceca0 100644 --- a/sdk/dotnet/GetRepositoryDeploymentBranchPolicies.cs +++ b/sdk/dotnet/GetRepositoryDeploymentBranchPolicies.cs @@ -13,12 +13,58 @@ public static class GetRepositoryDeploymentBranchPolicies { /// /// Use this data source to retrieve deployment branch policies for a repository / environment. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Github.GetRepositoryDeploymentBranchPolicies.Invoke(new() + /// { + /// EnvironmentName = "env_name", + /// Repository = "example-repository", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetRepositoryDeploymentBranchPoliciesArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("github:index/getRepositoryDeploymentBranchPolicies:getRepositoryDeploymentBranchPolicies", args ?? new GetRepositoryDeploymentBranchPoliciesArgs(), options.WithDefaults()); /// /// Use this data source to retrieve deployment branch policies for a repository / environment. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Github.GetRepositoryDeploymentBranchPolicies.Invoke(new() + /// { + /// EnvironmentName = "env_name", + /// Repository = "example-repository", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetRepositoryDeploymentBranchPoliciesInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("github:index/getRepositoryDeploymentBranchPolicies:getRepositoryDeploymentBranchPolicies", args ?? new GetRepositoryDeploymentBranchPoliciesInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/GetRepositoryEnvironments.cs b/sdk/dotnet/GetRepositoryEnvironments.cs index 550c894e..36adabce 100644 --- a/sdk/dotnet/GetRepositoryEnvironments.cs +++ b/sdk/dotnet/GetRepositoryEnvironments.cs @@ -13,12 +13,56 @@ public static class GetRepositoryEnvironments { /// /// Use this data source to retrieve information about environments for a repository. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Github.GetRepositoryEnvironments.Invoke(new() + /// { + /// Repository = "example-repository", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetRepositoryEnvironmentsArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("github:index/getRepositoryEnvironments:getRepositoryEnvironments", args ?? new GetRepositoryEnvironmentsArgs(), options.WithDefaults()); /// /// Use this data source to retrieve information about environments for a repository. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Github.GetRepositoryEnvironments.Invoke(new() + /// { + /// Repository = "example-repository", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetRepositoryEnvironmentsInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("github:index/getRepositoryEnvironments:getRepositoryEnvironments", args ?? new GetRepositoryEnvironmentsInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/GetRepositoryFile.cs b/sdk/dotnet/GetRepositoryFile.cs index b5ed2e0e..1f822683 100644 --- a/sdk/dotnet/GetRepositoryFile.cs +++ b/sdk/dotnet/GetRepositoryFile.cs @@ -14,6 +14,31 @@ public static class GetRepositoryFile /// /// This data source allows you to read files within a /// GitHub repository. + /// + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var foo = Github.GetRepositoryFile.Invoke(new() + /// { + /// Repository = github_repository.Foo.Name, + /// Branch = "main", + /// File = ".gitignore", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetRepositoryFileArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("github:index/getRepositoryFile:getRepositoryFile", args ?? new GetRepositoryFileArgs(), options.WithDefaults()); @@ -21,6 +46,31 @@ public static Task InvokeAsync(GetRepositoryFileArgs ar /// /// This data source allows you to read files within a /// GitHub repository. + /// + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var foo = Github.GetRepositoryFile.Invoke(new() + /// { + /// Repository = github_repository.Foo.Name, + /// Branch = "main", + /// File = ".gitignore", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetRepositoryFileInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("github:index/getRepositoryFile:getRepositoryFile", args ?? new GetRepositoryFileInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/GetRepositoryMilestone.cs b/sdk/dotnet/GetRepositoryMilestone.cs index 8a7587aa..7188d752 100644 --- a/sdk/dotnet/GetRepositoryMilestone.cs +++ b/sdk/dotnet/GetRepositoryMilestone.cs @@ -13,12 +13,60 @@ public static class GetRepositoryMilestone { /// /// Use this data source to retrieve information about a specific GitHub milestone in a repository. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Github.GetRepositoryMilestone.Invoke(new() + /// { + /// Number = 1, + /// Owner = "example-owner", + /// Repository = "example-repository", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetRepositoryMilestoneArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("github:index/getRepositoryMilestone:getRepositoryMilestone", args ?? new GetRepositoryMilestoneArgs(), options.WithDefaults()); /// /// Use this data source to retrieve information about a specific GitHub milestone in a repository. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Github.GetRepositoryMilestone.Invoke(new() + /// { + /// Number = 1, + /// Owner = "example-owner", + /// Repository = "example-repository", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetRepositoryMilestoneInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("github:index/getRepositoryMilestone:getRepositoryMilestone", args ?? new GetRepositoryMilestoneInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/GetRepositoryPullRequest.cs b/sdk/dotnet/GetRepositoryPullRequest.cs index 837f8f22..7d4870db 100644 --- a/sdk/dotnet/GetRepositoryPullRequest.cs +++ b/sdk/dotnet/GetRepositoryPullRequest.cs @@ -13,12 +13,58 @@ public static class GetRepositoryPullRequest { /// /// Use this data source to retrieve information about a specific GitHub Pull Request in a repository. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Github.GetRepositoryPullRequest.Invoke(new() + /// { + /// BaseRepository = "example_repository", + /// Number = 1, + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetRepositoryPullRequestArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("github:index/getRepositoryPullRequest:getRepositoryPullRequest", args ?? new GetRepositoryPullRequestArgs(), options.WithDefaults()); /// /// Use this data source to retrieve information about a specific GitHub Pull Request in a repository. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Github.GetRepositoryPullRequest.Invoke(new() + /// { + /// BaseRepository = "example_repository", + /// Number = 1, + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetRepositoryPullRequestInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("github:index/getRepositoryPullRequest:getRepositoryPullRequest", args ?? new GetRepositoryPullRequestInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/GetRepositoryPullRequests.cs b/sdk/dotnet/GetRepositoryPullRequests.cs index d4545668..af0dc755 100644 --- a/sdk/dotnet/GetRepositoryPullRequests.cs +++ b/sdk/dotnet/GetRepositoryPullRequests.cs @@ -13,12 +13,64 @@ public static class GetRepositoryPullRequests { /// /// Use this data source to retrieve information about multiple GitHub Pull Requests in a repository. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Github.GetRepositoryPullRequests.Invoke(new() + /// { + /// BaseRef = "main", + /// BaseRepository = "example-repository", + /// SortBy = "updated", + /// SortDirection = "desc", + /// State = "open", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetRepositoryPullRequestsArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("github:index/getRepositoryPullRequests:getRepositoryPullRequests", args ?? new GetRepositoryPullRequestsArgs(), options.WithDefaults()); /// /// Use this data source to retrieve information about multiple GitHub Pull Requests in a repository. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Github.GetRepositoryPullRequests.Invoke(new() + /// { + /// BaseRef = "main", + /// BaseRepository = "example-repository", + /// SortBy = "updated", + /// SortDirection = "desc", + /// State = "open", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetRepositoryPullRequestsInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("github:index/getRepositoryPullRequests:getRepositoryPullRequests", args ?? new GetRepositoryPullRequestsInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/GetRepositoryTeams.cs b/sdk/dotnet/GetRepositoryTeams.cs index 9fb4ec18..36fbd47b 100644 --- a/sdk/dotnet/GetRepositoryTeams.cs +++ b/sdk/dotnet/GetRepositoryTeams.cs @@ -13,12 +13,56 @@ public static class GetRepositoryTeams { /// /// Use this data source to retrieve the list of teams which have access to a GitHub repository. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Github.GetRepositoryTeams.Invoke(new() + /// { + /// Name = "example", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetRepositoryTeamsArgs? args = null, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("github:index/getRepositoryTeams:getRepositoryTeams", args ?? new GetRepositoryTeamsArgs(), options.WithDefaults()); /// /// Use this data source to retrieve the list of teams which have access to a GitHub repository. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Github.GetRepositoryTeams.Invoke(new() + /// { + /// Name = "example", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetRepositoryTeamsInvokeArgs? args = null, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("github:index/getRepositoryTeams:getRepositoryTeams", args ?? new GetRepositoryTeamsInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/GetRepositoryWebhooks.cs b/sdk/dotnet/GetRepositoryWebhooks.cs index d92bd613..8e9403a0 100644 --- a/sdk/dotnet/GetRepositoryWebhooks.cs +++ b/sdk/dotnet/GetRepositoryWebhooks.cs @@ -13,12 +13,60 @@ public static class GetRepositoryWebhooks { /// /// Use this data source to retrieve webhooks for a given repository. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// To retrieve webhooks of a repository: + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var repo = Github.GetRepositoryWebhooks.Invoke(new() + /// { + /// Repository = "foo", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetRepositoryWebhooksArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("github:index/getRepositoryWebhooks:getRepositoryWebhooks", args ?? new GetRepositoryWebhooksArgs(), options.WithDefaults()); /// /// Use this data source to retrieve webhooks for a given repository. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// To retrieve webhooks of a repository: + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var repo = Github.GetRepositoryWebhooks.Invoke(new() + /// { + /// Repository = "foo", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetRepositoryWebhooksInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("github:index/getRepositoryWebhooks:getRepositoryWebhooks", args ?? new GetRepositoryWebhooksInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/GetRestApi.cs b/sdk/dotnet/GetRestApi.cs index f1c53a16..33633022 100644 --- a/sdk/dotnet/GetRestApi.cs +++ b/sdk/dotnet/GetRestApi.cs @@ -13,12 +13,56 @@ public static class GetRestApi { /// /// Use this data source to retrieve information about a GitHub resource through REST API. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Github.GetRestApi.Invoke(new() + /// { + /// Endpoint = "repos/example_repo/git/refs/heads/main", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetRestApiArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("github:index/getRestApi:getRestApi", args ?? new GetRestApiArgs(), options.WithDefaults()); /// /// Use this data source to retrieve information about a GitHub resource through REST API. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Github.GetRestApi.Invoke(new() + /// { + /// Endpoint = "repos/example_repo/git/refs/heads/main", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetRestApiInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("github:index/getRestApi:getRestApi", args ?? new GetRestApiInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/GetSshKeys.cs b/sdk/dotnet/GetSshKeys.cs index 7329e4da..e2c6ee8d 100644 --- a/sdk/dotnet/GetSshKeys.cs +++ b/sdk/dotnet/GetSshKeys.cs @@ -13,12 +13,50 @@ public static class GetSshKeys { /// /// Use this data source to retrieve information about GitHub's SSH keys. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var test = Github.GetSshKeys.Invoke(); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("github:index/getSshKeys:getSshKeys", InvokeArgs.Empty, options.WithDefaults()); /// /// Use this data source to retrieve information about GitHub's SSH keys. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var test = Github.GetSshKeys.Invoke(); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("github:index/getSshKeys:getSshKeys", InvokeArgs.Empty, options.WithDefaults()); diff --git a/sdk/dotnet/GetTeam.cs b/sdk/dotnet/GetTeam.cs index 7924147d..8b39cd36 100644 --- a/sdk/dotnet/GetTeam.cs +++ b/sdk/dotnet/GetTeam.cs @@ -13,12 +13,56 @@ public static class GetTeam { /// /// Use this data source to retrieve information about a GitHub team. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Github.GetTeam.Invoke(new() + /// { + /// Slug = "example", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetTeamArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("github:index/getTeam:getTeam", args ?? new GetTeamArgs(), options.WithDefaults()); /// /// Use this data source to retrieve information about a GitHub team. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Github.GetTeam.Invoke(new() + /// { + /// Slug = "example", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetTeamInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("github:index/getTeam:getTeam", args ?? new GetTeamInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/GetTree.cs b/sdk/dotnet/GetTree.cs index 5d6dfac8..29aa3f19 100644 --- a/sdk/dotnet/GetTree.cs +++ b/sdk/dotnet/GetTree.cs @@ -13,12 +13,90 @@ public static class GetTree { /// /// Use this data source to retrieve information about a single tree. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var thisRepository = Github.GetRepository.Invoke(new() + /// { + /// Name = "example", + /// }); + /// + /// var thisBranch = Github.GetBranch.Invoke(new() + /// { + /// Branch = thisRepository.Apply(getRepositoryResult => getRepositoryResult.DefaultBranch), + /// Repository = thisRepository.Apply(getRepositoryResult => getRepositoryResult.Name), + /// }); + /// + /// var thisTree = Github.GetTree.Invoke(new() + /// { + /// Recursive = false, + /// Repository = thisRepository.Apply(getRepositoryResult => getRepositoryResult.Name), + /// TreeSha = thisBranch.Apply(getBranchResult => getBranchResult.Sha), + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["entries"] = thisTree.Apply(getTreeResult => getTreeResult.Entries), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetTreeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("github:index/getTree:getTree", args ?? new GetTreeArgs(), options.WithDefaults()); /// /// Use this data source to retrieve information about a single tree. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var thisRepository = Github.GetRepository.Invoke(new() + /// { + /// Name = "example", + /// }); + /// + /// var thisBranch = Github.GetBranch.Invoke(new() + /// { + /// Branch = thisRepository.Apply(getRepositoryResult => getRepositoryResult.DefaultBranch), + /// Repository = thisRepository.Apply(getRepositoryResult => getRepositoryResult.Name), + /// }); + /// + /// var thisTree = Github.GetTree.Invoke(new() + /// { + /// Recursive = false, + /// Repository = thisRepository.Apply(getRepositoryResult => getRepositoryResult.Name), + /// TreeSha = thisBranch.Apply(getBranchResult => getBranchResult.Sha), + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["entries"] = thisTree.Apply(getTreeResult => getTreeResult.Entries), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetTreeInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("github:index/getTree:getTree", args ?? new GetTreeInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/GetUser.cs b/sdk/dotnet/GetUser.cs index 22f7e1c2..8a630bd7 100644 --- a/sdk/dotnet/GetUser.cs +++ b/sdk/dotnet/GetUser.cs @@ -13,12 +13,74 @@ public static class GetUser { /// /// Use this data source to retrieve information about a GitHub user. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Github.GetUser.Invoke(new() + /// { + /// Username = "example", + /// }); + /// + /// var current = Github.GetUser.Invoke(new() + /// { + /// Username = "", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["currentGithubLogin"] = current.Apply(getUserResult => getUserResult.Login), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetUserArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("github:index/getUser:getUser", args ?? new GetUserArgs(), options.WithDefaults()); /// /// Use this data source to retrieve information about a GitHub user. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Github.GetUser.Invoke(new() + /// { + /// Username = "example", + /// }); + /// + /// var current = Github.GetUser.Invoke(new() + /// { + /// Username = "", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["currentGithubLogin"] = current.Apply(getUserResult => getUserResult.Login), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetUserInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("github:index/getUser:getUser", args ?? new GetUserInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/GetUserExternalIdentity.cs b/sdk/dotnet/GetUserExternalIdentity.cs index 609dbfe6..7d5e0be2 100644 --- a/sdk/dotnet/GetUserExternalIdentity.cs +++ b/sdk/dotnet/GetUserExternalIdentity.cs @@ -14,6 +14,28 @@ public static class GetUserExternalIdentity /// /// Use this data source to retrieve a specific organization member's SAML or SCIM user /// attributes. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleUser = Github.GetUserExternalIdentity.Invoke(new() + /// { + /// Username = "example-user", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetUserExternalIdentityArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("github:index/getUserExternalIdentity:getUserExternalIdentity", args ?? new GetUserExternalIdentityArgs(), options.WithDefaults()); @@ -21,6 +43,28 @@ public static Task InvokeAsync(GetUserExternalIde /// /// Use this data source to retrieve a specific organization member's SAML or SCIM user /// attributes. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleUser = Github.GetUserExternalIdentity.Invoke(new() + /// { + /// Username = "example-user", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetUserExternalIdentityInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("github:index/getUserExternalIdentity:getUserExternalIdentity", args ?? new GetUserExternalIdentityInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/GetUsers.cs b/sdk/dotnet/GetUsers.cs index 498c62f8..4f02f3f6 100644 --- a/sdk/dotnet/GetUsers.cs +++ b/sdk/dotnet/GetUsers.cs @@ -13,12 +13,76 @@ public static class GetUsers { /// /// Use this data source to retrieve information about multiple GitHub users at once. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Github.GetUsers.Invoke(new() + /// { + /// Usernames = new[] + /// { + /// "example1", + /// "example2", + /// "example3", + /// }, + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["validUsers"] = example.Apply(getUsersResult => getUsersResult.Logins), + /// ["invalidUsers"] = example.Apply(getUsersResult => getUsersResult.UnknownLogins), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetUsersArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("github:index/getUsers:getUsers", args ?? new GetUsersArgs(), options.WithDefaults()); /// /// Use this data source to retrieve information about multiple GitHub users at once. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Github.GetUsers.Invoke(new() + /// { + /// Usernames = new[] + /// { + /// "example1", + /// "example2", + /// "example3", + /// }, + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["validUsers"] = example.Apply(getUsersResult => getUsersResult.Logins), + /// ["invalidUsers"] = example.Apply(getUsersResult => getUsersResult.UnknownLogins), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetUsersInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("github:index/getUsers:getUsers", args ?? new GetUsersInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Issue.cs b/sdk/dotnet/Issue.cs index ca63079e..7ffd4f4e 100644 --- a/sdk/dotnet/Issue.cs +++ b/sdk/dotnet/Issue.cs @@ -15,6 +15,79 @@ namespace Pulumi.Github /// This resource allows you to create and manage issue within your /// GitHub repository. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// // Create a simple issue + /// var testRepository = new Github.Repository("testRepository", new() + /// { + /// AutoInit = true, + /// HasIssues = true, + /// }); + /// + /// var testIssue = new Github.Issue("testIssue", new() + /// { + /// Repository = testRepository.Name, + /// Title = "My issue title", + /// Body = "The body of my issue", + /// }); + /// + /// }); + /// ``` + /// ### With Milestone And Project Assignment + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// // Create an issue with milestone and project assignment + /// var testRepository = new Github.Repository("testRepository", new() + /// { + /// AutoInit = true, + /// HasIssues = true, + /// }); + /// + /// var testRepositoryMilestone = new Github.RepositoryMilestone("testRepositoryMilestone", new() + /// { + /// Owner = testRepository.FullName.Apply(fullName => fullName.Split("/")).Apply(split => split[0]), + /// Repository = testRepository.Name, + /// Title = "v1.0.0", + /// Description = "General Availability", + /// DueDate = "2022-11-22", + /// State = "open", + /// }); + /// + /// var testIssue = new Github.Issue("testIssue", new() + /// { + /// Repository = testRepository.Name, + /// Title = "My issue", + /// Body = "My issue body", + /// Labels = new[] + /// { + /// "bug", + /// "documentation", + /// }, + /// Assignees = new[] + /// { + /// "bob-github", + /// }, + /// MilestoneNumber = testRepositoryMilestone.Number, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// GitHub Issues can be imported using an ID made up of `repository:number`, e.g. diff --git a/sdk/dotnet/IssueLabel.cs b/sdk/dotnet/IssueLabel.cs index 4544adc0..3fb62a69 100644 --- a/sdk/dotnet/IssueLabel.cs +++ b/sdk/dotnet/IssueLabel.cs @@ -10,6 +10,26 @@ namespace Pulumi.Github { /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// // Create a new, red colored label + /// var testRepo = new Github.IssueLabel("testRepo", new() + /// { + /// Color = "FF0000", + /// Repository = "test-repo", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// GitHub Issue Labels can be imported using an ID made up of `repository:name`, e.g. diff --git a/sdk/dotnet/Membership.cs b/sdk/dotnet/Membership.cs index f7aaf821..0439fdee 100644 --- a/sdk/dotnet/Membership.cs +++ b/sdk/dotnet/Membership.cs @@ -16,6 +16,26 @@ namespace Pulumi.Github /// an invitation will be sent to the user to become part of the organization. When /// destroyed, either the invitation will be cancelled or the user will be removed. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// // Add a user to the organization + /// var membershipForSomeUser = new Github.Membership("membershipForSomeUser", new() + /// { + /// Role = "member", + /// Username = "SomeUser", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// GitHub Membership can be imported using an ID made up of `organization:username`, e.g. diff --git a/sdk/dotnet/OrganizationBlock.cs b/sdk/dotnet/OrganizationBlock.cs index 4db351ba..b360faa2 100644 --- a/sdk/dotnet/OrganizationBlock.cs +++ b/sdk/dotnet/OrganizationBlock.cs @@ -11,6 +11,24 @@ namespace Pulumi.Github { /// /// This resource allows you to create and manage blocks for GitHub organizations. + /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = new Github.OrganizationBlock("example", new() + /// { + /// Username = "paultyng", + /// }); + /// + /// }); + /// ``` /// [GithubResourceType("github:index/organizationBlock:OrganizationBlock")] public partial class OrganizationBlock : global::Pulumi.CustomResource diff --git a/sdk/dotnet/OrganizationCustomRole.cs b/sdk/dotnet/OrganizationCustomRole.cs index 12093e6b..547e094b 100644 --- a/sdk/dotnet/OrganizationCustomRole.cs +++ b/sdk/dotnet/OrganizationCustomRole.cs @@ -14,6 +14,47 @@ namespace Pulumi.Github /// /// > Note: Custom roles are currently only available in GitHub Enterprise Cloud. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = new Github.OrganizationCustomRole("example", new() + /// { + /// BaseRole = "read", + /// Description = "Example custom role that uses the read role as its base", + /// Permissions = new[] + /// { + /// "add_assignee", + /// "add_label", + /// "bypass_branch_protection", + /// "close_issue", + /// "close_pull_request", + /// "mark_as_duplicate", + /// "create_tag", + /// "delete_issue", + /// "delete_tag", + /// "manage_deploy_keys", + /// "push_protected_branch", + /// "read_code_scanning", + /// "reopen_issue", + /// "reopen_pull_request", + /// "request_pr_review", + /// "resolve_dependabot_alerts", + /// "resolve_secret_scanning_alerts", + /// "view_secret_scanning_alerts", + /// "write_code_scanning", + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Custom roles can be imported using the `id` of the role. The `id` of the custom role can be found using the [list custom roles in an organization](https://docs.github.com/en/enterprise-cloud@latest/rest/orgs/custom-roles#list-custom-repository-roles-in-an-organization) API. diff --git a/sdk/dotnet/OrganizationProject.cs b/sdk/dotnet/OrganizationProject.cs index b6e5b156..f2e56205 100644 --- a/sdk/dotnet/OrganizationProject.cs +++ b/sdk/dotnet/OrganizationProject.cs @@ -11,6 +11,24 @@ namespace Pulumi.Github { /// /// This resource allows you to create and manage projects for GitHub organization. + /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var project = new Github.OrganizationProject("project", new() + /// { + /// Body = "This is a organization project.", + /// }); + /// + /// }); + /// ``` /// [GithubResourceType("github:index/organizationProject:OrganizationProject")] public partial class OrganizationProject : global::Pulumi.CustomResource diff --git a/sdk/dotnet/OrganizationSecurityManager.cs b/sdk/dotnet/OrganizationSecurityManager.cs index 3e43ca2f..89044b9f 100644 --- a/sdk/dotnet/OrganizationSecurityManager.cs +++ b/sdk/dotnet/OrganizationSecurityManager.cs @@ -10,6 +10,29 @@ namespace Pulumi.Github { /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var someTeamTeam = new Github.Team("someTeamTeam", new() + /// { + /// Description = "Some cool team", + /// }); + /// + /// var someTeamOrganizationSecurityManager = new Github.OrganizationSecurityManager("someTeamOrganizationSecurityManager", new() + /// { + /// TeamSlug = someTeamTeam.Slug, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// GitHub Security Manager Teams can be imported using the GitHub team ID e.g. diff --git a/sdk/dotnet/OrganizationSettings.cs b/sdk/dotnet/OrganizationSettings.cs index a5aedbe3..6077c48c 100644 --- a/sdk/dotnet/OrganizationSettings.cs +++ b/sdk/dotnet/OrganizationSettings.cs @@ -12,6 +12,48 @@ namespace Pulumi.Github /// /// This resource allows you to create and manage settings for a GitHub Organization. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var test = new Github.OrganizationSettings("test", new() + /// { + /// AdvancedSecurityEnabledForNewRepositories = false, + /// BillingEmail = "test@example.com", + /// Blog = "https://example.com", + /// Company = "Test Company", + /// DefaultRepositoryPermission = "read", + /// DependabotAlertsEnabledForNewRepositories = false, + /// DependabotSecurityUpdatesEnabledForNewRepositories = false, + /// DependencyGraphEnabledForNewRepositories = false, + /// Description = "Test Description", + /// Email = "test@example.com", + /// HasOrganizationProjects = true, + /// HasRepositoryProjects = true, + /// Location = "Test Location", + /// MembersCanCreateInternalRepositories = true, + /// MembersCanCreatePages = true, + /// MembersCanCreatePrivatePages = true, + /// MembersCanCreatePrivateRepositories = true, + /// MembersCanCreatePublicPages = true, + /// MembersCanCreatePublicRepositories = true, + /// MembersCanCreateRepositories = true, + /// MembersCanForkPrivateRepositories = true, + /// SecretScanningEnabledForNewRepositories = false, + /// SecretScanningPushProtectionEnabledForNewRepositories = false, + /// TwitterUsername = "Test", + /// WebCommitSignoffRequired = true, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Organization settings can be imported using the `id` of the organization. The `id` of the organization can be found using the [get an organization](https://docs.github.com/en/rest/orgs/orgs#get-an-organization) API. diff --git a/sdk/dotnet/OrganizationWebhook.cs b/sdk/dotnet/OrganizationWebhook.cs index 0fd1a75a..aacc9f1b 100644 --- a/sdk/dotnet/OrganizationWebhook.cs +++ b/sdk/dotnet/OrganizationWebhook.cs @@ -12,6 +12,34 @@ namespace Pulumi.Github /// /// This resource allows you to create and manage webhooks for GitHub organization. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var foo = new Github.OrganizationWebhook("foo", new() + /// { + /// Active = false, + /// Configuration = new Github.Inputs.OrganizationWebhookConfigurationArgs + /// { + /// ContentType = "form", + /// InsecureSsl = false, + /// Url = "https://google.de/", + /// }, + /// Events = new[] + /// { + /// "issues", + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Organization webhooks can be imported using the `id` of the webhook. The `id` of the webhook can be found in the URL of the webhook. For example, `"https://github.com/organizations/foo-org/settings/hooks/123456789"`. diff --git a/sdk/dotnet/ProjectCard.cs b/sdk/dotnet/ProjectCard.cs index 6e87d889..428aad45 100644 --- a/sdk/dotnet/ProjectCard.cs +++ b/sdk/dotnet/ProjectCard.cs @@ -12,6 +12,78 @@ namespace Pulumi.Github /// /// This resource allows you to create and manage cards for GitHub projects. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var project = new Github.OrganizationProject("project", new() + /// { + /// Body = "This is an organization project.", + /// }); + /// + /// var column = new Github.ProjectColumn("column", new() + /// { + /// ProjectId = project.Id, + /// }); + /// + /// var card = new Github.ProjectCard("card", new() + /// { + /// ColumnId = column.ColumnId, + /// Note = "## Unaccepted 👇", + /// }); + /// + /// }); + /// ``` + /// ### Adding An Issue To A Project + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var testRepository = new Github.Repository("testRepository", new() + /// { + /// HasProjects = true, + /// HasIssues = true, + /// }); + /// + /// var testIssue = new Github.Issue("testIssue", new() + /// { + /// Repository = testRepository.Id, + /// Title = "Test issue title", + /// Body = "Test issue body", + /// }); + /// + /// var testRepositoryProject = new Github.RepositoryProject("testRepositoryProject", new() + /// { + /// Repository = testRepository.Name, + /// Body = "this is a test project", + /// }); + /// + /// var testProjectColumn = new Github.ProjectColumn("testProjectColumn", new() + /// { + /// ProjectId = testRepositoryProject.Id, + /// }); + /// + /// var testProjectCard = new Github.ProjectCard("testProjectCard", new() + /// { + /// ColumnId = testProjectColumn.ColumnId, + /// ContentId = testIssue.IssueId, + /// ContentType = "Issue", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// A GitHub Project Card can be imported using its [Card ID](https://developer.github.com/v3/projects/cards/#get-a-project-card): diff --git a/sdk/dotnet/ProjectColumn.cs b/sdk/dotnet/ProjectColumn.cs index 1b63984f..4b19450f 100644 --- a/sdk/dotnet/ProjectColumn.cs +++ b/sdk/dotnet/ProjectColumn.cs @@ -11,6 +11,29 @@ namespace Pulumi.Github { /// /// This resource allows you to create and manage columns for GitHub projects. + /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var project = new Github.OrganizationProject("project", new() + /// { + /// Body = "This is an organization project.", + /// }); + /// + /// var column = new Github.ProjectColumn("column", new() + /// { + /// ProjectId = project.Id, + /// }); + /// + /// }); + /// ``` /// [GithubResourceType("github:index/projectColumn:ProjectColumn")] public partial class ProjectColumn : global::Pulumi.CustomResource diff --git a/sdk/dotnet/Release.cs b/sdk/dotnet/Release.cs index c2428505..2adacfe1 100644 --- a/sdk/dotnet/Release.cs +++ b/sdk/dotnet/Release.cs @@ -13,6 +13,64 @@ namespace Pulumi.Github /// This resource allows you to create and manage a release in a specific /// GitHub repository. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var repo = new Github.Repository("repo", new() + /// { + /// Description = "GitHub repo managed by Terraform", + /// Private = false, + /// }); + /// + /// var example = new Github.Release("example", new() + /// { + /// Repository = repo.Name, + /// TagName = "v1.0.0", + /// }); + /// + /// }); + /// ``` + /// ### On Non-Default Branch + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleRepository = new Github.Repository("exampleRepository", new() + /// { + /// AutoInit = true, + /// }); + /// + /// var exampleBranch = new Github.Branch("exampleBranch", new() + /// { + /// Repository = exampleRepository.Name, + /// BranchName = "branch_name", + /// SourceBranch = exampleRepository.DefaultBranch, + /// }); + /// + /// var exampleRelease = new Github.Release("exampleRelease", new() + /// { + /// Repository = exampleRepository.Name, + /// TagName = "v1.0.0", + /// TargetCommitish = exampleBranch.BranchName, + /// Draft = false, + /// Prerelease = false, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// This resource can be imported using the `name` of the repository, combined with the `id` of the release, and a `:` character for separating components, e.g. diff --git a/sdk/dotnet/Repository.cs b/sdk/dotnet/Repository.cs index daa18673..b0623bd4 100644 --- a/sdk/dotnet/Repository.cs +++ b/sdk/dotnet/Repository.cs @@ -17,6 +17,57 @@ namespace Pulumi.Github /// the `contents:write` permission or else the `allow_merge_commit`, `allow_rebase_merge`, /// and `allow_squash_merge` attributes will be ignored, causing confusing diffs. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = new Github.Repository("example", new() + /// { + /// Description = "My awesome codebase", + /// Template = new Github.Inputs.RepositoryTemplateArgs + /// { + /// IncludeAllBranches = true, + /// Owner = "github", + /// Repository = "terraform-template-module", + /// }, + /// Visibility = "public", + /// }); + /// + /// }); + /// ``` + /// ### With GitHub Pages Enabled + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = new Github.Repository("example", new() + /// { + /// Description = "My awesome web page", + /// Pages = new Github.Inputs.RepositoryPagesArgs + /// { + /// Source = new Github.Inputs.RepositoryPagesSourceArgs + /// { + /// Branch = "master", + /// Path = "/docs", + /// }, + /// }, + /// Private = false, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Repositories can be imported using the `name`, e.g. diff --git a/sdk/dotnet/RepositoryAutolinkReference.cs b/sdk/dotnet/RepositoryAutolinkReference.cs index 9fb85ec0..0dbdf7dc 100644 --- a/sdk/dotnet/RepositoryAutolinkReference.cs +++ b/sdk/dotnet/RepositoryAutolinkReference.cs @@ -12,6 +12,32 @@ namespace Pulumi.Github /// /// This resource allows you to create and manage an autolink reference for a single repository. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var repo = new Github.Repository("repo", new() + /// { + /// Description = "GitHub repo managed by Terraform", + /// Private = false, + /// }); + /// + /// var autolink = new Github.RepositoryAutolinkReference("autolink", new() + /// { + /// Repository = repo.Name, + /// KeyPrefix = "TICKET-", + /// TargetUrlTemplate = "https://example.com/TICKET?query=<num>", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// ### Import by key prefix diff --git a/sdk/dotnet/RepositoryCollaborator.cs b/sdk/dotnet/RepositoryCollaborator.cs index a2f4ff90..f149fa01 100644 --- a/sdk/dotnet/RepositoryCollaborator.cs +++ b/sdk/dotnet/RepositoryCollaborator.cs @@ -35,6 +35,27 @@ namespace Pulumi.Github /// - [Adding outside collaborators to repositories in your organization](https://help.github.com/articles/adding-outside-collaborators-to-repositories-in-your-organization/) /// - [Converting an organization member to an outside collaborator](https://help.github.com/articles/converting-an-organization-member-to-an-outside-collaborator/) /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// // Add a collaborator to a repository + /// var aRepoCollaborator = new Github.RepositoryCollaborator("aRepoCollaborator", new() + /// { + /// Permission = "admin", + /// Repository = "our-cool-repo", + /// Username = "SomeUser", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// GitHub Repository Collaborators can be imported using an ID made up of `repository:username`, e.g. diff --git a/sdk/dotnet/RepositoryCollaborators.cs b/sdk/dotnet/RepositoryCollaborators.cs index 2c0b44df..304f2d36 100644 --- a/sdk/dotnet/RepositoryCollaborators.cs +++ b/sdk/dotnet/RepositoryCollaborators.cs @@ -35,6 +35,48 @@ namespace Pulumi.Github /// - [Adding outside collaborators to repositories in your organization](https://help.github.com/articles/adding-outside-collaborators-to-repositories-in-your-organization/) /// - [Converting an organization member to an outside collaborators](https://help.github.com/articles/converting-an-organization-member-to-an-outside-collaborator/) /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// // Add collaborators to a repository + /// var someTeam = new Github.Team("someTeam", new() + /// { + /// Description = "Some cool team", + /// }); + /// + /// var someRepo = new Github.Repository("someRepo"); + /// + /// var someRepoCollaborators = new Github.RepositoryCollaborators("someRepoCollaborators", new() + /// { + /// Repository = someRepo.Name, + /// Users = new[] + /// { + /// new Github.Inputs.RepositoryCollaboratorsUserArgs + /// { + /// Permission = "admin", + /// Username = "SomeUser", + /// }, + /// }, + /// Teams = new[] + /// { + /// new Github.Inputs.RepositoryCollaboratorsTeamArgs + /// { + /// Permission = "pull", + /// TeamId = someTeam.Slug, + /// }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// GitHub Repository Collaborators can be imported using the name `name`, e.g. diff --git a/sdk/dotnet/RepositoryDeployKey.cs b/sdk/dotnet/RepositoryDeployKey.cs index ee76a63e..0994781d 100644 --- a/sdk/dotnet/RepositoryDeployKey.cs +++ b/sdk/dotnet/RepositoryDeployKey.cs @@ -21,6 +21,28 @@ namespace Pulumi.Github /// Further documentation on GitHub repository deploy keys: /// - [About deploy keys](https://developer.github.com/guides/managing-deploy-keys/#deploy-keys) /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// // Add a deploy key + /// var exampleRepositoryDeployKey = new Github.RepositoryDeployKey("exampleRepositoryDeployKey", new() + /// { + /// Key = "ssh-rsa AAA...", + /// ReadOnly = false, + /// Repository = "test-repo", + /// Title = "Repository test key", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Repository deploy keys can be imported using a colon-separated pair of repository name and GitHub's key id. The latter can be obtained by GitHub's SDKs and API. diff --git a/sdk/dotnet/RepositoryDeploymentBranchPolicy.cs b/sdk/dotnet/RepositoryDeploymentBranchPolicy.cs index 1bcd59a6..b2a72800 100644 --- a/sdk/dotnet/RepositoryDeploymentBranchPolicy.cs +++ b/sdk/dotnet/RepositoryDeploymentBranchPolicy.cs @@ -12,6 +12,42 @@ namespace Pulumi.Github /// /// This resource allows you to create and manage deployment branch policies. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var env = new Github.RepositoryEnvironment("env", new() + /// { + /// Repository = "my_repo", + /// Environment = "my_env", + /// DeploymentBranchPolicy = new Github.Inputs.RepositoryEnvironmentDeploymentBranchPolicyArgs + /// { + /// ProtectedBranches = false, + /// CustomBranchPolicies = true, + /// }, + /// }); + /// + /// var foo = new Github.RepositoryDeploymentBranchPolicy("foo", new() + /// { + /// Repository = "my_repo", + /// EnvironmentName = "my_env", + /// }, new CustomResourceOptions + /// { + /// DependsOn = new[] + /// { + /// env, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// ```sh diff --git a/sdk/dotnet/RepositoryEnvironment.cs b/sdk/dotnet/RepositoryEnvironment.cs index c6296d70..25792437 100644 --- a/sdk/dotnet/RepositoryEnvironment.cs +++ b/sdk/dotnet/RepositoryEnvironment.cs @@ -12,6 +12,50 @@ namespace Pulumi.Github /// /// This resource allows you to create and manage environments for a GitHub repository. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var current = Github.GetUser.Invoke(new() + /// { + /// Username = "", + /// }); + /// + /// var exampleRepository = new Github.Repository("exampleRepository", new() + /// { + /// Description = "My awesome codebase", + /// }); + /// + /// var exampleRepositoryEnvironment = new Github.RepositoryEnvironment("exampleRepositoryEnvironment", new() + /// { + /// Environment = "example", + /// Repository = exampleRepository.Name, + /// Reviewers = new[] + /// { + /// new Github.Inputs.RepositoryEnvironmentReviewerArgs + /// { + /// Users = new[] + /// { + /// current.Apply(getUserResult => getUserResult.Id), + /// }, + /// }, + /// }, + /// DeploymentBranchPolicy = new Github.Inputs.RepositoryEnvironmentDeploymentBranchPolicyArgs + /// { + /// ProtectedBranches = true, + /// CustomBranchPolicies = false, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// GitHub Repository Environment can be imported using an ID made up of `name` of the repository combined with the `environment` name of the environment, separated by a `:` character, e.g. diff --git a/sdk/dotnet/RepositoryEnvironmentDeploymentPolicy.cs b/sdk/dotnet/RepositoryEnvironmentDeploymentPolicy.cs index a0c2cd81..aa2c03d5 100644 --- a/sdk/dotnet/RepositoryEnvironmentDeploymentPolicy.cs +++ b/sdk/dotnet/RepositoryEnvironmentDeploymentPolicy.cs @@ -12,6 +12,55 @@ namespace Pulumi.Github /// /// This resource allows you to create and manage environment deployment branch policies for a GitHub repository. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var current = Github.GetUser.Invoke(new() + /// { + /// Username = "", + /// }); + /// + /// var testRepository = new Github.Repository("testRepository"); + /// + /// var testRepositoryEnvironment = new Github.RepositoryEnvironment("testRepositoryEnvironment", new() + /// { + /// Repository = testRepository.Name, + /// Environment = "environment/test", + /// WaitTimer = 10000, + /// Reviewers = new[] + /// { + /// new Github.Inputs.RepositoryEnvironmentReviewerArgs + /// { + /// Users = new[] + /// { + /// current.Apply(getUserResult => getUserResult.Id), + /// }, + /// }, + /// }, + /// DeploymentBranchPolicy = new Github.Inputs.RepositoryEnvironmentDeploymentBranchPolicyArgs + /// { + /// ProtectedBranches = false, + /// CustomBranchPolicies = true, + /// }, + /// }); + /// + /// var testRepositoryEnvironmentDeploymentPolicy = new Github.RepositoryEnvironmentDeploymentPolicy("testRepositoryEnvironmentDeploymentPolicy", new() + /// { + /// Repository = testRepository.Name, + /// Environment = testRepositoryEnvironment.Environment, + /// BranchPattern = "releases/*", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// GitHub Repository Environment Deployment Policy can be imported using an ID made up of `name` of the repository combined with the `environment` name of the environment with the `Id` of the deployment policy, separated by a `:` character, e.g. diff --git a/sdk/dotnet/RepositoryFile.cs b/sdk/dotnet/RepositoryFile.cs index 053bb24a..e8e13f90 100644 --- a/sdk/dotnet/RepositoryFile.cs +++ b/sdk/dotnet/RepositoryFile.cs @@ -13,6 +13,36 @@ namespace Pulumi.Github /// This resource allows you to create and manage files within a /// GitHub repository. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var fooRepository = new Github.Repository("fooRepository", new() + /// { + /// AutoInit = true, + /// }); + /// + /// var fooRepositoryFile = new Github.RepositoryFile("fooRepositoryFile", new() + /// { + /// Repository = fooRepository.Name, + /// Branch = "main", + /// File = ".gitignore", + /// Content = "**/*.tfstate", + /// CommitMessage = "Managed by Terraform", + /// CommitAuthor = "Terraform User", + /// CommitEmail = "terraform@example.com", + /// OverwriteOnCreate = true, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Repository files can be imported using a combination of the `repo` and `file`, e.g. diff --git a/sdk/dotnet/RepositoryMilestone.cs b/sdk/dotnet/RepositoryMilestone.cs index 398f6962..dd76bca5 100644 --- a/sdk/dotnet/RepositoryMilestone.cs +++ b/sdk/dotnet/RepositoryMilestone.cs @@ -14,6 +14,27 @@ namespace Pulumi.Github /// /// This resource allows you to create and manage milestones for a GitHub Repository within an organization or user account. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// // Create a milestone for a repository + /// var example = new Github.RepositoryMilestone("example", new() + /// { + /// Owner = "example-owner", + /// Repository = "example-repository", + /// Title = "v1.1.0", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// A GitHub Repository Milestone can be imported using an ID made up of `owner/repository/number`, e.g. diff --git a/sdk/dotnet/RepositoryProject.cs b/sdk/dotnet/RepositoryProject.cs index 2a51d683..19bfed41 100644 --- a/sdk/dotnet/RepositoryProject.cs +++ b/sdk/dotnet/RepositoryProject.cs @@ -11,6 +11,31 @@ namespace Pulumi.Github { /// /// This resource allows you to create and manage projects for GitHub repository. + /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = new Github.Repository("example", new() + /// { + /// Description = "My awesome codebase", + /// HasProjects = true, + /// }); + /// + /// var project = new Github.RepositoryProject("project", new() + /// { + /// Body = "This is a repository project.", + /// Repository = example.Name, + /// }); + /// + /// }); + /// ``` /// [GithubResourceType("github:index/repositoryProject:RepositoryProject")] public partial class RepositoryProject : global::Pulumi.CustomResource diff --git a/sdk/dotnet/RepositoryPullRequest.cs b/sdk/dotnet/RepositoryPullRequest.cs index 655148a5..6929f350 100644 --- a/sdk/dotnet/RepositoryPullRequest.cs +++ b/sdk/dotnet/RepositoryPullRequest.cs @@ -11,6 +11,28 @@ namespace Pulumi.Github { /// /// This resource allows you to create and manage PullRequests for repositories within your GitHub organization or personal account. + /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = new Github.RepositoryPullRequest("example", new() + /// { + /// BaseRef = "main", + /// BaseRepository = "example-repository", + /// Body = "This will change everything", + /// HeadRef = "feature-branch", + /// Title = "My newest feature", + /// }); + /// + /// }); + /// ``` /// [GithubResourceType("github:index/repositoryPullRequest:RepositoryPullRequest")] public partial class RepositoryPullRequest : global::Pulumi.CustomResource diff --git a/sdk/dotnet/RepositoryRuleset.cs b/sdk/dotnet/RepositoryRuleset.cs index 466b75cb..312f1880 100644 --- a/sdk/dotnet/RepositoryRuleset.cs +++ b/sdk/dotnet/RepositoryRuleset.cs @@ -14,6 +14,66 @@ namespace Pulumi.Github /// /// This resource allows you to create and manage rulesets on the repository level. When applied, a new ruleset will be created. When destroyed, that ruleset will be removed. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleRepository = new Github.Repository("exampleRepository", new() + /// { + /// Description = "Example repository", + /// }); + /// + /// var exampleRepositoryRuleset = new Github.RepositoryRuleset("exampleRepositoryRuleset", new() + /// { + /// Repository = exampleRepository.Name, + /// Target = "branch", + /// Enforcement = "active", + /// Conditions = new Github.Inputs.RepositoryRulesetConditionsArgs + /// { + /// RefName = new Github.Inputs.RepositoryRulesetConditionsRefNameArgs + /// { + /// Includes = new[] + /// { + /// "~ALL", + /// }, + /// Excludes = new() { }, + /// }, + /// }, + /// BypassActors = new[] + /// { + /// new Github.Inputs.RepositoryRulesetBypassActorArgs + /// { + /// ActorId = 13473, + /// ActorType = "Integration", + /// BypassMode = "always", + /// }, + /// }, + /// Rules = new Github.Inputs.RepositoryRulesetRulesArgs + /// { + /// Creation = true, + /// Update = true, + /// Deletion = true, + /// RequiredLinearHistory = true, + /// RequiredSignatures = true, + /// RequiredDeployments = new Github.Inputs.RepositoryRulesetRulesRequiredDeploymentsArgs + /// { + /// RequiredDeploymentEnvironments = new[] + /// { + /// "test", + /// }, + /// }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// GitHub Repository Rulesets can be imported using the GitHub repository name and ruleset ID e.g. diff --git a/sdk/dotnet/RepositoryTagProtection.cs b/sdk/dotnet/RepositoryTagProtection.cs index aa101c12..077437ab 100644 --- a/sdk/dotnet/RepositoryTagProtection.cs +++ b/sdk/dotnet/RepositoryTagProtection.cs @@ -12,6 +12,25 @@ namespace Pulumi.Github /// /// This resource allows you to create and manage a repository tag protection for repositories within your GitHub organization or personal account. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = new Github.RepositoryTagProtection("example", new() + /// { + /// Pattern = "v*", + /// Repository = "example-repository", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Repository tag protections can be imported using the `name` of the repository, combined with the `id` of the tag protection, separated by a `/` character. The `id` of the tag protection can be found using the [GitHub API](https://docs.github.com/en/rest/repos/tags#list-tag-protection-states-for-a-repository). diff --git a/sdk/dotnet/RepositoryTopics.cs b/sdk/dotnet/RepositoryTopics.cs index 370e2d9e..624e0a2c 100644 --- a/sdk/dotnet/RepositoryTopics.cs +++ b/sdk/dotnet/RepositoryTopics.cs @@ -10,6 +10,34 @@ namespace Pulumi.Github { /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var testRepository = Github.GetRepository.Invoke(new() + /// { + /// Name = "test", + /// }); + /// + /// var testRepositoryTopics = new Github.RepositoryTopics("testRepositoryTopics", new() + /// { + /// Repository = github_repository.Test.Name, + /// Topics = new[] + /// { + /// "topic-1", + /// "topic-2", + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Repository topics can be imported using the `name` of the repository. diff --git a/sdk/dotnet/RepositoryWebhook.cs b/sdk/dotnet/RepositoryWebhook.cs index dee887f4..99127917 100644 --- a/sdk/dotnet/RepositoryWebhook.cs +++ b/sdk/dotnet/RepositoryWebhook.cs @@ -13,6 +13,42 @@ namespace Pulumi.Github /// This resource allows you to create and manage webhooks for repositories within your /// GitHub organization or personal account. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var repo = new Github.Repository("repo", new() + /// { + /// Description = "Terraform acceptance tests", + /// HomepageUrl = "http://example.com/", + /// Visibility = "public", + /// }); + /// + /// var foo = new Github.RepositoryWebhook("foo", new() + /// { + /// Repository = repo.Name, + /// Configuration = new Github.Inputs.RepositoryWebhookConfigurationArgs + /// { + /// Url = "https://google.de/", + /// ContentType = "form", + /// InsecureSsl = false, + /// }, + /// Active = false, + /// Events = new[] + /// { + /// "issues", + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Repository webhooks can be imported using the `name` of the repository, combined with the `id` of the webhook, separated by a `/` character. The `id` of the webhook can be found in the URL of the webhook. For example`"https://github.com/foo-org/foo-repo/settings/hooks/14711452"`. diff --git a/sdk/dotnet/Team.cs b/sdk/dotnet/Team.cs index 31a82b33..d074322e 100644 --- a/sdk/dotnet/Team.cs +++ b/sdk/dotnet/Team.cs @@ -15,6 +15,26 @@ namespace Pulumi.Github /// This resource allows you to add/remove teams from your organization. When applied, /// a new team will be created. When destroyed, that team will be removed. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// // Add a team to the organization + /// var someTeam = new Github.Team("someTeam", new() + /// { + /// Description = "Some cool team", + /// Privacy = "closed", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// GitHub Teams can be imported using the GitHub team ID or name e.g. diff --git a/sdk/dotnet/TeamMembers.cs b/sdk/dotnet/TeamMembers.cs index 0821645c..07da057e 100644 --- a/sdk/dotnet/TeamMembers.cs +++ b/sdk/dotnet/TeamMembers.cs @@ -10,6 +10,55 @@ namespace Pulumi.Github { /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// // Add a user to the organization + /// var membershipForSomeUser = new Github.Membership("membershipForSomeUser", new() + /// { + /// Username = "SomeUser", + /// Role = "member", + /// }); + /// + /// var membershipForAnotherUser = new Github.Membership("membershipForAnotherUser", new() + /// { + /// Username = "AnotherUser", + /// Role = "member", + /// }); + /// + /// var someTeam = new Github.Team("someTeam", new() + /// { + /// Description = "Some cool team", + /// }); + /// + /// var someTeamMembers = new Github.TeamMembers("someTeamMembers", new() + /// { + /// TeamId = someTeam.Id, + /// Members = new[] + /// { + /// new Github.Inputs.TeamMembersMemberArgs + /// { + /// Username = "SomeUser", + /// Role = "maintainer", + /// }, + /// new Github.Inputs.TeamMembersMemberArgs + /// { + /// Username = "AnotherUser", + /// Role = "member", + /// }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// GitHub Team Membership can be imported using the team ID `teamid` or team name, e.g. diff --git a/sdk/dotnet/TeamMembership.cs b/sdk/dotnet/TeamMembership.cs index ec36a3e9..af4ddf02 100644 --- a/sdk/dotnet/TeamMembership.cs +++ b/sdk/dotnet/TeamMembership.cs @@ -21,6 +21,38 @@ namespace Pulumi.Github /// /// > **Note** Organization owners may not be set as "members" of a team; they may only be set as "maintainers". Attempting to set organization an owner to "member" of a may result in a `pulumi preview` diff that changes their status back to "maintainer". /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// // Add a user to the organization + /// var membershipForSomeUser = new Github.Membership("membershipForSomeUser", new() + /// { + /// Username = "SomeUser", + /// Role = "member", + /// }); + /// + /// var someTeam = new Github.Team("someTeam", new() + /// { + /// Description = "Some cool team", + /// }); + /// + /// var someTeamMembership = new Github.TeamMembership("someTeamMembership", new() + /// { + /// TeamId = someTeam.Id, + /// Username = "SomeUser", + /// Role = "member", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// GitHub Team Membership can be imported using an ID made up of `teamid:username` or `teamname:username`, e.g. diff --git a/sdk/dotnet/TeamRepository.cs b/sdk/dotnet/TeamRepository.cs index 404366c5..d5a4dd9d 100644 --- a/sdk/dotnet/TeamRepository.cs +++ b/sdk/dotnet/TeamRepository.cs @@ -26,6 +26,34 @@ namespace Pulumi.Github /// This resource is non-authoritative, for managing ALL collaborators of a repo, use github.RepositoryCollaborators /// instead. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// // Add a repository to the team + /// var someTeam = new Github.Team("someTeam", new() + /// { + /// Description = "Some cool team", + /// }); + /// + /// var someRepo = new Github.Repository("someRepo"); + /// + /// var someTeamRepo = new Github.TeamRepository("someTeamRepo", new() + /// { + /// TeamId = someTeam.Id, + /// Repository = someRepo.Name, + /// Permission = "pull", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// GitHub Team Repository can be imported using an ID made up of `team_id:repository` or `team_name:repository`, e.g. diff --git a/sdk/dotnet/TeamSettings.cs b/sdk/dotnet/TeamSettings.cs index dce7cb05..f9a2845e 100644 --- a/sdk/dotnet/TeamSettings.cs +++ b/sdk/dotnet/TeamSettings.cs @@ -18,6 +18,36 @@ namespace Pulumi.Github /// /// > **Note**: This resource relies on the v4 GraphQl GitHub API. If this API is not available, or the Stone Crop schema preview is not available, then this resource will not work as intended. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// // Add a repository to the team + /// var someTeam = new Github.Team("someTeam", new() + /// { + /// Description = "Some cool team", + /// }); + /// + /// var codeReviewSettings = new Github.TeamSettings("codeReviewSettings", new() + /// { + /// TeamId = someTeam.Id, + /// ReviewRequestDelegation = new Github.Inputs.TeamSettingsReviewRequestDelegationArgs + /// { + /// Algorithm = "ROUND_ROBIN", + /// MemberCount = 1, + /// Notify = true, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// GitHub Teams can be imported using the GitHub team ID, or the team slug e.g. diff --git a/sdk/dotnet/UserGpgKey.cs b/sdk/dotnet/UserGpgKey.cs index a2851d64..dcebecd3 100644 --- a/sdk/dotnet/UserGpgKey.cs +++ b/sdk/dotnet/UserGpgKey.cs @@ -14,6 +14,27 @@ namespace Pulumi.Github /// /// This resource allows you to add/remove GPG keys from your user account. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = new Github.UserGpgKey("example", new() + /// { + /// ArmoredPublicKey = @"-----BEGIN PGP PUBLIC KEY BLOCK----- + /// ... + /// -----END PGP PUBLIC KEY BLOCK----- + /// ", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// GPG keys are not importable due to the fact that [API](https://developer.github.com/v3/users/gpg_keys/#gpg-keys) does not return previously uploaded GPG key. diff --git a/sdk/dotnet/UserSshKey.cs b/sdk/dotnet/UserSshKey.cs index bbce77fd..3d801ac9 100644 --- a/sdk/dotnet/UserSshKey.cs +++ b/sdk/dotnet/UserSshKey.cs @@ -14,6 +14,26 @@ namespace Pulumi.Github /// /// This resource allows you to add/remove SSH keys from your user account. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.IO; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = new Github.UserSshKey("example", new() + /// { + /// Title = "example title", + /// Key = File.ReadAllText("~/.ssh/id_rsa.pub"), + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// SSH keys can be imported using their ID e.g. diff --git a/sdk/go/github/actionsEnvironmentSecret.go b/sdk/go/github/actionsEnvironmentSecret.go index 49acdced..a1183115 100644 --- a/sdk/go/github/actionsEnvironmentSecret.go +++ b/sdk/go/github/actionsEnvironmentSecret.go @@ -13,6 +13,82 @@ import ( "github.com/pulumi/pulumi/sdk/v3/go/pulumix" ) +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-github/sdk/v5/go/github" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := github.NewActionsEnvironmentSecret(ctx, "exampleSecretActionsEnvironmentSecret", &github.ActionsEnvironmentSecretArgs{ +// Environment: pulumi.String("example_environment"), +// SecretName: pulumi.String("example_secret_name"), +// PlaintextValue: pulumi.Any(_var.Some_secret_string), +// }) +// if err != nil { +// return err +// } +// _, err = github.NewActionsEnvironmentSecret(ctx, "exampleSecretIndex/actionsEnvironmentSecretActionsEnvironmentSecret", &github.ActionsEnvironmentSecretArgs{ +// Environment: pulumi.String("example_environment"), +// SecretName: pulumi.String("example_secret_name"), +// EncryptedValue: pulumi.Any(_var.Some_encrypted_secret_string), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-github/sdk/v5/go/github" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// repo, err := github.LookupRepository(ctx, &github.LookupRepositoryArgs{ +// FullName: pulumi.StringRef("my-org/repo"), +// }, nil) +// if err != nil { +// return err +// } +// repoEnvironment, err := github.NewRepositoryEnvironment(ctx, "repoEnvironment", &github.RepositoryEnvironmentArgs{ +// Repository: *pulumi.String(repo.Name), +// Environment: pulumi.String("example_environment"), +// }) +// if err != nil { +// return err +// } +// _, err = github.NewActionsEnvironmentSecret(ctx, "testSecret", &github.ActionsEnvironmentSecretArgs{ +// Repository: *pulumi.String(repo.Name), +// Environment: repoEnvironment.Environment, +// SecretName: pulumi.String("test_secret_name"), +// PlaintextValue: pulumi.String("%s"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // This resource does not support importing. If you'd like to help contribute it, please visit our [GitHub page](https://github.com/integrations/terraform-provider-github)! diff --git a/sdk/go/github/actionsEnvironmentVariable.go b/sdk/go/github/actionsEnvironmentVariable.go index 9dc40df5..1d4239c4 100644 --- a/sdk/go/github/actionsEnvironmentVariable.go +++ b/sdk/go/github/actionsEnvironmentVariable.go @@ -16,6 +16,74 @@ import ( // This resource allows you to create and manage GitHub Actions variables within your GitHub repository environments. // You must have write access to a repository to use this resource. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-github/sdk/v5/go/github" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := github.NewActionsEnvironmentVariable(ctx, "exampleVariable", &github.ActionsEnvironmentVariableArgs{ +// Environment: pulumi.String("example_environment"), +// Value: pulumi.String("example_variable_value"), +// VariableName: pulumi.String("example_variable_name"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-github/sdk/v5/go/github" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// repo, err := github.LookupRepository(ctx, &github.LookupRepositoryArgs{ +// FullName: pulumi.StringRef("my-org/repo"), +// }, nil) +// if err != nil { +// return err +// } +// repoEnvironment, err := github.NewRepositoryEnvironment(ctx, "repoEnvironment", &github.RepositoryEnvironmentArgs{ +// Repository: *pulumi.String(repo.Name), +// Environment: pulumi.String("example_environment"), +// }) +// if err != nil { +// return err +// } +// _, err = github.NewActionsEnvironmentVariable(ctx, "exampleVariable", &github.ActionsEnvironmentVariableArgs{ +// Repository: *pulumi.String(repo.Name), +// Environment: repoEnvironment.Environment, +// VariableName: pulumi.String("example_variable_name"), +// Value: pulumi.String("example_variable_value"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // This resource can be imported using an ID made up of the repository name, environment name, and variable name: diff --git a/sdk/go/github/actionsOrganizationOidcSubjectClaimCustomizationTemplate.go b/sdk/go/github/actionsOrganizationOidcSubjectClaimCustomizationTemplate.go index b3f23b03..c42a4a65 100644 --- a/sdk/go/github/actionsOrganizationOidcSubjectClaimCustomizationTemplate.go +++ b/sdk/go/github/actionsOrganizationOidcSubjectClaimCustomizationTemplate.go @@ -19,6 +19,36 @@ import ( // More information on integrating GitHub with cloud providers using OpenID Connect and a list of available claims is // available in the [Actions documentation](https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/about-security-hardening-with-openid-connect). // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-github/sdk/v5/go/github" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := github.NewActionsOrganizationOidcSubjectClaimCustomizationTemplate(ctx, "exampleTemplate", &github.ActionsOrganizationOidcSubjectClaimCustomizationTemplateArgs{ +// IncludeClaimKeys: pulumi.StringArray{ +// pulumi.String("actor"), +// pulumi.String("context"), +// pulumi.String("repository_owner"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // This resource can be imported using the organization's name. diff --git a/sdk/go/github/actionsOrganizationPermissions.go b/sdk/go/github/actionsOrganizationPermissions.go index 72e93ad3..a944aa9c 100644 --- a/sdk/go/github/actionsOrganizationPermissions.go +++ b/sdk/go/github/actionsOrganizationPermissions.go @@ -16,6 +16,50 @@ import ( // This resource allows you to create and manage GitHub Actions permissions within your GitHub enterprise organizations. // You must have admin access to an organization to use this resource. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-github/sdk/v5/go/github" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := github.NewRepository(ctx, "example", nil) +// if err != nil { +// return err +// } +// _, err = github.NewActionsOrganizationPermissions(ctx, "test", &github.ActionsOrganizationPermissionsArgs{ +// AllowedActions: pulumi.String("selected"), +// EnabledRepositories: pulumi.String("selected"), +// AllowedActionsConfig: &github.ActionsOrganizationPermissionsAllowedActionsConfigArgs{ +// GithubOwnedAllowed: pulumi.Bool(true), +// PatternsAlloweds: pulumi.StringArray{ +// pulumi.String("actions/cache@*"), +// pulumi.String("actions/checkout@*"), +// }, +// VerifiedAllowed: pulumi.Bool(true), +// }, +// EnabledRepositoriesConfig: &github.ActionsOrganizationPermissionsEnabledRepositoriesConfigArgs{ +// RepositoryIds: pulumi.IntArray{ +// example.RepoId, +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // This resource can be imported using the ID of the GitHub organization: diff --git a/sdk/go/github/actionsOrganizationSecret.go b/sdk/go/github/actionsOrganizationSecret.go index 348bd033..32d58f80 100644 --- a/sdk/go/github/actionsOrganizationSecret.go +++ b/sdk/go/github/actionsOrganizationSecret.go @@ -13,6 +13,88 @@ import ( "github.com/pulumi/pulumi/sdk/v3/go/pulumix" ) +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-github/sdk/v5/go/github" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := github.NewActionsOrganizationSecret(ctx, "exampleSecretActionsOrganizationSecret", &github.ActionsOrganizationSecretArgs{ +// SecretName: pulumi.String("example_secret_name"), +// Visibility: pulumi.String("private"), +// PlaintextValue: pulumi.Any(_var.Some_secret_string), +// }) +// if err != nil { +// return err +// } +// _, err = github.NewActionsOrganizationSecret(ctx, "exampleSecretIndex/actionsOrganizationSecretActionsOrganizationSecret", &github.ActionsOrganizationSecretArgs{ +// SecretName: pulumi.String("example_secret_name"), +// Visibility: pulumi.String("private"), +// EncryptedValue: pulumi.Any(_var.Some_encrypted_secret_string), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-github/sdk/v5/go/github" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// repo, err := github.LookupRepository(ctx, &github.LookupRepositoryArgs{ +// FullName: pulumi.StringRef("my-org/repo"), +// }, nil) +// if err != nil { +// return err +// } +// _, err = github.NewActionsOrganizationSecret(ctx, "exampleSecretActionsOrganizationSecret", &github.ActionsOrganizationSecretArgs{ +// SecretName: pulumi.String("example_secret_name"), +// Visibility: pulumi.String("selected"), +// PlaintextValue: pulumi.Any(_var.Some_secret_string), +// SelectedRepositoryIds: pulumi.IntArray{ +// *pulumi.Int(repo.RepoId), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = github.NewActionsOrganizationSecret(ctx, "exampleSecretIndex/actionsOrganizationSecretActionsOrganizationSecret", &github.ActionsOrganizationSecretArgs{ +// SecretName: pulumi.String("example_secret_name"), +// Visibility: pulumi.String("selected"), +// EncryptedValue: pulumi.Any(_var.Some_encrypted_secret_string), +// SelectedRepositoryIds: pulumi.IntArray{ +// *pulumi.Int(repo.RepoId), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // This resource can be imported using an ID made up of the secret name: diff --git a/sdk/go/github/actionsOrganizationSecretRepositories.go b/sdk/go/github/actionsOrganizationSecretRepositories.go index 8439177f..4f58731d 100644 --- a/sdk/go/github/actionsOrganizationSecretRepositories.go +++ b/sdk/go/github/actionsOrganizationSecretRepositories.go @@ -18,6 +18,41 @@ import ( // // This resource is only applicable when `visibility` of the existing organization secret has been set to `selected`. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-github/sdk/v5/go/github" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// repo, err := github.LookupRepository(ctx, &github.LookupRepositoryArgs{ +// FullName: pulumi.StringRef("my-org/repo"), +// }, nil) +// if err != nil { +// return err +// } +// _, err = github.NewActionsOrganizationSecretRepositories(ctx, "orgSecretRepos", &github.ActionsOrganizationSecretRepositoriesArgs{ +// SecretName: pulumi.String("existing_secret_name"), +// SelectedRepositoryIds: pulumi.IntArray{ +// *pulumi.Int(repo.RepoId), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // This resource can be imported using an ID made up of the secret name: diff --git a/sdk/go/github/actionsOrganizationVariable.go b/sdk/go/github/actionsOrganizationVariable.go index 9d5d9ec7..41bb0d06 100644 --- a/sdk/go/github/actionsOrganizationVariable.go +++ b/sdk/go/github/actionsOrganizationVariable.go @@ -16,6 +16,69 @@ import ( // This resource allows you to create and manage GitHub Actions variables within your GitHub organization. // You must have write access to a repository to use this resource. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-github/sdk/v5/go/github" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := github.NewActionsOrganizationVariable(ctx, "exampleVariable", &github.ActionsOrganizationVariableArgs{ +// Value: pulumi.String("example_variable_value"), +// VariableName: pulumi.String("example_variable_name"), +// Visibility: pulumi.String("private"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-github/sdk/v5/go/github" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// repo, err := github.LookupRepository(ctx, &github.LookupRepositoryArgs{ +// FullName: pulumi.StringRef("my-org/repo"), +// }, nil) +// if err != nil { +// return err +// } +// _, err = github.NewActionsOrganizationVariable(ctx, "exampleVariable", &github.ActionsOrganizationVariableArgs{ +// VariableName: pulumi.String("example_variable_name"), +// Visibility: pulumi.String("selected"), +// Value: pulumi.String("example_variable_value"), +// SelectedRepositoryIds: pulumi.IntArray{ +// *pulumi.Int(repo.RepoId), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // This resource can be imported using an ID made up of the variable name: diff --git a/sdk/go/github/actionsRepositoryAccessLevel.go b/sdk/go/github/actionsRepositoryAccessLevel.go index a67527fe..99f6b32d 100644 --- a/sdk/go/github/actionsRepositoryAccessLevel.go +++ b/sdk/go/github/actionsRepositoryAccessLevel.go @@ -16,6 +16,39 @@ import ( // This resource allows you to set the access level of a non-public repositories actions and reusable workflows for use in other repositories. // You must have admin access to a repository to use this resource. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-github/sdk/v5/go/github" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := github.NewRepository(ctx, "example", &github.RepositoryArgs{ +// Visibility: pulumi.String("private"), +// }) +// if err != nil { +// return err +// } +// _, err = github.NewActionsRepositoryAccessLevel(ctx, "test", &github.ActionsRepositoryAccessLevelArgs{ +// AccessLevel: pulumi.String("user"), +// Repository: example.Name, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // This resource can be imported using the name of the GitHub repository: diff --git a/sdk/go/github/actionsRepositoryOidcSubjectClaimCustomizationTemplate.go b/sdk/go/github/actionsRepositoryOidcSubjectClaimCustomizationTemplate.go index c6a73bb7..7fd41dcc 100644 --- a/sdk/go/github/actionsRepositoryOidcSubjectClaimCustomizationTemplate.go +++ b/sdk/go/github/actionsRepositoryOidcSubjectClaimCustomizationTemplate.go @@ -27,6 +27,42 @@ import ( // | `false` | Set | `includeClaimKeys` | // | `false` | Unset | Organization's default if set, otherwise GitHub's default | // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-github/sdk/v5/go/github" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := github.NewRepository(ctx, "example", nil) +// if err != nil { +// return err +// } +// _, err = github.NewActionsRepositoryOidcSubjectClaimCustomizationTemplate(ctx, "exampleTemplate", &github.ActionsRepositoryOidcSubjectClaimCustomizationTemplateArgs{ +// Repository: example.Name, +// UseDefault: pulumi.Bool(false), +// IncludeClaimKeys: pulumi.StringArray{ +// pulumi.String("actor"), +// pulumi.String("context"), +// pulumi.String("repository_owner"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // This resource can be imported using the repository's name. diff --git a/sdk/go/github/actionsRepositoryPermissions.go b/sdk/go/github/actionsRepositoryPermissions.go index d154e1c0..921746f1 100644 --- a/sdk/go/github/actionsRepositoryPermissions.go +++ b/sdk/go/github/actionsRepositoryPermissions.go @@ -16,6 +16,45 @@ import ( // This resource allows you to enable and manage GitHub Actions permissions for a given repository. // You must have admin access to an repository to use this resource. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-github/sdk/v5/go/github" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := github.NewRepository(ctx, "example", nil) +// if err != nil { +// return err +// } +// _, err = github.NewActionsRepositoryPermissions(ctx, "test", &github.ActionsRepositoryPermissionsArgs{ +// AllowedActions: pulumi.String("selected"), +// AllowedActionsConfig: &github.ActionsRepositoryPermissionsAllowedActionsConfigArgs{ +// GithubOwnedAllowed: pulumi.Bool(true), +// PatternsAlloweds: pulumi.StringArray{ +// pulumi.String("actions/cache@*"), +// pulumi.String("actions/checkout@*"), +// }, +// VerifiedAllowed: pulumi.Bool(true), +// }, +// Repository: example.Name, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // This resource can be imported using the name of the GitHub repository: diff --git a/sdk/go/github/actionsRunnerGroup.go b/sdk/go/github/actionsRunnerGroup.go index c8ed1f8b..f3e3ec3d 100644 --- a/sdk/go/github/actionsRunnerGroup.go +++ b/sdk/go/github/actionsRunnerGroup.go @@ -16,6 +16,39 @@ import ( // This resource allows you to create and manage GitHub Actions runner groups within your GitHub enterprise organizations. // You must have admin access to an organization to use this resource. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-github/sdk/v5/go/github" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleRepository, err := github.NewRepository(ctx, "exampleRepository", nil) +// if err != nil { +// return err +// } +// _, err = github.NewActionsRunnerGroup(ctx, "exampleActionsRunnerGroup", &github.ActionsRunnerGroupArgs{ +// Visibility: pulumi.String("selected"), +// SelectedRepositoryIds: pulumi.IntArray{ +// exampleRepository.RepoId, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // This resource can be imported using the ID of the runner group: diff --git a/sdk/go/github/actionsSecret.go b/sdk/go/github/actionsSecret.go index b017f798..92a50a93 100644 --- a/sdk/go/github/actionsSecret.go +++ b/sdk/go/github/actionsSecret.go @@ -13,6 +13,48 @@ import ( "github.com/pulumi/pulumi/sdk/v3/go/pulumix" ) +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-github/sdk/v5/go/github" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := github.GetActionsPublicKey(ctx, &github.GetActionsPublicKeyArgs{ +// Repository: "example_repository", +// }, nil) +// if err != nil { +// return err +// } +// _, err = github.NewActionsSecret(ctx, "exampleSecretActionsSecret", &github.ActionsSecretArgs{ +// Repository: pulumi.String("example_repository"), +// SecretName: pulumi.String("example_secret_name"), +// PlaintextValue: pulumi.Any(_var.Some_secret_string), +// }) +// if err != nil { +// return err +// } +// _, err = github.NewActionsSecret(ctx, "exampleSecretIndex/actionsSecretActionsSecret", &github.ActionsSecretArgs{ +// Repository: pulumi.String("example_repository"), +// SecretName: pulumi.String("example_secret_name"), +// EncryptedValue: pulumi.Any(_var.Some_encrypted_secret_string), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // This resource can be imported using an ID made up of the `repository` and `secret_name`: diff --git a/sdk/go/github/actionsVariable.go b/sdk/go/github/actionsVariable.go index 33e685d4..1777eef7 100644 --- a/sdk/go/github/actionsVariable.go +++ b/sdk/go/github/actionsVariable.go @@ -16,6 +16,34 @@ import ( // This resource allows you to create and manage GitHub Actions variables within your GitHub repositories. // You must have write access to a repository to use this resource. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-github/sdk/v5/go/github" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := github.NewActionsVariable(ctx, "exampleVariable", &github.ActionsVariableArgs{ +// Repository: pulumi.String("example_repository"), +// Value: pulumi.String("example_variable_value"), +// VariableName: pulumi.String("example_variable_name"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // GitHub Actions variables can be imported using an ID made up of `repository:variable_name`, e.g. diff --git a/sdk/go/github/appInstallationRepository.go b/sdk/go/github/appInstallationRepository.go index bb9708da..db24a6b3 100644 --- a/sdk/go/github/appInstallationRepository.go +++ b/sdk/go/github/appInstallationRepository.go @@ -25,6 +25,37 @@ import ( // by the following the instructions at this // [link](https://docs.github.com/en/github/setting-up-and-managing-organizations-and-teams/reviewing-your-organizations-installed-integrations). // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-github/sdk/v5/go/github" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// someRepo, err := github.NewRepository(ctx, "someRepo", nil) +// if err != nil { +// return err +// } +// _, err = github.NewAppInstallationRepository(ctx, "someAppRepo", &github.AppInstallationRepositoryArgs{ +// InstallationId: pulumi.String("1234567"), +// Repository: someRepo.Name, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // GitHub App Installation Repository can be imported using an ID made up of `installation_id:repository`, e.g. diff --git a/sdk/go/github/branch.go b/sdk/go/github/branch.go index b29744a7..fd581259 100644 --- a/sdk/go/github/branch.go +++ b/sdk/go/github/branch.go @@ -18,6 +18,33 @@ import ( // Additional constraints can be applied to ensure your branch is created from // another branch or commit. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-github/sdk/v5/go/github" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := github.NewBranch(ctx, "development", &github.BranchArgs{ +// Branch: pulumi.String("development"), +// Repository: pulumi.String("example"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // GitHub Branch can be imported using an ID made up of `repository:branch`, e.g. diff --git a/sdk/go/github/branchDefault.go b/sdk/go/github/branchDefault.go index 23afa10b..2d0cbf08 100644 --- a/sdk/go/github/branchDefault.go +++ b/sdk/go/github/branchDefault.go @@ -19,6 +19,84 @@ import ( // // Note that use of this resource is incompatible with the `defaultBranch` option of the `Repository` resource. Using both will result in plans always showing a diff. // +// ## Example Usage +// +// Basic usage: +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-github/sdk/v5/go/github" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := github.NewRepository(ctx, "example", &github.RepositoryArgs{ +// Description: pulumi.String("My awesome codebase"), +// AutoInit: pulumi.Bool(true), +// }) +// if err != nil { +// return err +// } +// development, err := github.NewBranch(ctx, "development", &github.BranchArgs{ +// Repository: example.Name, +// Branch: pulumi.String("development"), +// }) +// if err != nil { +// return err +// } +// _, err = github.NewBranchDefault(ctx, "default", &github.BranchDefaultArgs{ +// Repository: example.Name, +// Branch: development.Branch, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// +// Renaming to a branch that doesn't exist: +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-github/sdk/v5/go/github" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := github.NewRepository(ctx, "example", &github.RepositoryArgs{ +// Description: pulumi.String("My awesome codebase"), +// AutoInit: pulumi.Bool(true), +// }) +// if err != nil { +// return err +// } +// _, err = github.NewBranchDefault(ctx, "default", &github.BranchDefaultArgs{ +// Repository: example.Name, +// Branch: pulumi.String("development"), +// Rename: pulumi.Bool(true), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // GitHub Branch Defaults can be imported using an ID made up of `repository`, e.g. diff --git a/sdk/go/github/branchProtection.go b/sdk/go/github/branchProtection.go index 290c42fd..ac94b64d 100644 --- a/sdk/go/github/branchProtection.go +++ b/sdk/go/github/branchProtection.go @@ -13,6 +13,87 @@ import ( "github.com/pulumi/pulumi/sdk/v3/go/pulumix" ) +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-github/sdk/v5/go/github" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleRepository, err := github.NewRepository(ctx, "exampleRepository", nil) +// if err != nil { +// return err +// } +// exampleUser, err := github.GetUser(ctx, &github.GetUserArgs{ +// Username: "example", +// }, nil) +// if err != nil { +// return err +// } +// exampleTeam, err := github.NewTeam(ctx, "exampleTeam", nil) +// if err != nil { +// return err +// } +// _, err = github.NewBranchProtection(ctx, "exampleBranchProtection", &github.BranchProtectionArgs{ +// RepositoryId: exampleRepository.NodeId, +// Pattern: pulumi.String("main"), +// EnforceAdmins: pulumi.Bool(true), +// AllowsDeletions: pulumi.Bool(true), +// RequiredStatusChecks: github.BranchProtectionRequiredStatusCheckArray{ +// &github.BranchProtectionRequiredStatusCheckArgs{ +// Strict: pulumi.Bool(false), +// Contexts: pulumi.StringArray{ +// pulumi.String("ci/travis"), +// }, +// }, +// }, +// RequiredPullRequestReviews: github.BranchProtectionRequiredPullRequestReviewArray{ +// &github.BranchProtectionRequiredPullRequestReviewArgs{ +// DismissStaleReviews: pulumi.Bool(true), +// RestrictDismissals: pulumi.Bool(true), +// DismissalRestrictions: pulumi.StringArray{ +// *pulumi.String(exampleUser.NodeId), +// exampleTeam.NodeId, +// pulumi.String("/exampleuser"), +// pulumi.String("exampleorganization/exampleteam"), +// }, +// }, +// }, +// PushRestrictions: pulumi.StringArray{ +// *pulumi.String(exampleUser.NodeId), +// pulumi.String("/exampleuser"), +// pulumi.String("exampleorganization/exampleteam"), +// }, +// ForcePushBypassers: pulumi.StringArray{ +// *pulumi.String(exampleUser.NodeId), +// pulumi.String("/exampleuser"), +// pulumi.String("exampleorganization/exampleteam"), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = github.NewTeamRepository(ctx, "exampleTeamRepository", &github.TeamRepositoryArgs{ +// TeamId: exampleTeam.ID(), +// Repository: exampleRepository.Name, +// Permission: pulumi.String("pull"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // GitHub Branch Protection can be imported using an ID made up of `repository:pattern`, e.g. diff --git a/sdk/go/github/branchProtectionV3.go b/sdk/go/github/branchProtectionV3.go index df86b4d7..4cb88a1e 100644 --- a/sdk/go/github/branchProtectionV3.go +++ b/sdk/go/github/branchProtectionV3.go @@ -19,6 +19,117 @@ import ( // // This resource allows you to configure branch protection for repositories in your organization. When applied, the branch will be protected from forced pushes and deletion. Additional constraints, such as required status checks or restrictions on users, teams, and apps, can also be configured. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-github/sdk/v5/go/github" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := github.NewBranchProtectionV3(ctx, "example", &github.BranchProtectionV3Args{ +// Repository: pulumi.Any(github_repository.Example.Name), +// Branch: pulumi.String("main"), +// Restrictions: &github.BranchProtectionV3RestrictionsArgs{ +// Users: pulumi.StringArray{ +// pulumi.String("foo-user"), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-github/sdk/v5/go/github" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleRepository, err := github.NewRepository(ctx, "exampleRepository", nil) +// if err != nil { +// return err +// } +// exampleTeam, err := github.NewTeam(ctx, "exampleTeam", nil) +// if err != nil { +// return err +// } +// _, err = github.NewBranchProtectionV3(ctx, "exampleBranchProtectionV3", &github.BranchProtectionV3Args{ +// Repository: exampleRepository.Name, +// Branch: pulumi.String("main"), +// EnforceAdmins: pulumi.Bool(true), +// RequiredStatusChecks: &github.BranchProtectionV3RequiredStatusChecksArgs{ +// Strict: pulumi.Bool(false), +// Checks: pulumi.StringArray{ +// pulumi.String("ci/check:824642007264"), +// }, +// }, +// RequiredPullRequestReviews: &github.BranchProtectionV3RequiredPullRequestReviewsArgs{ +// DismissStaleReviews: pulumi.Bool(true), +// DismissalUsers: pulumi.StringArray{ +// pulumi.String("foo-user"), +// }, +// DismissalTeams: pulumi.StringArray{ +// exampleTeam.Slug, +// }, +// BypassPullRequestAllowances: &github.BranchProtectionV3RequiredPullRequestReviewsBypassPullRequestAllowancesArgs{ +// Users: pulumi.StringArray{ +// pulumi.String("foo-user"), +// }, +// Teams: pulumi.StringArray{ +// exampleTeam.Slug, +// }, +// Apps: pulumi.StringArray{ +// pulumi.String("foo-app"), +// }, +// }, +// }, +// Restrictions: &github.BranchProtectionV3RestrictionsArgs{ +// Users: pulumi.StringArray{ +// pulumi.String("foo-user"), +// }, +// Teams: pulumi.StringArray{ +// exampleTeam.Slug, +// }, +// Apps: pulumi.StringArray{ +// pulumi.String("foo-app"), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// _, err = github.NewTeamRepository(ctx, "exampleTeamRepository", &github.TeamRepositoryArgs{ +// TeamId: exampleTeam.ID(), +// Repository: exampleRepository.Name, +// Permission: pulumi.String("pull"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // GitHub Branch Protection can be imported using an ID made up of `repository:branch`, e.g. diff --git a/sdk/go/github/codespacesOrganizationSecret.go b/sdk/go/github/codespacesOrganizationSecret.go index 8cfd3248..c2f928f4 100644 --- a/sdk/go/github/codespacesOrganizationSecret.go +++ b/sdk/go/github/codespacesOrganizationSecret.go @@ -13,6 +13,88 @@ import ( "github.com/pulumi/pulumi/sdk/v3/go/pulumix" ) +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-github/sdk/v5/go/github" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := github.NewCodespacesOrganizationSecret(ctx, "exampleSecretCodespacesOrganizationSecret", &github.CodespacesOrganizationSecretArgs{ +// SecretName: pulumi.String("example_secret_name"), +// Visibility: pulumi.String("private"), +// PlaintextValue: pulumi.Any(_var.Some_secret_string), +// }) +// if err != nil { +// return err +// } +// _, err = github.NewCodespacesOrganizationSecret(ctx, "exampleSecretIndex/codespacesOrganizationSecretCodespacesOrganizationSecret", &github.CodespacesOrganizationSecretArgs{ +// SecretName: pulumi.String("example_secret_name"), +// Visibility: pulumi.String("private"), +// EncryptedValue: pulumi.Any(_var.Some_encrypted_secret_string), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-github/sdk/v5/go/github" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// repo, err := github.LookupRepository(ctx, &github.LookupRepositoryArgs{ +// FullName: pulumi.StringRef("my-org/repo"), +// }, nil) +// if err != nil { +// return err +// } +// _, err = github.NewCodespacesOrganizationSecret(ctx, "exampleSecretCodespacesOrganizationSecret", &github.CodespacesOrganizationSecretArgs{ +// SecretName: pulumi.String("example_secret_name"), +// Visibility: pulumi.String("selected"), +// PlaintextValue: pulumi.Any(_var.Some_secret_string), +// SelectedRepositoryIds: pulumi.IntArray{ +// *pulumi.Int(repo.RepoId), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = github.NewCodespacesOrganizationSecret(ctx, "exampleSecretIndex/codespacesOrganizationSecretCodespacesOrganizationSecret", &github.CodespacesOrganizationSecretArgs{ +// SecretName: pulumi.String("example_secret_name"), +// Visibility: pulumi.String("selected"), +// EncryptedValue: pulumi.Any(_var.Some_encrypted_secret_string), +// SelectedRepositoryIds: pulumi.IntArray{ +// *pulumi.Int(repo.RepoId), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // # This resource can be imported using an ID made up of the secret name diff --git a/sdk/go/github/codespacesOrganizationSecretRepositories.go b/sdk/go/github/codespacesOrganizationSecretRepositories.go index e3b94fb6..15e08193 100644 --- a/sdk/go/github/codespacesOrganizationSecretRepositories.go +++ b/sdk/go/github/codespacesOrganizationSecretRepositories.go @@ -19,6 +19,41 @@ import ( // // This resource is only applicable when `visibility` of the existing organization secret has been set to `selected`. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-github/sdk/v5/go/github" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// repo, err := github.LookupRepository(ctx, &github.LookupRepositoryArgs{ +// FullName: pulumi.StringRef("my-org/repo"), +// }, nil) +// if err != nil { +// return err +// } +// _, err = github.NewCodespacesOrganizationSecretRepositories(ctx, "orgSecretRepos", &github.CodespacesOrganizationSecretRepositoriesArgs{ +// SecretName: pulumi.String("existing_secret_name"), +// SelectedRepositoryIds: pulumi.IntArray{ +// *pulumi.Int(repo.RepoId), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // This resource can be imported using an ID made up of the secret name: diff --git a/sdk/go/github/codespacesSecret.go b/sdk/go/github/codespacesSecret.go index 9ae00f06..3c8aa50a 100644 --- a/sdk/go/github/codespacesSecret.go +++ b/sdk/go/github/codespacesSecret.go @@ -13,6 +13,48 @@ import ( "github.com/pulumi/pulumi/sdk/v3/go/pulumix" ) +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-github/sdk/v5/go/github" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := github.GetCodespacesPublicKey(ctx, &github.GetCodespacesPublicKeyArgs{ +// Repository: "example_repository", +// }, nil) +// if err != nil { +// return err +// } +// _, err = github.NewCodespacesSecret(ctx, "exampleSecretCodespacesSecret", &github.CodespacesSecretArgs{ +// Repository: pulumi.String("example_repository"), +// SecretName: pulumi.String("example_secret_name"), +// PlaintextValue: pulumi.Any(_var.Some_secret_string), +// }) +// if err != nil { +// return err +// } +// _, err = github.NewCodespacesSecret(ctx, "exampleSecretIndex/codespacesSecretCodespacesSecret", &github.CodespacesSecretArgs{ +// Repository: pulumi.String("example_repository"), +// SecretName: pulumi.String("example_secret_name"), +// EncryptedValue: pulumi.Any(_var.Some_encrypted_secret_string), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // This resource can be imported using an ID made up of the `repository` and `secret_name`: diff --git a/sdk/go/github/codespacesUserSecret.go b/sdk/go/github/codespacesUserSecret.go index 7e6086ff..4a012416 100644 --- a/sdk/go/github/codespacesUserSecret.go +++ b/sdk/go/github/codespacesUserSecret.go @@ -13,6 +13,52 @@ import ( "github.com/pulumi/pulumi/sdk/v3/go/pulumix" ) +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-github/sdk/v5/go/github" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// repo, err := github.LookupRepository(ctx, &github.LookupRepositoryArgs{ +// FullName: pulumi.StringRef("my-org/repo"), +// }, nil) +// if err != nil { +// return err +// } +// _, err = github.NewCodespacesUserSecret(ctx, "exampleSecretCodespacesUserSecret", &github.CodespacesUserSecretArgs{ +// SecretName: pulumi.String("example_secret_name"), +// PlaintextValue: pulumi.Any(_var.Some_secret_string), +// SelectedRepositoryIds: pulumi.IntArray{ +// *pulumi.Int(repo.RepoId), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = github.NewCodespacesUserSecret(ctx, "exampleSecretIndex/codespacesUserSecretCodespacesUserSecret", &github.CodespacesUserSecretArgs{ +// SecretName: pulumi.String("example_secret_name"), +// EncryptedValue: pulumi.Any(_var.Some_encrypted_secret_string), +// SelectedRepositoryIds: pulumi.IntArray{ +// *pulumi.Int(repo.RepoId), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // # This resource can be imported using an ID made up of the secret name diff --git a/sdk/go/github/emuGroupMapping.go b/sdk/go/github/emuGroupMapping.go index b09d573c..1e6cc8d4 100644 --- a/sdk/go/github/emuGroupMapping.go +++ b/sdk/go/github/emuGroupMapping.go @@ -15,6 +15,33 @@ import ( // This resource manages mappings between external groups for enterprise managed users and GitHub teams. It wraps the API detailed [here](https://docs.github.com/en/rest/reference/teams#external-groups). Note that this is a distinct resource from `TeamSyncGroupMapping`. `EmuGroupMapping` is special to the Enterprise Managed User (EMU) external group feature, whereas `TeamSyncGroupMapping` is specific to Identity Provider Groups. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-github/sdk/v5/go/github" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := github.NewEmuGroupMapping(ctx, "exampleEmuGroupMapping", &github.EmuGroupMappingArgs{ +// GroupId: pulumi.Int(28836), +// TeamSlug: pulumi.String("emu-test-team"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // GitHub EMU External Group Mappings can be imported using the external `group_id`, e.g. diff --git a/sdk/go/github/enterpriseOrganization.go b/sdk/go/github/enterpriseOrganization.go index 27091687..6471b8c1 100644 --- a/sdk/go/github/enterpriseOrganization.go +++ b/sdk/go/github/enterpriseOrganization.go @@ -15,6 +15,38 @@ import ( // This resource allows you to create and manage a GitHub enterprise organization. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-github/sdk/v5/go/github" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := github.NewEnterpriseOrganization(ctx, "org", &github.EnterpriseOrganizationArgs{ +// EnterpriseId: pulumi.Any(data.Github_enterprise.Enterprise.Id), +// DisplayName: pulumi.String("Some Awesome Org"), +// Description: pulumi.String("Organization created with terraform"), +// BillingEmail: pulumi.String("jon@winteriscoming.com"), +// AdminLogins: pulumi.StringArray{ +// pulumi.String("jon-snow"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // GitHub Enterprise Organization can be imported using the `slug` of the enterprise, combined with the `orgname` of the organization, separated by a `/` character. diff --git a/sdk/go/github/getActionsEnvironmentSecrets.go b/sdk/go/github/getActionsEnvironmentSecrets.go index 5763049b..5eb3577c 100644 --- a/sdk/go/github/getActionsEnvironmentSecrets.go +++ b/sdk/go/github/getActionsEnvironmentSecrets.go @@ -13,6 +13,33 @@ import ( ) // Use this data source to retrieve the list of secrets of the repository environment. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-github/sdk/v5/go/github" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := github.GetActionsEnvironmentSecrets(ctx, &github.GetActionsEnvironmentSecretsArgs{ +// Environment: "exampleEnvironment", +// Name: pulumi.StringRef("exampleRepo"), +// }, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` func GetActionsEnvironmentSecrets(ctx *pulumi.Context, args *GetActionsEnvironmentSecretsArgs, opts ...pulumi.InvokeOption) (*GetActionsEnvironmentSecretsResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv GetActionsEnvironmentSecretsResult diff --git a/sdk/go/github/getActionsEnvironmentVariables.go b/sdk/go/github/getActionsEnvironmentVariables.go index 1c161121..fbd4340f 100644 --- a/sdk/go/github/getActionsEnvironmentVariables.go +++ b/sdk/go/github/getActionsEnvironmentVariables.go @@ -13,6 +13,33 @@ import ( ) // Use this data source to retrieve the list of variables of the repository environment. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-github/sdk/v5/go/github" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := github.GetActionsEnvironmentVariables(ctx, &github.GetActionsEnvironmentVariablesArgs{ +// Environment: "exampleEnvironment", +// Name: pulumi.StringRef("exampleRepo"), +// }, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` func GetActionsEnvironmentVariables(ctx *pulumi.Context, args *GetActionsEnvironmentVariablesArgs, opts ...pulumi.InvokeOption) (*GetActionsEnvironmentVariablesResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv GetActionsEnvironmentVariablesResult diff --git a/sdk/go/github/getActionsOrganizationOidcSubjectClaimCustomizationTemplate.go b/sdk/go/github/getActionsOrganizationOidcSubjectClaimCustomizationTemplate.go index 13ad6070..d5d8eddf 100644 --- a/sdk/go/github/getActionsOrganizationOidcSubjectClaimCustomizationTemplate.go +++ b/sdk/go/github/getActionsOrganizationOidcSubjectClaimCustomizationTemplate.go @@ -13,6 +13,30 @@ import ( ) // Use this data source to retrieve the OpenID Connect subject claim customization template for an organization +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-github/sdk/v5/go/github" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := github.LookupActionsOrganizationOidcSubjectClaimCustomizationTemplate(ctx, nil, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` func LookupActionsOrganizationOidcSubjectClaimCustomizationTemplate(ctx *pulumi.Context, opts ...pulumi.InvokeOption) (*LookupActionsOrganizationOidcSubjectClaimCustomizationTemplateResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupActionsOrganizationOidcSubjectClaimCustomizationTemplateResult diff --git a/sdk/go/github/getActionsOrganizationPublicKey.go b/sdk/go/github/getActionsOrganizationPublicKey.go index 388b3c62..2831760a 100644 --- a/sdk/go/github/getActionsOrganizationPublicKey.go +++ b/sdk/go/github/getActionsOrganizationPublicKey.go @@ -14,6 +14,30 @@ import ( // Use this data source to retrieve information about a GitHub Actions Organization public key. This data source is required to be used with other GitHub secrets interactions. // Note that the provider `token` must have admin rights to an organization to retrieve it's action public key. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-github/sdk/v5/go/github" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := github.GetActionsOrganizationPublicKey(ctx, nil, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` func GetActionsOrganizationPublicKey(ctx *pulumi.Context, opts ...pulumi.InvokeOption) (*GetActionsOrganizationPublicKeyResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv GetActionsOrganizationPublicKeyResult diff --git a/sdk/go/github/getActionsOrganizationRegistrationToken.go b/sdk/go/github/getActionsOrganizationRegistrationToken.go index 50bb82d6..b864af98 100644 --- a/sdk/go/github/getActionsOrganizationRegistrationToken.go +++ b/sdk/go/github/getActionsOrganizationRegistrationToken.go @@ -13,6 +13,30 @@ import ( ) // Use this data source to retrieve a GitHub Actions organization registration token. This token can then be used to register a self-hosted runner. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-github/sdk/v5/go/github" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := github.GetActionsOrganizationRegistrationToken(ctx, nil, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` func GetActionsOrganizationRegistrationToken(ctx *pulumi.Context, opts ...pulumi.InvokeOption) (*GetActionsOrganizationRegistrationTokenResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv GetActionsOrganizationRegistrationTokenResult diff --git a/sdk/go/github/getActionsOrganizationSecrets.go b/sdk/go/github/getActionsOrganizationSecrets.go index 924d98a9..055aabef 100644 --- a/sdk/go/github/getActionsOrganizationSecrets.go +++ b/sdk/go/github/getActionsOrganizationSecrets.go @@ -13,6 +13,30 @@ import ( ) // Use this data source to retrieve the list of secrets of the organization. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-github/sdk/v5/go/github" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := github.GetActionsOrganizationSecrets(ctx, nil, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` func GetActionsOrganizationSecrets(ctx *pulumi.Context, opts ...pulumi.InvokeOption) (*GetActionsOrganizationSecretsResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv GetActionsOrganizationSecretsResult diff --git a/sdk/go/github/getActionsOrganizationVariables.go b/sdk/go/github/getActionsOrganizationVariables.go index 941be9f9..a7084022 100644 --- a/sdk/go/github/getActionsOrganizationVariables.go +++ b/sdk/go/github/getActionsOrganizationVariables.go @@ -13,6 +13,30 @@ import ( ) // Use this data source to retrieve the list of variables of the organization. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-github/sdk/v5/go/github" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := github.GetActionsOrganizationVariables(ctx, nil, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` func GetActionsOrganizationVariables(ctx *pulumi.Context, opts ...pulumi.InvokeOption) (*GetActionsOrganizationVariablesResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv GetActionsOrganizationVariablesResult diff --git a/sdk/go/github/getActionsPublicKey.go b/sdk/go/github/getActionsPublicKey.go index 38c350fb..76424c57 100644 --- a/sdk/go/github/getActionsPublicKey.go +++ b/sdk/go/github/getActionsPublicKey.go @@ -14,6 +14,32 @@ import ( // Use this data source to retrieve information about a GitHub Actions public key. This data source is required to be used with other GitHub secrets interactions. // Note that the provider `token` must have admin rights to a repository to retrieve it's action public key. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-github/sdk/v5/go/github" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := github.GetActionsPublicKey(ctx, &github.GetActionsPublicKeyArgs{ +// Repository: "example_repo", +// }, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` func GetActionsPublicKey(ctx *pulumi.Context, args *GetActionsPublicKeyArgs, opts ...pulumi.InvokeOption) (*GetActionsPublicKeyResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv GetActionsPublicKeyResult diff --git a/sdk/go/github/getActionsRegistrationToken.go b/sdk/go/github/getActionsRegistrationToken.go index e873ae1c..1438590c 100644 --- a/sdk/go/github/getActionsRegistrationToken.go +++ b/sdk/go/github/getActionsRegistrationToken.go @@ -13,6 +13,32 @@ import ( ) // Use this data source to retrieve a GitHub Actions repository registration token. This token can then be used to register a self-hosted runner. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-github/sdk/v5/go/github" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := github.GetActionsRegistrationToken(ctx, &github.GetActionsRegistrationTokenArgs{ +// Repository: "example_repo", +// }, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` func GetActionsRegistrationToken(ctx *pulumi.Context, args *GetActionsRegistrationTokenArgs, opts ...pulumi.InvokeOption) (*GetActionsRegistrationTokenResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv GetActionsRegistrationTokenResult diff --git a/sdk/go/github/getActionsRepositoryOidcSubjectClaimCustomizationTemplate.go b/sdk/go/github/getActionsRepositoryOidcSubjectClaimCustomizationTemplate.go index 8faaf2d4..3fadb6ba 100644 --- a/sdk/go/github/getActionsRepositoryOidcSubjectClaimCustomizationTemplate.go +++ b/sdk/go/github/getActionsRepositoryOidcSubjectClaimCustomizationTemplate.go @@ -13,6 +13,32 @@ import ( ) // Use this data source to retrieve the OpenID Connect subject claim customization template for a repository +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-github/sdk/v5/go/github" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := github.LookupActionsRepositoryOidcSubjectClaimCustomizationTemplate(ctx, &github.LookupActionsRepositoryOidcSubjectClaimCustomizationTemplateArgs{ +// Name: "example_repository", +// }, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` func LookupActionsRepositoryOidcSubjectClaimCustomizationTemplate(ctx *pulumi.Context, args *LookupActionsRepositoryOidcSubjectClaimCustomizationTemplateArgs, opts ...pulumi.InvokeOption) (*LookupActionsRepositoryOidcSubjectClaimCustomizationTemplateResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupActionsRepositoryOidcSubjectClaimCustomizationTemplateResult diff --git a/sdk/go/github/getActionsSecrets.go b/sdk/go/github/getActionsSecrets.go index 00a9bad6..9b9f0834 100644 --- a/sdk/go/github/getActionsSecrets.go +++ b/sdk/go/github/getActionsSecrets.go @@ -13,6 +13,32 @@ import ( ) // Use this data source to retrieve the list of secrets for a GitHub repository. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-github/sdk/v5/go/github" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := github.GetActionsSecrets(ctx, &github.GetActionsSecretsArgs{ +// Name: pulumi.StringRef("example"), +// }, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` func GetActionsSecrets(ctx *pulumi.Context, args *GetActionsSecretsArgs, opts ...pulumi.InvokeOption) (*GetActionsSecretsResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv GetActionsSecretsResult diff --git a/sdk/go/github/getActionsVariables.go b/sdk/go/github/getActionsVariables.go index ca101062..5cd12927 100644 --- a/sdk/go/github/getActionsVariables.go +++ b/sdk/go/github/getActionsVariables.go @@ -13,6 +13,32 @@ import ( ) // Use this data source to retrieve the list of variables for a GitHub repository. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-github/sdk/v5/go/github" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := github.GetActionsVariables(ctx, &github.GetActionsVariablesArgs{ +// Name: pulumi.StringRef("example"), +// }, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` func GetActionsVariables(ctx *pulumi.Context, args *GetActionsVariablesArgs, opts ...pulumi.InvokeOption) (*GetActionsVariablesResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv GetActionsVariablesResult diff --git a/sdk/go/github/getAppToken.go b/sdk/go/github/getAppToken.go index cbb67fc1..c9a41966 100644 --- a/sdk/go/github/getAppToken.go +++ b/sdk/go/github/getAppToken.go @@ -13,6 +13,44 @@ import ( ) // Use this data source to generate a [GitHub App JWT](https://docs.github.com/en/apps/creating-github-apps/authenticating-with-a-github-app/generating-a-json-web-token-jwt-for-a-github-app). +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "os" +// +// "github.com/pulumi/pulumi-github/sdk/v5/go/github" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func readFileOrPanic(path string) pulumi.StringPtrInput { +// data, err := os.ReadFile(path) +// if err != nil { +// panic(err.Error()) +// } +// return pulumi.String(string(data)) +// } +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := github.GetAppToken(ctx, &github.GetAppTokenArgs{ +// AppId: "123456", +// InstallationId: "78910", +// PemFile: readFileOrPanic("foo/bar.pem"), +// }, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` func GetAppToken(ctx *pulumi.Context, args *GetAppTokenArgs, opts ...pulumi.InvokeOption) (*GetAppTokenResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv GetAppTokenResult diff --git a/sdk/go/github/getBranch.go b/sdk/go/github/getBranch.go index a6b23aac..84756d7a 100644 --- a/sdk/go/github/getBranch.go +++ b/sdk/go/github/getBranch.go @@ -13,6 +13,33 @@ import ( ) // Use this data source to retrieve information about a repository branch. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-github/sdk/v5/go/github" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := github.LookupBranch(ctx, &github.LookupBranchArgs{ +// Branch: "development", +// Repository: "example", +// }, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` func LookupBranch(ctx *pulumi.Context, args *LookupBranchArgs, opts ...pulumi.InvokeOption) (*LookupBranchResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupBranchResult diff --git a/sdk/go/github/getBranchProtectionRules.go b/sdk/go/github/getBranchProtectionRules.go index 2a0e86a2..33f1b9cf 100644 --- a/sdk/go/github/getBranchProtectionRules.go +++ b/sdk/go/github/getBranchProtectionRules.go @@ -13,6 +13,32 @@ import ( ) // Use this data source to retrieve a list of repository branch protection rules. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-github/sdk/v5/go/github" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := github.GetBranchProtectionRules(ctx, &github.GetBranchProtectionRulesArgs{ +// Repository: "example", +// }, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` func GetBranchProtectionRules(ctx *pulumi.Context, args *GetBranchProtectionRulesArgs, opts ...pulumi.InvokeOption) (*GetBranchProtectionRulesResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv GetBranchProtectionRulesResult diff --git a/sdk/go/github/getCodespacesOrganizationPublicKey.go b/sdk/go/github/getCodespacesOrganizationPublicKey.go index 40913329..2136d225 100644 --- a/sdk/go/github/getCodespacesOrganizationPublicKey.go +++ b/sdk/go/github/getCodespacesOrganizationPublicKey.go @@ -14,6 +14,30 @@ import ( // Use this data source to retrieve information about a GitHub Codespaces Organization public key. This data source is required to be used with other GitHub secrets interactions. // Note that the provider `token` must have admin rights to an organization to retrieve it's Codespaces public key. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-github/sdk/v5/go/github" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := github.GetCodespacesOrganizationPublicKey(ctx, nil, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` func GetCodespacesOrganizationPublicKey(ctx *pulumi.Context, opts ...pulumi.InvokeOption) (*GetCodespacesOrganizationPublicKeyResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv GetCodespacesOrganizationPublicKeyResult diff --git a/sdk/go/github/getCodespacesOrganizationSecrets.go b/sdk/go/github/getCodespacesOrganizationSecrets.go index afc41228..48c5f6f7 100644 --- a/sdk/go/github/getCodespacesOrganizationSecrets.go +++ b/sdk/go/github/getCodespacesOrganizationSecrets.go @@ -13,6 +13,30 @@ import ( ) // Use this data source to retrieve the list of codespaces secrets of the organization. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-github/sdk/v5/go/github" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := github.GetCodespacesOrganizationSecrets(ctx, nil, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` func GetCodespacesOrganizationSecrets(ctx *pulumi.Context, opts ...pulumi.InvokeOption) (*GetCodespacesOrganizationSecretsResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv GetCodespacesOrganizationSecretsResult diff --git a/sdk/go/github/getCodespacesPublicKey.go b/sdk/go/github/getCodespacesPublicKey.go index 9b6dc1c0..29358017 100644 --- a/sdk/go/github/getCodespacesPublicKey.go +++ b/sdk/go/github/getCodespacesPublicKey.go @@ -14,6 +14,32 @@ import ( // Use this data source to retrieve information about a GitHub Codespaces public key. This data source is required to be used with other GitHub secrets interactions. // Note that the provider `token` must have admin rights to a repository to retrieve it's Codespaces public key. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-github/sdk/v5/go/github" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := github.GetCodespacesPublicKey(ctx, &github.GetCodespacesPublicKeyArgs{ +// Repository: "example_repo", +// }, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` func GetCodespacesPublicKey(ctx *pulumi.Context, args *GetCodespacesPublicKeyArgs, opts ...pulumi.InvokeOption) (*GetCodespacesPublicKeyResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv GetCodespacesPublicKeyResult diff --git a/sdk/go/github/getCodespacesSecrets.go b/sdk/go/github/getCodespacesSecrets.go index 31f273c3..bc8ce572 100644 --- a/sdk/go/github/getCodespacesSecrets.go +++ b/sdk/go/github/getCodespacesSecrets.go @@ -13,6 +13,38 @@ import ( ) // Use this data source to retrieve the list of codespaces secrets for a GitHub repository. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-github/sdk/v5/go/github" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := github.GetCodespacesSecrets(ctx, &github.GetCodespacesSecretsArgs{ +// Name: pulumi.StringRef("example_repository"), +// }, nil) +// if err != nil { +// return err +// } +// _, err = github.GetCodespacesSecrets(ctx, &github.GetCodespacesSecretsArgs{ +// FullName: pulumi.StringRef("org/example_repository"), +// }, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` func GetCodespacesSecrets(ctx *pulumi.Context, args *GetCodespacesSecretsArgs, opts ...pulumi.InvokeOption) (*GetCodespacesSecretsResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv GetCodespacesSecretsResult diff --git a/sdk/go/github/getCodespacesUserPublicKey.go b/sdk/go/github/getCodespacesUserPublicKey.go index 756f8244..1c792562 100644 --- a/sdk/go/github/getCodespacesUserPublicKey.go +++ b/sdk/go/github/getCodespacesUserPublicKey.go @@ -14,6 +14,30 @@ import ( // Use this data source to retrieve information about a GitHub Codespaces User public key. This data source is required to be used with other GitHub secrets interactions. // Note that the provider `token` must have admin rights to an user to retrieve it's Codespaces public key. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-github/sdk/v5/go/github" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := github.GetCodespacesUserPublicKey(ctx, nil, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` func GetCodespacesUserPublicKey(ctx *pulumi.Context, opts ...pulumi.InvokeOption) (*GetCodespacesUserPublicKeyResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv GetCodespacesUserPublicKeyResult diff --git a/sdk/go/github/getCodespacesUserSecrets.go b/sdk/go/github/getCodespacesUserSecrets.go index c3d5597f..73dd40c9 100644 --- a/sdk/go/github/getCodespacesUserSecrets.go +++ b/sdk/go/github/getCodespacesUserSecrets.go @@ -13,6 +13,30 @@ import ( ) // Use this data source to retrieve the list of codespaces secrets of the user. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-github/sdk/v5/go/github" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := github.GetCodespacesUserSecrets(ctx, nil, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` func GetCodespacesUserSecrets(ctx *pulumi.Context, opts ...pulumi.InvokeOption) (*GetCodespacesUserSecretsResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv GetCodespacesUserSecretsResult diff --git a/sdk/go/github/getCollaborators.go b/sdk/go/github/getCollaborators.go index 81a112f4..28924a70 100644 --- a/sdk/go/github/getCollaborators.go +++ b/sdk/go/github/getCollaborators.go @@ -13,6 +13,33 @@ import ( ) // Use this data source to retrieve the collaborators for a given repository. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-github/sdk/v5/go/github" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := github.GetCollaborators(ctx, &github.GetCollaboratorsArgs{ +// Owner: "example_owner", +// Repository: "example_repository", +// }, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` func GetCollaborators(ctx *pulumi.Context, args *GetCollaboratorsArgs, opts ...pulumi.InvokeOption) (*GetCollaboratorsResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv GetCollaboratorsResult diff --git a/sdk/go/github/getDependabotOrganizationPublicKey.go b/sdk/go/github/getDependabotOrganizationPublicKey.go index 0e90d15b..6b598bb8 100644 --- a/sdk/go/github/getDependabotOrganizationPublicKey.go +++ b/sdk/go/github/getDependabotOrganizationPublicKey.go @@ -14,6 +14,30 @@ import ( // Use this data source to retrieve information about a GitHub Dependabot Organization public key. This data source is required to be used with other GitHub secrets interactions. // Note that the provider `token` must have admin rights to an organization to retrieve it's Dependabot public key. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-github/sdk/v5/go/github" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := github.GetDependabotOrganizationPublicKey(ctx, nil, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` func GetDependabotOrganizationPublicKey(ctx *pulumi.Context, opts ...pulumi.InvokeOption) (*GetDependabotOrganizationPublicKeyResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv GetDependabotOrganizationPublicKeyResult diff --git a/sdk/go/github/getDependabotOrganizationSecrets.go b/sdk/go/github/getDependabotOrganizationSecrets.go index b9a26571..8178e55e 100644 --- a/sdk/go/github/getDependabotOrganizationSecrets.go +++ b/sdk/go/github/getDependabotOrganizationSecrets.go @@ -13,6 +13,30 @@ import ( ) // Use this data source to retrieve the list of dependabot secrets of the organization. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-github/sdk/v5/go/github" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := github.GetDependabotOrganizationSecrets(ctx, nil, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` func GetDependabotOrganizationSecrets(ctx *pulumi.Context, opts ...pulumi.InvokeOption) (*GetDependabotOrganizationSecretsResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv GetDependabotOrganizationSecretsResult diff --git a/sdk/go/github/getDependabotSecrets.go b/sdk/go/github/getDependabotSecrets.go index 3c2ba42d..9e840f93 100644 --- a/sdk/go/github/getDependabotSecrets.go +++ b/sdk/go/github/getDependabotSecrets.go @@ -13,6 +13,32 @@ import ( ) // Use this data source to retrieve the list of dependabot secrets for a GitHub repository. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-github/sdk/v5/go/github" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := github.GetDependabotSecrets(ctx, &github.GetDependabotSecretsArgs{ +// Name: pulumi.StringRef("example"), +// }, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` func GetDependabotSecrets(ctx *pulumi.Context, args *GetDependabotSecretsArgs, opts ...pulumi.InvokeOption) (*GetDependabotSecretsResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv GetDependabotSecretsResult diff --git a/sdk/go/github/getEnterprise.go b/sdk/go/github/getEnterprise.go index 424a904b..e38694ba 100644 --- a/sdk/go/github/getEnterprise.go +++ b/sdk/go/github/getEnterprise.go @@ -13,6 +13,32 @@ import ( ) // Use this data source to retrieve basic information about a GitHub enterprise. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-github/sdk/v5/go/github" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := github.GetEnterprise(ctx, &github.GetEnterpriseArgs{ +// Slug: "example-co", +// }, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` func GetEnterprise(ctx *pulumi.Context, args *GetEnterpriseArgs, opts ...pulumi.InvokeOption) (*GetEnterpriseResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv GetEnterpriseResult diff --git a/sdk/go/github/getExternalGroups.go b/sdk/go/github/getExternalGroups.go index 614aa2b2..49631f8f 100644 --- a/sdk/go/github/getExternalGroups.go +++ b/sdk/go/github/getExternalGroups.go @@ -13,6 +13,32 @@ import ( ) // Use this data source to retrieve external groups belonging to an organization. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-github/sdk/v5/go/github" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleExternalGroups, err := github.GetExternalGroups(ctx, nil, nil) +// if err != nil { +// return err +// } +// localGroups := exampleExternalGroups +// ctx.Export("groups", localGroups) +// return nil +// }) +// } +// +// ``` func GetExternalGroups(ctx *pulumi.Context, opts ...pulumi.InvokeOption) (*GetExternalGroupsResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv GetExternalGroupsResult diff --git a/sdk/go/github/getGithubApp.go b/sdk/go/github/getGithubApp.go index b69dfd86..20dfaff3 100644 --- a/sdk/go/github/getGithubApp.go +++ b/sdk/go/github/getGithubApp.go @@ -13,6 +13,32 @@ import ( ) // Use this data source to retrieve information about an app. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-github/sdk/v5/go/github" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := github.GetGithubApp(ctx, &github.GetGithubAppArgs{ +// Slug: "foobar", +// }, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` func GetGithubApp(ctx *pulumi.Context, args *GetGithubAppArgs, opts ...pulumi.InvokeOption) (*GetGithubAppResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv GetGithubAppResult diff --git a/sdk/go/github/getIpRanges.go b/sdk/go/github/getIpRanges.go index a5f5fe96..1fb30301 100644 --- a/sdk/go/github/getIpRanges.go +++ b/sdk/go/github/getIpRanges.go @@ -13,6 +13,30 @@ import ( ) // Use this data source to retrieve information about GitHub's IP addresses. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-github/sdk/v5/go/github" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := github.GetIpRanges(ctx, nil, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` func GetIpRanges(ctx *pulumi.Context, opts ...pulumi.InvokeOption) (*GetIpRangesResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv GetIpRangesResult diff --git a/sdk/go/github/getMembership.go b/sdk/go/github/getMembership.go index bfef8caa..4b3a02ff 100644 --- a/sdk/go/github/getMembership.go +++ b/sdk/go/github/getMembership.go @@ -16,6 +16,32 @@ import ( // as what role they have within it. // If the user's membership in the organization is pending their acceptance of an invite, // the role they would have once they accept will be returned. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-github/sdk/v5/go/github" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := github.LookupMembership(ctx, &github.LookupMembershipArgs{ +// Username: "SomeUser", +// }, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` func LookupMembership(ctx *pulumi.Context, args *LookupMembershipArgs, opts ...pulumi.InvokeOption) (*LookupMembershipResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupMembershipResult diff --git a/sdk/go/github/getOrganization.go b/sdk/go/github/getOrganization.go index 6927f2d4..17b4de47 100644 --- a/sdk/go/github/getOrganization.go +++ b/sdk/go/github/getOrganization.go @@ -13,6 +13,32 @@ import ( ) // Use this data source to retrieve basic information about a GitHub Organization. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-github/sdk/v5/go/github" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := github.GetOrganization(ctx, &github.GetOrganizationArgs{ +// Name: "github", +// }, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` func GetOrganization(ctx *pulumi.Context, args *GetOrganizationArgs, opts ...pulumi.InvokeOption) (*GetOrganizationResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv GetOrganizationResult diff --git a/sdk/go/github/getOrganizationCustomRole.go b/sdk/go/github/getOrganizationCustomRole.go index 154335cc..82516aa0 100644 --- a/sdk/go/github/getOrganizationCustomRole.go +++ b/sdk/go/github/getOrganizationCustomRole.go @@ -15,6 +15,32 @@ import ( // Use this data source to retrieve information about a custom role in a GitHub Organization. // // > Note: Custom roles are currently only available in GitHub Enterprise Cloud. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-github/sdk/v5/go/github" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := github.LookupOrganizationCustomRole(ctx, &github.LookupOrganizationCustomRoleArgs{ +// Name: "example", +// }, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` func LookupOrganizationCustomRole(ctx *pulumi.Context, args *LookupOrganizationCustomRoleArgs, opts ...pulumi.InvokeOption) (*LookupOrganizationCustomRoleResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupOrganizationCustomRoleResult diff --git a/sdk/go/github/getOrganizationExternalIdentities.go b/sdk/go/github/getOrganizationExternalIdentities.go index 4398ec32..b2abf801 100644 --- a/sdk/go/github/getOrganizationExternalIdentities.go +++ b/sdk/go/github/getOrganizationExternalIdentities.go @@ -14,6 +14,30 @@ import ( // Use this data source to retrieve each organization member's SAML or SCIM user // attributes. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-github/sdk/v5/go/github" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := github.GetOrganizationExternalIdentities(ctx, nil, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` func GetOrganizationExternalIdentities(ctx *pulumi.Context, opts ...pulumi.InvokeOption) (*GetOrganizationExternalIdentitiesResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv GetOrganizationExternalIdentitiesResult diff --git a/sdk/go/github/getOrganizationIpAllowList.go b/sdk/go/github/getOrganizationIpAllowList.go index c7952dcf..38b8a833 100644 --- a/sdk/go/github/getOrganizationIpAllowList.go +++ b/sdk/go/github/getOrganizationIpAllowList.go @@ -15,6 +15,30 @@ import ( // Use this data source to retrieve information about the IP allow list of an organization. // The allow list for IP addresses will block access to private resources via the web, API, // and Git from any IP addresses that are not on the allow list. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-github/sdk/v5/go/github" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := github.GetOrganizationIpAllowList(ctx, nil, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` func GetOrganizationIpAllowList(ctx *pulumi.Context, opts ...pulumi.InvokeOption) (*GetOrganizationIpAllowListResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv GetOrganizationIpAllowListResult diff --git a/sdk/go/github/getOrganizationTeamSyncGroups.go b/sdk/go/github/getOrganizationTeamSyncGroups.go index f19b83d8..38372fea 100644 --- a/sdk/go/github/getOrganizationTeamSyncGroups.go +++ b/sdk/go/github/getOrganizationTeamSyncGroups.go @@ -13,6 +13,30 @@ import ( ) // Use this data source to retrieve the identity provider (IdP) groups for an organization. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-github/sdk/v5/go/github" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := github.GetOrganizationTeamSyncGroups(ctx, nil, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` func GetOrganizationTeamSyncGroups(ctx *pulumi.Context, opts ...pulumi.InvokeOption) (*GetOrganizationTeamSyncGroupsResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv GetOrganizationTeamSyncGroupsResult diff --git a/sdk/go/github/getOrganizationTeams.go b/sdk/go/github/getOrganizationTeams.go index 7b0937ca..f7abdca1 100644 --- a/sdk/go/github/getOrganizationTeams.go +++ b/sdk/go/github/getOrganizationTeams.go @@ -13,6 +13,58 @@ import ( ) // Use this data source to retrieve information about all GitHub teams in an organization. +// +// ## Example Usage +// +// To retrieve *all* teams of the organization: +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-github/sdk/v5/go/github" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := github.GetOrganizationTeams(ctx, nil, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// +// To retrieve only the team's at the root of the organization: +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-github/sdk/v5/go/github" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := github.GetOrganizationTeams(ctx, &github.GetOrganizationTeamsArgs{ +// RootTeamsOnly: pulumi.BoolRef(true), +// }, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` func GetOrganizationTeams(ctx *pulumi.Context, args *GetOrganizationTeamsArgs, opts ...pulumi.InvokeOption) (*GetOrganizationTeamsResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv GetOrganizationTeamsResult diff --git a/sdk/go/github/getOrganizationWebhooks.go b/sdk/go/github/getOrganizationWebhooks.go index b515fd81..e512d9db 100644 --- a/sdk/go/github/getOrganizationWebhooks.go +++ b/sdk/go/github/getOrganizationWebhooks.go @@ -13,6 +13,32 @@ import ( ) // Use this data source to retrieve all webhooks of the organization. +// +// ## Example Usage +// +// To retrieve *all* webhooks of the organization: +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-github/sdk/v5/go/github" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := github.GetOrganizationWebhooks(ctx, nil, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` func GetOrganizationWebhooks(ctx *pulumi.Context, opts ...pulumi.InvokeOption) (*GetOrganizationWebhooksResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv GetOrganizationWebhooksResult diff --git a/sdk/go/github/getRef.go b/sdk/go/github/getRef.go index 5be151c8..ca548543 100644 --- a/sdk/go/github/getRef.go +++ b/sdk/go/github/getRef.go @@ -13,6 +13,34 @@ import ( ) // Use this data source to retrieve information about a repository ref. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-github/sdk/v5/go/github" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := github.GetRef(ctx, &github.GetRefArgs{ +// Owner: pulumi.StringRef("example"), +// Ref: "heads/development", +// Repository: "example", +// }, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` func GetRef(ctx *pulumi.Context, args *GetRefArgs, opts ...pulumi.InvokeOption) (*GetRefResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv GetRefResult diff --git a/sdk/go/github/getRepositories.go b/sdk/go/github/getRepositories.go index 5187804a..569d80f1 100644 --- a/sdk/go/github/getRepositories.go +++ b/sdk/go/github/getRepositories.go @@ -17,6 +17,33 @@ import ( // [as documented in official API docs](https://developer.github.com/v3/search/#about-the-search-api). // // Use this data source to retrieve a list of GitHub repositories using a search query. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-github/sdk/v5/go/github" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := github.GetRepositories(ctx, &github.GetRepositoriesArgs{ +// IncludeRepoId: pulumi.BoolRef(true), +// Query: "org:hashicorp language:Go", +// }, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` func GetRepositories(ctx *pulumi.Context, args *GetRepositoriesArgs, opts ...pulumi.InvokeOption) (*GetRepositoriesResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv GetRepositoriesResult diff --git a/sdk/go/github/getRepository.go b/sdk/go/github/getRepository.go index a3f0a894..03a9386e 100644 --- a/sdk/go/github/getRepository.go +++ b/sdk/go/github/getRepository.go @@ -13,6 +13,32 @@ import ( ) // Use this data source to retrieve information about a GitHub repository. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-github/sdk/v5/go/github" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := github.LookupRepository(ctx, &github.LookupRepositoryArgs{ +// FullName: pulumi.StringRef("hashicorp/terraform"), +// }, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` func LookupRepository(ctx *pulumi.Context, args *LookupRepositoryArgs, opts ...pulumi.InvokeOption) (*LookupRepositoryResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupRepositoryResult diff --git a/sdk/go/github/getRepositoryAutolinkReferences.go b/sdk/go/github/getRepositoryAutolinkReferences.go index 74959625..b153979d 100644 --- a/sdk/go/github/getRepositoryAutolinkReferences.go +++ b/sdk/go/github/getRepositoryAutolinkReferences.go @@ -13,6 +13,32 @@ import ( ) // Use this data source to retrieve autolink references for a repository. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-github/sdk/v5/go/github" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := github.GetRepositoryAutolinkReferences(ctx, &github.GetRepositoryAutolinkReferencesArgs{ +// Repository: "example-repository", +// }, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` func GetRepositoryAutolinkReferences(ctx *pulumi.Context, args *GetRepositoryAutolinkReferencesArgs, opts ...pulumi.InvokeOption) (*GetRepositoryAutolinkReferencesResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv GetRepositoryAutolinkReferencesResult diff --git a/sdk/go/github/getRepositoryBranches.go b/sdk/go/github/getRepositoryBranches.go index f6ccbe3a..4f3686ed 100644 --- a/sdk/go/github/getRepositoryBranches.go +++ b/sdk/go/github/getRepositoryBranches.go @@ -13,6 +13,32 @@ import ( ) // Use this data source to retrieve information about branches in a repository. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-github/sdk/v5/go/github" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := github.GetRepositoryBranches(ctx, &github.GetRepositoryBranchesArgs{ +// Repository: "example-repository", +// }, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` func GetRepositoryBranches(ctx *pulumi.Context, args *GetRepositoryBranchesArgs, opts ...pulumi.InvokeOption) (*GetRepositoryBranchesResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv GetRepositoryBranchesResult diff --git a/sdk/go/github/getRepositoryDeployKeys.go b/sdk/go/github/getRepositoryDeployKeys.go index 51198415..9fb2f239 100644 --- a/sdk/go/github/getRepositoryDeployKeys.go +++ b/sdk/go/github/getRepositoryDeployKeys.go @@ -13,6 +13,32 @@ import ( ) // Use this data source to retrieve all deploy keys of a repository. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-github/sdk/v5/go/github" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := github.GetRepositoryDeployKeys(ctx, &github.GetRepositoryDeployKeysArgs{ +// Repository: "example-repository", +// }, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` func GetRepositoryDeployKeys(ctx *pulumi.Context, args *GetRepositoryDeployKeysArgs, opts ...pulumi.InvokeOption) (*GetRepositoryDeployKeysResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv GetRepositoryDeployKeysResult diff --git a/sdk/go/github/getRepositoryDeploymentBranchPolicies.go b/sdk/go/github/getRepositoryDeploymentBranchPolicies.go index 5a42d8af..491baf6f 100644 --- a/sdk/go/github/getRepositoryDeploymentBranchPolicies.go +++ b/sdk/go/github/getRepositoryDeploymentBranchPolicies.go @@ -13,6 +13,33 @@ import ( ) // Use this data source to retrieve deployment branch policies for a repository / environment. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-github/sdk/v5/go/github" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := github.GetRepositoryDeploymentBranchPolicies(ctx, &github.GetRepositoryDeploymentBranchPoliciesArgs{ +// EnvironmentName: "env_name", +// Repository: "example-repository", +// }, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` func GetRepositoryDeploymentBranchPolicies(ctx *pulumi.Context, args *GetRepositoryDeploymentBranchPoliciesArgs, opts ...pulumi.InvokeOption) (*GetRepositoryDeploymentBranchPoliciesResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv GetRepositoryDeploymentBranchPoliciesResult diff --git a/sdk/go/github/getRepositoryEnvironments.go b/sdk/go/github/getRepositoryEnvironments.go index 4cc905c2..226982a5 100644 --- a/sdk/go/github/getRepositoryEnvironments.go +++ b/sdk/go/github/getRepositoryEnvironments.go @@ -13,6 +13,32 @@ import ( ) // Use this data source to retrieve information about environments for a repository. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-github/sdk/v5/go/github" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := github.GetRepositoryEnvironments(ctx, &github.GetRepositoryEnvironmentsArgs{ +// Repository: "example-repository", +// }, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` func GetRepositoryEnvironments(ctx *pulumi.Context, args *GetRepositoryEnvironmentsArgs, opts ...pulumi.InvokeOption) (*GetRepositoryEnvironmentsResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv GetRepositoryEnvironmentsResult diff --git a/sdk/go/github/getRepositoryFile.go b/sdk/go/github/getRepositoryFile.go index a9a1cfec..25c5a020 100644 --- a/sdk/go/github/getRepositoryFile.go +++ b/sdk/go/github/getRepositoryFile.go @@ -14,6 +14,34 @@ import ( // This data source allows you to read files within a // GitHub repository. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-github/sdk/v5/go/github" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := github.LookupRepositoryFile(ctx, &github.LookupRepositoryFileArgs{ +// Repository: github_repository.Foo.Name, +// Branch: pulumi.StringRef("main"), +// File: ".gitignore", +// }, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` func LookupRepositoryFile(ctx *pulumi.Context, args *LookupRepositoryFileArgs, opts ...pulumi.InvokeOption) (*LookupRepositoryFileResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupRepositoryFileResult diff --git a/sdk/go/github/getRepositoryMilestone.go b/sdk/go/github/getRepositoryMilestone.go index 5b9eef63..057425a7 100644 --- a/sdk/go/github/getRepositoryMilestone.go +++ b/sdk/go/github/getRepositoryMilestone.go @@ -13,6 +13,34 @@ import ( ) // Use this data source to retrieve information about a specific GitHub milestone in a repository. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-github/sdk/v5/go/github" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := github.LookupRepositoryMilestone(ctx, &github.LookupRepositoryMilestoneArgs{ +// Number: 1, +// Owner: "example-owner", +// Repository: "example-repository", +// }, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` func LookupRepositoryMilestone(ctx *pulumi.Context, args *LookupRepositoryMilestoneArgs, opts ...pulumi.InvokeOption) (*LookupRepositoryMilestoneResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupRepositoryMilestoneResult diff --git a/sdk/go/github/getRepositoryPullRequest.go b/sdk/go/github/getRepositoryPullRequest.go index 6863623f..e1ccf375 100644 --- a/sdk/go/github/getRepositoryPullRequest.go +++ b/sdk/go/github/getRepositoryPullRequest.go @@ -13,6 +13,33 @@ import ( ) // Use this data source to retrieve information about a specific GitHub Pull Request in a repository. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-github/sdk/v5/go/github" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := github.LookupRepositoryPullRequest(ctx, &github.LookupRepositoryPullRequestArgs{ +// BaseRepository: "example_repository", +// Number: 1, +// }, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` func LookupRepositoryPullRequest(ctx *pulumi.Context, args *LookupRepositoryPullRequestArgs, opts ...pulumi.InvokeOption) (*LookupRepositoryPullRequestResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupRepositoryPullRequestResult diff --git a/sdk/go/github/getRepositoryPullRequests.go b/sdk/go/github/getRepositoryPullRequests.go index a52cdb36..75989ff6 100644 --- a/sdk/go/github/getRepositoryPullRequests.go +++ b/sdk/go/github/getRepositoryPullRequests.go @@ -13,6 +13,36 @@ import ( ) // Use this data source to retrieve information about multiple GitHub Pull Requests in a repository. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-github/sdk/v5/go/github" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := github.LookupRepositoryPullRequests(ctx, &github.LookupRepositoryPullRequestsArgs{ +// BaseRef: pulumi.StringRef("main"), +// BaseRepository: "example-repository", +// SortBy: pulumi.StringRef("updated"), +// SortDirection: pulumi.StringRef("desc"), +// State: pulumi.StringRef("open"), +// }, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` func LookupRepositoryPullRequests(ctx *pulumi.Context, args *LookupRepositoryPullRequestsArgs, opts ...pulumi.InvokeOption) (*LookupRepositoryPullRequestsResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupRepositoryPullRequestsResult diff --git a/sdk/go/github/getRepositoryTeams.go b/sdk/go/github/getRepositoryTeams.go index db809afb..62dc41f6 100644 --- a/sdk/go/github/getRepositoryTeams.go +++ b/sdk/go/github/getRepositoryTeams.go @@ -13,6 +13,32 @@ import ( ) // Use this data source to retrieve the list of teams which have access to a GitHub repository. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-github/sdk/v5/go/github" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := github.GetRepositoryTeams(ctx, &github.GetRepositoryTeamsArgs{ +// Name: pulumi.StringRef("example"), +// }, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` func GetRepositoryTeams(ctx *pulumi.Context, args *GetRepositoryTeamsArgs, opts ...pulumi.InvokeOption) (*GetRepositoryTeamsResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv GetRepositoryTeamsResult diff --git a/sdk/go/github/getRepositoryWebhooks.go b/sdk/go/github/getRepositoryWebhooks.go index 65a672e1..e3ab9da9 100644 --- a/sdk/go/github/getRepositoryWebhooks.go +++ b/sdk/go/github/getRepositoryWebhooks.go @@ -13,6 +13,34 @@ import ( ) // Use this data source to retrieve webhooks for a given repository. +// +// ## Example Usage +// +// To retrieve webhooks of a repository: +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-github/sdk/v5/go/github" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := github.GetRepositoryWebhooks(ctx, &github.GetRepositoryWebhooksArgs{ +// Repository: "foo", +// }, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` func GetRepositoryWebhooks(ctx *pulumi.Context, args *GetRepositoryWebhooksArgs, opts ...pulumi.InvokeOption) (*GetRepositoryWebhooksResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv GetRepositoryWebhooksResult diff --git a/sdk/go/github/getRestApi.go b/sdk/go/github/getRestApi.go index 29783e9a..b01948c7 100644 --- a/sdk/go/github/getRestApi.go +++ b/sdk/go/github/getRestApi.go @@ -13,6 +13,32 @@ import ( ) // Use this data source to retrieve information about a GitHub resource through REST API. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-github/sdk/v5/go/github" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := github.GetRestApi(ctx, &github.GetRestApiArgs{ +// Endpoint: "repos/example_repo/git/refs/heads/main", +// }, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` func GetRestApi(ctx *pulumi.Context, args *GetRestApiArgs, opts ...pulumi.InvokeOption) (*GetRestApiResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv GetRestApiResult diff --git a/sdk/go/github/getSshKeys.go b/sdk/go/github/getSshKeys.go index 3cf3ba8b..b320f033 100644 --- a/sdk/go/github/getSshKeys.go +++ b/sdk/go/github/getSshKeys.go @@ -13,6 +13,30 @@ import ( ) // Use this data source to retrieve information about GitHub's SSH keys. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-github/sdk/v5/go/github" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := github.GetSshKeys(ctx, nil, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` func GetSshKeys(ctx *pulumi.Context, opts ...pulumi.InvokeOption) (*GetSshKeysResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv GetSshKeysResult diff --git a/sdk/go/github/getTeam.go b/sdk/go/github/getTeam.go index f8c83d4b..6c78e027 100644 --- a/sdk/go/github/getTeam.go +++ b/sdk/go/github/getTeam.go @@ -13,6 +13,32 @@ import ( ) // Use this data source to retrieve information about a GitHub team. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-github/sdk/v5/go/github" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := github.LookupTeam(ctx, &github.LookupTeamArgs{ +// Slug: "example", +// }, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` func LookupTeam(ctx *pulumi.Context, args *LookupTeamArgs, opts ...pulumi.InvokeOption) (*LookupTeamResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupTeamResult diff --git a/sdk/go/github/getTree.go b/sdk/go/github/getTree.go index d573bf0b..51bfb06e 100644 --- a/sdk/go/github/getTree.go +++ b/sdk/go/github/getTree.go @@ -13,6 +13,48 @@ import ( ) // Use this data source to retrieve information about a single tree. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-github/sdk/v5/go/github" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// thisRepository, err := github.LookupRepository(ctx, &github.LookupRepositoryArgs{ +// Name: pulumi.StringRef("example"), +// }, nil) +// if err != nil { +// return err +// } +// thisBranch, err := github.LookupBranch(ctx, &github.LookupBranchArgs{ +// Branch: thisRepository.DefaultBranch, +// Repository: thisRepository.Name, +// }, nil) +// if err != nil { +// return err +// } +// thisTree, err := github.GetTree(ctx, &github.GetTreeArgs{ +// Recursive: pulumi.BoolRef(false), +// Repository: thisRepository.Name, +// TreeSha: thisBranch.Sha, +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("entries", thisTree.Entries) +// return nil +// }) +// } +// +// ``` func GetTree(ctx *pulumi.Context, args *GetTreeArgs, opts ...pulumi.InvokeOption) (*GetTreeResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv GetTreeResult diff --git a/sdk/go/github/getUser.go b/sdk/go/github/getUser.go index 0085bcee..d3cf6661 100644 --- a/sdk/go/github/getUser.go +++ b/sdk/go/github/getUser.go @@ -13,6 +13,39 @@ import ( ) // Use this data source to retrieve information about a GitHub user. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-github/sdk/v5/go/github" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := github.GetUser(ctx, &github.GetUserArgs{ +// Username: "example", +// }, nil) +// if err != nil { +// return err +// } +// current, err := github.GetUser(ctx, &github.GetUserArgs{ +// Username: "", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("currentGithubLogin", current.Login) +// return nil +// }) +// } +// +// ``` func GetUser(ctx *pulumi.Context, args *GetUserArgs, opts ...pulumi.InvokeOption) (*GetUserResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv GetUserResult diff --git a/sdk/go/github/getUserExternalIdentity.go b/sdk/go/github/getUserExternalIdentity.go index 578ffa98..94548cc0 100644 --- a/sdk/go/github/getUserExternalIdentity.go +++ b/sdk/go/github/getUserExternalIdentity.go @@ -14,6 +14,32 @@ import ( // Use this data source to retrieve a specific organization member's SAML or SCIM user // attributes. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-github/sdk/v5/go/github" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := github.GetUserExternalIdentity(ctx, &github.GetUserExternalIdentityArgs{ +// Username: "example-user", +// }, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` func GetUserExternalIdentity(ctx *pulumi.Context, args *GetUserExternalIdentityArgs, opts ...pulumi.InvokeOption) (*GetUserExternalIdentityResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv GetUserExternalIdentityResult diff --git a/sdk/go/github/getUsers.go b/sdk/go/github/getUsers.go index fcf5be5a..264169a7 100644 --- a/sdk/go/github/getUsers.go +++ b/sdk/go/github/getUsers.go @@ -13,6 +13,38 @@ import ( ) // Use this data source to retrieve information about multiple GitHub users at once. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-github/sdk/v5/go/github" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := github.GetUsers(ctx, &github.GetUsersArgs{ +// Usernames: []string{ +// "example1", +// "example2", +// "example3", +// }, +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("validUsers", example.Logins) +// ctx.Export("invalidUsers", example.UnknownLogins) +// return nil +// }) +// } +// +// ``` func GetUsers(ctx *pulumi.Context, args *GetUsersArgs, opts ...pulumi.InvokeOption) (*GetUsersResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv GetUsersResult diff --git a/sdk/go/github/issue.go b/sdk/go/github/issue.go index 7f216677..bb487b83 100644 --- a/sdk/go/github/issue.go +++ b/sdk/go/github/issue.go @@ -18,6 +18,98 @@ import ( // This resource allows you to create and manage issue within your // GitHub repository. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-github/sdk/v5/go/github" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// testRepository, err := github.NewRepository(ctx, "testRepository", &github.RepositoryArgs{ +// AutoInit: pulumi.Bool(true), +// HasIssues: pulumi.Bool(true), +// }) +// if err != nil { +// return err +// } +// _, err = github.NewIssue(ctx, "testIssue", &github.IssueArgs{ +// Repository: testRepository.Name, +// Title: pulumi.String("My issue title"), +// Body: pulumi.String("The body of my issue"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// ### With Milestone And Project Assignment +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-github/sdk/v5/go/github" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// testRepository, err := github.NewRepository(ctx, "testRepository", &github.RepositoryArgs{ +// AutoInit: pulumi.Bool(true), +// HasIssues: pulumi.Bool(true), +// }) +// if err != nil { +// return err +// } +// testRepositoryMilestone, err := github.NewRepositoryMilestone(ctx, "testRepositoryMilestone", &github.RepositoryMilestoneArgs{ +// Owner: testRepository.FullName.ApplyT(func(fullName string) (pulumi.StringArray, error) { +// return pulumi.StringArray("TODO: call split"), nil +// }).(pulumi.StringArrayOutput).ApplyT(func(split []string) (string, error) { +// return split[0], nil +// }).(pulumi.StringOutput), +// Repository: testRepository.Name, +// Title: pulumi.String("v1.0.0"), +// Description: pulumi.String("General Availability"), +// DueDate: pulumi.String("2022-11-22"), +// State: pulumi.String("open"), +// }) +// if err != nil { +// return err +// } +// _, err = github.NewIssue(ctx, "testIssue", &github.IssueArgs{ +// Repository: testRepository.Name, +// Title: pulumi.String("My issue"), +// Body: pulumi.String("My issue body"), +// Labels: pulumi.StringArray{ +// pulumi.String("bug"), +// pulumi.String("documentation"), +// }, +// Assignees: pulumi.StringArray{ +// pulumi.String("bob-github"), +// }, +// MilestoneNumber: testRepositoryMilestone.Number, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // GitHub Issues can be imported using an ID made up of `repository:number`, e.g. diff --git a/sdk/go/github/issueLabel.go b/sdk/go/github/issueLabel.go index 9a0ea123..2d37f44b 100644 --- a/sdk/go/github/issueLabel.go +++ b/sdk/go/github/issueLabel.go @@ -13,6 +13,33 @@ import ( "github.com/pulumi/pulumi/sdk/v3/go/pulumix" ) +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-github/sdk/v5/go/github" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := github.NewIssueLabel(ctx, "testRepo", &github.IssueLabelArgs{ +// Color: pulumi.String("FF0000"), +// Repository: pulumi.String("test-repo"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // GitHub Issue Labels can be imported using an ID made up of `repository:name`, e.g. diff --git a/sdk/go/github/membership.go b/sdk/go/github/membership.go index 860a882e..17578905 100644 --- a/sdk/go/github/membership.go +++ b/sdk/go/github/membership.go @@ -19,6 +19,33 @@ import ( // an invitation will be sent to the user to become part of the organization. When // destroyed, either the invitation will be cancelled or the user will be removed. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-github/sdk/v5/go/github" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := github.NewMembership(ctx, "membershipForSomeUser", &github.MembershipArgs{ +// Role: pulumi.String("member"), +// Username: pulumi.String("SomeUser"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // GitHub Membership can be imported using an ID made up of `organization:username`, e.g. diff --git a/sdk/go/github/organizationBlock.go b/sdk/go/github/organizationBlock.go index 4ba07d3e..7ab4cd33 100644 --- a/sdk/go/github/organizationBlock.go +++ b/sdk/go/github/organizationBlock.go @@ -14,6 +14,32 @@ import ( ) // This resource allows you to create and manage blocks for GitHub organizations. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-github/sdk/v5/go/github" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := github.NewOrganizationBlock(ctx, "example", &github.OrganizationBlockArgs{ +// Username: pulumi.String("paultyng"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` type OrganizationBlock struct { pulumi.CustomResourceState diff --git a/sdk/go/github/organizationCustomRole.go b/sdk/go/github/organizationCustomRole.go index 09aa00f6..c89da3a4 100644 --- a/sdk/go/github/organizationCustomRole.go +++ b/sdk/go/github/organizationCustomRole.go @@ -17,6 +17,54 @@ import ( // // > Note: Custom roles are currently only available in GitHub Enterprise Cloud. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-github/sdk/v5/go/github" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := github.NewOrganizationCustomRole(ctx, "example", &github.OrganizationCustomRoleArgs{ +// BaseRole: pulumi.String("read"), +// Description: pulumi.String("Example custom role that uses the read role as its base"), +// Permissions: pulumi.StringArray{ +// pulumi.String("add_assignee"), +// pulumi.String("add_label"), +// pulumi.String("bypass_branch_protection"), +// pulumi.String("close_issue"), +// pulumi.String("close_pull_request"), +// pulumi.String("mark_as_duplicate"), +// pulumi.String("create_tag"), +// pulumi.String("delete_issue"), +// pulumi.String("delete_tag"), +// pulumi.String("manage_deploy_keys"), +// pulumi.String("push_protected_branch"), +// pulumi.String("read_code_scanning"), +// pulumi.String("reopen_issue"), +// pulumi.String("reopen_pull_request"), +// pulumi.String("request_pr_review"), +// pulumi.String("resolve_dependabot_alerts"), +// pulumi.String("resolve_secret_scanning_alerts"), +// pulumi.String("view_secret_scanning_alerts"), +// pulumi.String("write_code_scanning"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Custom roles can be imported using the `id` of the role. The `id` of the custom role can be found using the [list custom roles in an organization](https://docs.github.com/en/enterprise-cloud@latest/rest/orgs/custom-roles#list-custom-repository-roles-in-an-organization) API. diff --git a/sdk/go/github/organizationProject.go b/sdk/go/github/organizationProject.go index 90c65a4c..a626c38b 100644 --- a/sdk/go/github/organizationProject.go +++ b/sdk/go/github/organizationProject.go @@ -13,6 +13,32 @@ import ( ) // This resource allows you to create and manage projects for GitHub organization. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-github/sdk/v5/go/github" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := github.NewOrganizationProject(ctx, "project", &github.OrganizationProjectArgs{ +// Body: pulumi.String("This is a organization project."), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` type OrganizationProject struct { pulumi.CustomResourceState diff --git a/sdk/go/github/organizationSecurityManager.go b/sdk/go/github/organizationSecurityManager.go index b00da7f4..168a4278 100644 --- a/sdk/go/github/organizationSecurityManager.go +++ b/sdk/go/github/organizationSecurityManager.go @@ -13,6 +13,38 @@ import ( "github.com/pulumi/pulumi/sdk/v3/go/pulumix" ) +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-github/sdk/v5/go/github" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// someTeamTeam, err := github.NewTeam(ctx, "someTeamTeam", &github.TeamArgs{ +// Description: pulumi.String("Some cool team"), +// }) +// if err != nil { +// return err +// } +// _, err = github.NewOrganizationSecurityManager(ctx, "someTeamOrganizationSecurityManager", &github.OrganizationSecurityManagerArgs{ +// TeamSlug: someTeamTeam.Slug, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // GitHub Security Manager Teams can be imported using the GitHub team ID e.g. diff --git a/sdk/go/github/organizationSettings.go b/sdk/go/github/organizationSettings.go index 0e2fa3c6..b901e6ed 100644 --- a/sdk/go/github/organizationSettings.go +++ b/sdk/go/github/organizationSettings.go @@ -15,6 +15,56 @@ import ( // This resource allows you to create and manage settings for a GitHub Organization. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-github/sdk/v5/go/github" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := github.NewOrganizationSettings(ctx, "test", &github.OrganizationSettingsArgs{ +// AdvancedSecurityEnabledForNewRepositories: pulumi.Bool(false), +// BillingEmail: pulumi.String("test@example.com"), +// Blog: pulumi.String("https://example.com"), +// Company: pulumi.String("Test Company"), +// DefaultRepositoryPermission: pulumi.String("read"), +// DependabotAlertsEnabledForNewRepositories: pulumi.Bool(false), +// DependabotSecurityUpdatesEnabledForNewRepositories: pulumi.Bool(false), +// DependencyGraphEnabledForNewRepositories: pulumi.Bool(false), +// Description: pulumi.String("Test Description"), +// Email: pulumi.String("test@example.com"), +// HasOrganizationProjects: pulumi.Bool(true), +// HasRepositoryProjects: pulumi.Bool(true), +// Location: pulumi.String("Test Location"), +// MembersCanCreateInternalRepositories: pulumi.Bool(true), +// MembersCanCreatePages: pulumi.Bool(true), +// MembersCanCreatePrivatePages: pulumi.Bool(true), +// MembersCanCreatePrivateRepositories: pulumi.Bool(true), +// MembersCanCreatePublicPages: pulumi.Bool(true), +// MembersCanCreatePublicRepositories: pulumi.Bool(true), +// MembersCanCreateRepositories: pulumi.Bool(true), +// MembersCanForkPrivateRepositories: pulumi.Bool(true), +// SecretScanningEnabledForNewRepositories: pulumi.Bool(false), +// SecretScanningPushProtectionEnabledForNewRepositories: pulumi.Bool(false), +// TwitterUsername: pulumi.String("Test"), +// WebCommitSignoffRequired: pulumi.Bool(true), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Organization settings can be imported using the `id` of the organization. The `id` of the organization can be found using the [get an organization](https://docs.github.com/en/rest/orgs/orgs#get-an-organization) API. diff --git a/sdk/go/github/organizationWebhook.go b/sdk/go/github/organizationWebhook.go index b8fec088..0e1cd348 100644 --- a/sdk/go/github/organizationWebhook.go +++ b/sdk/go/github/organizationWebhook.go @@ -15,6 +15,40 @@ import ( // This resource allows you to create and manage webhooks for GitHub organization. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-github/sdk/v5/go/github" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := github.NewOrganizationWebhook(ctx, "foo", &github.OrganizationWebhookArgs{ +// Active: pulumi.Bool(false), +// Configuration: &github.OrganizationWebhookConfigurationArgs{ +// ContentType: pulumi.String("form"), +// InsecureSsl: pulumi.Bool(false), +// Url: pulumi.String("https://google.de/"), +// }, +// Events: pulumi.StringArray{ +// pulumi.String("issues"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Organization webhooks can be imported using the `id` of the webhook. The `id` of the webhook can be found in the URL of the webhook. For example, `"https://github.com/organizations/foo-org/settings/hooks/123456789"`. diff --git a/sdk/go/github/projectCard.go b/sdk/go/github/projectCard.go index 495b0537..2bacdf3e 100644 --- a/sdk/go/github/projectCard.go +++ b/sdk/go/github/projectCard.go @@ -15,6 +15,100 @@ import ( // This resource allows you to create and manage cards for GitHub projects. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-github/sdk/v5/go/github" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// project, err := github.NewOrganizationProject(ctx, "project", &github.OrganizationProjectArgs{ +// Body: pulumi.String("This is an organization project."), +// }) +// if err != nil { +// return err +// } +// column, err := github.NewProjectColumn(ctx, "column", &github.ProjectColumnArgs{ +// ProjectId: project.ID(), +// }) +// if err != nil { +// return err +// } +// _, err = github.NewProjectCard(ctx, "card", &github.ProjectCardArgs{ +// ColumnId: column.ColumnId, +// Note: pulumi.String("## Unaccepted 👇"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// ### Adding An Issue To A Project +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-github/sdk/v5/go/github" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// testRepository, err := github.NewRepository(ctx, "testRepository", &github.RepositoryArgs{ +// HasProjects: pulumi.Bool(true), +// HasIssues: pulumi.Bool(true), +// }) +// if err != nil { +// return err +// } +// testIssue, err := github.NewIssue(ctx, "testIssue", &github.IssueArgs{ +// Repository: testRepository.ID(), +// Title: pulumi.String("Test issue title"), +// Body: pulumi.String("Test issue body"), +// }) +// if err != nil { +// return err +// } +// testRepositoryProject, err := github.NewRepositoryProject(ctx, "testRepositoryProject", &github.RepositoryProjectArgs{ +// Repository: testRepository.Name, +// Body: pulumi.String("this is a test project"), +// }) +// if err != nil { +// return err +// } +// testProjectColumn, err := github.NewProjectColumn(ctx, "testProjectColumn", &github.ProjectColumnArgs{ +// ProjectId: testRepositoryProject.ID(), +// }) +// if err != nil { +// return err +// } +// _, err = github.NewProjectCard(ctx, "testProjectCard", &github.ProjectCardArgs{ +// ColumnId: testProjectColumn.ColumnId, +// ContentId: testIssue.IssueId, +// ContentType: pulumi.String("Issue"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // A GitHub Project Card can be imported using its [Card ID](https://developer.github.com/v3/projects/cards/#get-a-project-card): diff --git a/sdk/go/github/projectColumn.go b/sdk/go/github/projectColumn.go index 019f94e2..9c718d73 100644 --- a/sdk/go/github/projectColumn.go +++ b/sdk/go/github/projectColumn.go @@ -14,6 +14,38 @@ import ( ) // This resource allows you to create and manage columns for GitHub projects. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-github/sdk/v5/go/github" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// project, err := github.NewOrganizationProject(ctx, "project", &github.OrganizationProjectArgs{ +// Body: pulumi.String("This is an organization project."), +// }) +// if err != nil { +// return err +// } +// _, err = github.NewProjectColumn(ctx, "column", &github.ProjectColumnArgs{ +// ProjectId: project.ID(), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` type ProjectColumn struct { pulumi.CustomResourceState diff --git a/sdk/go/github/release.go b/sdk/go/github/release.go index 4e368bee..ebd62ed6 100644 --- a/sdk/go/github/release.go +++ b/sdk/go/github/release.go @@ -16,6 +16,83 @@ import ( // This resource allows you to create and manage a release in a specific // GitHub repository. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-github/sdk/v5/go/github" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// repo, err := github.NewRepository(ctx, "repo", &github.RepositoryArgs{ +// Description: pulumi.String("GitHub repo managed by Terraform"), +// Private: pulumi.Bool(false), +// }) +// if err != nil { +// return err +// } +// _, err = github.NewRelease(ctx, "example", &github.ReleaseArgs{ +// Repository: repo.Name, +// TagName: pulumi.String("v1.0.0"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// ### On Non-Default Branch +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-github/sdk/v5/go/github" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleRepository, err := github.NewRepository(ctx, "exampleRepository", &github.RepositoryArgs{ +// AutoInit: pulumi.Bool(true), +// }) +// if err != nil { +// return err +// } +// exampleBranch, err := github.NewBranch(ctx, "exampleBranch", &github.BranchArgs{ +// Repository: exampleRepository.Name, +// Branch: pulumi.String("branch_name"), +// SourceBranch: exampleRepository.DefaultBranch, +// }) +// if err != nil { +// return err +// } +// _, err = github.NewRelease(ctx, "exampleRelease", &github.ReleaseArgs{ +// Repository: exampleRepository.Name, +// TagName: pulumi.String("v1.0.0"), +// TargetCommitish: exampleBranch.Branch, +// Draft: pulumi.Bool(false), +// Prerelease: pulumi.Bool(false), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // This resource can be imported using the `name` of the repository, combined with the `id` of the release, and a `:` character for separating components, e.g. diff --git a/sdk/go/github/repository.go b/sdk/go/github/repository.go index 9ac006ea..df95e33d 100644 --- a/sdk/go/github/repository.go +++ b/sdk/go/github/repository.go @@ -19,6 +19,70 @@ import ( // the `contents:write` permission or else the `allowMergeCommit`, `allowRebaseMerge`, // and `allowSquashMerge` attributes will be ignored, causing confusing diffs. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-github/sdk/v5/go/github" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := github.NewRepository(ctx, "example", &github.RepositoryArgs{ +// Description: pulumi.String("My awesome codebase"), +// Template: &github.RepositoryTemplateArgs{ +// IncludeAllBranches: pulumi.Bool(true), +// Owner: pulumi.String("github"), +// Repository: pulumi.String("terraform-template-module"), +// }, +// Visibility: pulumi.String("public"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// ### With GitHub Pages Enabled +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-github/sdk/v5/go/github" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := github.NewRepository(ctx, "example", &github.RepositoryArgs{ +// Description: pulumi.String("My awesome web page"), +// Pages: &github.RepositoryPagesArgs{ +// Source: &github.RepositoryPagesSourceArgs{ +// Branch: pulumi.String("master"), +// Path: pulumi.String("/docs"), +// }, +// }, +// Private: pulumi.Bool(false), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Repositories can be imported using the `name`, e.g. diff --git a/sdk/go/github/repositoryAutolinkReference.go b/sdk/go/github/repositoryAutolinkReference.go index 885ae053..671294d7 100644 --- a/sdk/go/github/repositoryAutolinkReference.go +++ b/sdk/go/github/repositoryAutolinkReference.go @@ -15,6 +15,41 @@ import ( // This resource allows you to create and manage an autolink reference for a single repository. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-github/sdk/v5/go/github" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// repo, err := github.NewRepository(ctx, "repo", &github.RepositoryArgs{ +// Description: pulumi.String("GitHub repo managed by Terraform"), +// Private: pulumi.Bool(false), +// }) +// if err != nil { +// return err +// } +// _, err = github.NewRepositoryAutolinkReference(ctx, "autolink", &github.RepositoryAutolinkReferenceArgs{ +// Repository: repo.Name, +// KeyPrefix: pulumi.String("TICKET-"), +// TargetUrlTemplate: pulumi.String("https://example.com/TICKET?query="), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // ### Import by key prefix diff --git a/sdk/go/github/repositoryCollaborator.go b/sdk/go/github/repositoryCollaborator.go index 4d7d4385..8c7e4c3c 100644 --- a/sdk/go/github/repositoryCollaborator.go +++ b/sdk/go/github/repositoryCollaborator.go @@ -38,6 +38,34 @@ import ( // - [Adding outside collaborators to repositories in your organization](https://help.github.com/articles/adding-outside-collaborators-to-repositories-in-your-organization/) // - [Converting an organization member to an outside collaborator](https://help.github.com/articles/converting-an-organization-member-to-an-outside-collaborator/) // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-github/sdk/v5/go/github" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := github.NewRepositoryCollaborator(ctx, "aRepoCollaborator", &github.RepositoryCollaboratorArgs{ +// Permission: pulumi.String("admin"), +// Repository: pulumi.String("our-cool-repo"), +// Username: pulumi.String("SomeUser"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // GitHub Repository Collaborators can be imported using an ID made up of `repository:username`, e.g. diff --git a/sdk/go/github/repositoryCollaborators.go b/sdk/go/github/repositoryCollaborators.go index 3803020d..d18508fc 100644 --- a/sdk/go/github/repositoryCollaborators.go +++ b/sdk/go/github/repositoryCollaborators.go @@ -38,6 +38,54 @@ import ( // - [Adding outside collaborators to repositories in your organization](https://help.github.com/articles/adding-outside-collaborators-to-repositories-in-your-organization/) // - [Converting an organization member to an outside collaborators](https://help.github.com/articles/converting-an-organization-member-to-an-outside-collaborator/) // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-github/sdk/v5/go/github" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// someTeam, err := github.NewTeam(ctx, "someTeam", &github.TeamArgs{ +// Description: pulumi.String("Some cool team"), +// }) +// if err != nil { +// return err +// } +// someRepo, err := github.NewRepository(ctx, "someRepo", nil) +// if err != nil { +// return err +// } +// _, err = github.NewRepositoryCollaborators(ctx, "someRepoCollaborators", &github.RepositoryCollaboratorsArgs{ +// Repository: someRepo.Name, +// Users: github.RepositoryCollaboratorsUserArray{ +// &github.RepositoryCollaboratorsUserArgs{ +// Permission: pulumi.String("admin"), +// Username: pulumi.String("SomeUser"), +// }, +// }, +// Teams: github.RepositoryCollaboratorsTeamArray{ +// &github.RepositoryCollaboratorsTeamArgs{ +// Permission: pulumi.String("pull"), +// TeamId: someTeam.Slug, +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // GitHub Repository Collaborators can be imported using the name `name`, e.g. diff --git a/sdk/go/github/repositoryDeployKey.go b/sdk/go/github/repositoryDeployKey.go index ef381a34..12119873 100644 --- a/sdk/go/github/repositoryDeployKey.go +++ b/sdk/go/github/repositoryDeployKey.go @@ -24,6 +24,35 @@ import ( // Further documentation on GitHub repository deploy keys: // - [About deploy keys](https://developer.github.com/guides/managing-deploy-keys/#deploy-keys) // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-github/sdk/v5/go/github" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := github.NewRepositoryDeployKey(ctx, "exampleRepositoryDeployKey", &github.RepositoryDeployKeyArgs{ +// Key: pulumi.String("ssh-rsa AAA..."), +// ReadOnly: pulumi.Bool(false), +// Repository: pulumi.String("test-repo"), +// Title: pulumi.String("Repository test key"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Repository deploy keys can be imported using a colon-separated pair of repository name and GitHub's key id. The latter can be obtained by GitHub's SDKs and API. diff --git a/sdk/go/github/repositoryDeploymentBranchPolicy.go b/sdk/go/github/repositoryDeploymentBranchPolicy.go index 825393b4..ec4863c9 100644 --- a/sdk/go/github/repositoryDeploymentBranchPolicy.go +++ b/sdk/go/github/repositoryDeploymentBranchPolicy.go @@ -15,6 +15,46 @@ import ( // This resource allows you to create and manage deployment branch policies. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-github/sdk/v5/go/github" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// env, err := github.NewRepositoryEnvironment(ctx, "env", &github.RepositoryEnvironmentArgs{ +// Repository: pulumi.String("my_repo"), +// Environment: pulumi.String("my_env"), +// DeploymentBranchPolicy: &github.RepositoryEnvironmentDeploymentBranchPolicyArgs{ +// ProtectedBranches: pulumi.Bool(false), +// CustomBranchPolicies: pulumi.Bool(true), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = github.NewRepositoryDeploymentBranchPolicy(ctx, "foo", &github.RepositoryDeploymentBranchPolicyArgs{ +// Repository: pulumi.String("my_repo"), +// EnvironmentName: pulumi.String("my_env"), +// }, pulumi.DependsOn([]pulumi.Resource{ +// env, +// })) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // ```sh diff --git a/sdk/go/github/repositoryEnvironment.go b/sdk/go/github/repositoryEnvironment.go index f8681aef..88ced229 100644 --- a/sdk/go/github/repositoryEnvironment.go +++ b/sdk/go/github/repositoryEnvironment.go @@ -15,6 +15,56 @@ import ( // This resource allows you to create and manage environments for a GitHub repository. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-github/sdk/v5/go/github" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// current, err := github.GetUser(ctx, &github.GetUserArgs{ +// Username: "", +// }, nil) +// if err != nil { +// return err +// } +// exampleRepository, err := github.NewRepository(ctx, "exampleRepository", &github.RepositoryArgs{ +// Description: pulumi.String("My awesome codebase"), +// }) +// if err != nil { +// return err +// } +// _, err = github.NewRepositoryEnvironment(ctx, "exampleRepositoryEnvironment", &github.RepositoryEnvironmentArgs{ +// Environment: pulumi.String("example"), +// Repository: exampleRepository.Name, +// Reviewers: github.RepositoryEnvironmentReviewerArray{ +// &github.RepositoryEnvironmentReviewerArgs{ +// Users: pulumi.IntArray{ +// *pulumi.String(current.Id), +// }, +// }, +// }, +// DeploymentBranchPolicy: &github.RepositoryEnvironmentDeploymentBranchPolicyArgs{ +// ProtectedBranches: pulumi.Bool(true), +// CustomBranchPolicies: pulumi.Bool(false), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // GitHub Repository Environment can be imported using an ID made up of `name` of the repository combined with the `environment` name of the environment, separated by a `:` character, e.g. diff --git a/sdk/go/github/repositoryEnvironmentDeploymentPolicy.go b/sdk/go/github/repositoryEnvironmentDeploymentPolicy.go index 6ba343e2..f97b3e5c 100644 --- a/sdk/go/github/repositoryEnvironmentDeploymentPolicy.go +++ b/sdk/go/github/repositoryEnvironmentDeploymentPolicy.go @@ -15,6 +15,63 @@ import ( // This resource allows you to create and manage environment deployment branch policies for a GitHub repository. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-github/sdk/v5/go/github" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// current, err := github.GetUser(ctx, &github.GetUserArgs{ +// Username: "", +// }, nil) +// if err != nil { +// return err +// } +// testRepository, err := github.NewRepository(ctx, "testRepository", nil) +// if err != nil { +// return err +// } +// testRepositoryEnvironment, err := github.NewRepositoryEnvironment(ctx, "testRepositoryEnvironment", &github.RepositoryEnvironmentArgs{ +// Repository: testRepository.Name, +// Environment: pulumi.String("environment/test"), +// WaitTimer: pulumi.Int(10000), +// Reviewers: github.RepositoryEnvironmentReviewerArray{ +// &github.RepositoryEnvironmentReviewerArgs{ +// Users: pulumi.IntArray{ +// *pulumi.String(current.Id), +// }, +// }, +// }, +// DeploymentBranchPolicy: &github.RepositoryEnvironmentDeploymentBranchPolicyArgs{ +// ProtectedBranches: pulumi.Bool(false), +// CustomBranchPolicies: pulumi.Bool(true), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = github.NewRepositoryEnvironmentDeploymentPolicy(ctx, "testRepositoryEnvironmentDeploymentPolicy", &github.RepositoryEnvironmentDeploymentPolicyArgs{ +// Repository: testRepository.Name, +// Environment: testRepositoryEnvironment.Environment, +// BranchPattern: pulumi.String("releases/*"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // GitHub Repository Environment Deployment Policy can be imported using an ID made up of `name` of the repository combined with the `environment` name of the environment with the `Id` of the deployment policy, separated by a `:` character, e.g. diff --git a/sdk/go/github/repositoryFile.go b/sdk/go/github/repositoryFile.go index 19176213..ab0dd88f 100644 --- a/sdk/go/github/repositoryFile.go +++ b/sdk/go/github/repositoryFile.go @@ -16,6 +16,45 @@ import ( // This resource allows you to create and manage files within a // GitHub repository. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-github/sdk/v5/go/github" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// fooRepository, err := github.NewRepository(ctx, "fooRepository", &github.RepositoryArgs{ +// AutoInit: pulumi.Bool(true), +// }) +// if err != nil { +// return err +// } +// _, err = github.NewRepositoryFile(ctx, "fooRepositoryFile", &github.RepositoryFileArgs{ +// Repository: fooRepository.Name, +// Branch: pulumi.String("main"), +// File: pulumi.String(".gitignore"), +// Content: pulumi.String("**/*.tfstate"), +// CommitMessage: pulumi.String("Managed by Terraform"), +// CommitAuthor: pulumi.String("Terraform User"), +// CommitEmail: pulumi.String("terraform@example.com"), +// OverwriteOnCreate: pulumi.Bool(true), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Repository files can be imported using a combination of the `repo` and `file`, e.g. diff --git a/sdk/go/github/repositoryMilestone.go b/sdk/go/github/repositoryMilestone.go index 06395d6a..aacefab6 100644 --- a/sdk/go/github/repositoryMilestone.go +++ b/sdk/go/github/repositoryMilestone.go @@ -17,6 +17,34 @@ import ( // // This resource allows you to create and manage milestones for a GitHub Repository within an organization or user account. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-github/sdk/v5/go/github" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := github.NewRepositoryMilestone(ctx, "example", &github.RepositoryMilestoneArgs{ +// Owner: pulumi.String("example-owner"), +// Repository: pulumi.String("example-repository"), +// Title: pulumi.String("v1.1.0"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // A GitHub Repository Milestone can be imported using an ID made up of `owner/repository/number`, e.g. diff --git a/sdk/go/github/repositoryProject.go b/sdk/go/github/repositoryProject.go index 7fad2781..8668c235 100644 --- a/sdk/go/github/repositoryProject.go +++ b/sdk/go/github/repositoryProject.go @@ -14,6 +14,40 @@ import ( ) // This resource allows you to create and manage projects for GitHub repository. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-github/sdk/v5/go/github" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := github.NewRepository(ctx, "example", &github.RepositoryArgs{ +// Description: pulumi.String("My awesome codebase"), +// HasProjects: pulumi.Bool(true), +// }) +// if err != nil { +// return err +// } +// _, err = github.NewRepositoryProject(ctx, "project", &github.RepositoryProjectArgs{ +// Body: pulumi.String("This is a repository project."), +// Repository: example.Name, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` type RepositoryProject struct { pulumi.CustomResourceState diff --git a/sdk/go/github/repositoryPullRequest.go b/sdk/go/github/repositoryPullRequest.go index 66b59538..ebbffb65 100644 --- a/sdk/go/github/repositoryPullRequest.go +++ b/sdk/go/github/repositoryPullRequest.go @@ -14,6 +14,36 @@ import ( ) // This resource allows you to create and manage PullRequests for repositories within your GitHub organization or personal account. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-github/sdk/v5/go/github" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := github.NewRepositoryPullRequest(ctx, "example", &github.RepositoryPullRequestArgs{ +// BaseRef: pulumi.String("main"), +// BaseRepository: pulumi.String("example-repository"), +// Body: pulumi.String("This will change everything"), +// HeadRef: pulumi.String("feature-branch"), +// Title: pulumi.String("My newest feature"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` type RepositoryPullRequest struct { pulumi.CustomResourceState diff --git a/sdk/go/github/repositoryRuleset.go b/sdk/go/github/repositoryRuleset.go index 5e6a4831..e1610df2 100644 --- a/sdk/go/github/repositoryRuleset.go +++ b/sdk/go/github/repositoryRuleset.go @@ -17,6 +17,67 @@ import ( // // This resource allows you to create and manage rulesets on the repository level. When applied, a new ruleset will be created. When destroyed, that ruleset will be removed. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-github/sdk/v5/go/github" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleRepository, err := github.NewRepository(ctx, "exampleRepository", &github.RepositoryArgs{ +// Description: pulumi.String("Example repository"), +// }) +// if err != nil { +// return err +// } +// _, err = github.NewRepositoryRuleset(ctx, "exampleRepositoryRuleset", &github.RepositoryRulesetArgs{ +// Repository: exampleRepository.Name, +// Target: pulumi.String("branch"), +// Enforcement: pulumi.String("active"), +// Conditions: &github.RepositoryRulesetConditionsArgs{ +// RefName: &github.RepositoryRulesetConditionsRefNameArgs{ +// Includes: pulumi.StringArray{ +// pulumi.String("~ALL"), +// }, +// Excludes: pulumi.StringArray{}, +// }, +// }, +// BypassActors: github.RepositoryRulesetBypassActorArray{ +// &github.RepositoryRulesetBypassActorArgs{ +// ActorId: pulumi.Int(13473), +// ActorType: pulumi.String("Integration"), +// BypassMode: pulumi.String("always"), +// }, +// }, +// Rules: &github.RepositoryRulesetRulesArgs{ +// Creation: pulumi.Bool(true), +// Update: pulumi.Bool(true), +// Deletion: pulumi.Bool(true), +// RequiredLinearHistory: pulumi.Bool(true), +// RequiredSignatures: pulumi.Bool(true), +// RequiredDeployments: &github.RepositoryRulesetRulesRequiredDeploymentsArgs{ +// RequiredDeploymentEnvironments: pulumi.StringArray{ +// pulumi.String("test"), +// }, +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // GitHub Repository Rulesets can be imported using the GitHub repository name and ruleset ID e.g. diff --git a/sdk/go/github/repositoryTagProtection.go b/sdk/go/github/repositoryTagProtection.go index a1c0cf95..a6d77654 100644 --- a/sdk/go/github/repositoryTagProtection.go +++ b/sdk/go/github/repositoryTagProtection.go @@ -15,6 +15,33 @@ import ( // This resource allows you to create and manage a repository tag protection for repositories within your GitHub organization or personal account. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-github/sdk/v5/go/github" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := github.NewRepositoryTagProtection(ctx, "example", &github.RepositoryTagProtectionArgs{ +// Pattern: pulumi.String("v*"), +// Repository: pulumi.String("example-repository"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Repository tag protections can be imported using the `name` of the repository, combined with the `id` of the tag protection, separated by a `/` character. The `id` of the tag protection can be found using the [GitHub API](https://docs.github.com/en/rest/repos/tags#list-tag-protection-states-for-a-repository). diff --git a/sdk/go/github/repositoryTopics.go b/sdk/go/github/repositoryTopics.go index 2d987f89..eec4413d 100644 --- a/sdk/go/github/repositoryTopics.go +++ b/sdk/go/github/repositoryTopics.go @@ -13,6 +13,42 @@ import ( "github.com/pulumi/pulumi/sdk/v3/go/pulumix" ) +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-github/sdk/v5/go/github" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := github.LookupRepository(ctx, &github.LookupRepositoryArgs{ +// Name: pulumi.StringRef("test"), +// }, nil) +// if err != nil { +// return err +// } +// _, err = github.NewRepositoryTopics(ctx, "testRepositoryTopics", &github.RepositoryTopicsArgs{ +// Repository: pulumi.Any(github_repository.Test.Name), +// Topics: pulumi.StringArray{ +// pulumi.String("topic-1"), +// pulumi.String("topic-2"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Repository topics can be imported using the `name` of the repository. diff --git a/sdk/go/github/repositoryWebhook.go b/sdk/go/github/repositoryWebhook.go index 9b1633d3..119b9c8c 100644 --- a/sdk/go/github/repositoryWebhook.go +++ b/sdk/go/github/repositoryWebhook.go @@ -16,6 +16,49 @@ import ( // This resource allows you to create and manage webhooks for repositories within your // GitHub organization or personal account. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-github/sdk/v5/go/github" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// repo, err := github.NewRepository(ctx, "repo", &github.RepositoryArgs{ +// Description: pulumi.String("Terraform acceptance tests"), +// HomepageUrl: pulumi.String("http://example.com/"), +// Visibility: pulumi.String("public"), +// }) +// if err != nil { +// return err +// } +// _, err = github.NewRepositoryWebhook(ctx, "foo", &github.RepositoryWebhookArgs{ +// Repository: repo.Name, +// Configuration: &github.RepositoryWebhookConfigurationArgs{ +// Url: pulumi.String("https://google.de/"), +// ContentType: pulumi.String("form"), +// InsecureSsl: pulumi.Bool(false), +// }, +// Active: pulumi.Bool(false), +// Events: pulumi.StringArray{ +// pulumi.String("issues"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Repository webhooks can be imported using the `name` of the repository, combined with the `id` of the webhook, separated by a `/` character. The `id` of the webhook can be found in the URL of the webhook. For example`"https://github.com/foo-org/foo-repo/settings/hooks/14711452"`. diff --git a/sdk/go/github/team.go b/sdk/go/github/team.go index 1f43797e..4fe18ae2 100644 --- a/sdk/go/github/team.go +++ b/sdk/go/github/team.go @@ -17,6 +17,33 @@ import ( // This resource allows you to add/remove teams from your organization. When applied, // a new team will be created. When destroyed, that team will be removed. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-github/sdk/v5/go/github" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := github.NewTeam(ctx, "someTeam", &github.TeamArgs{ +// Description: pulumi.String("Some cool team"), +// Privacy: pulumi.String("closed"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // GitHub Teams can be imported using the GitHub team ID or name e.g. diff --git a/sdk/go/github/teamMembers.go b/sdk/go/github/teamMembers.go index 833e1c9d..742ca323 100644 --- a/sdk/go/github/teamMembers.go +++ b/sdk/go/github/teamMembers.go @@ -13,6 +13,62 @@ import ( "github.com/pulumi/pulumi/sdk/v3/go/pulumix" ) +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-github/sdk/v5/go/github" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := github.NewMembership(ctx, "membershipForSomeUser", &github.MembershipArgs{ +// Username: pulumi.String("SomeUser"), +// Role: pulumi.String("member"), +// }) +// if err != nil { +// return err +// } +// _, err = github.NewMembership(ctx, "membershipForAnotherUser", &github.MembershipArgs{ +// Username: pulumi.String("AnotherUser"), +// Role: pulumi.String("member"), +// }) +// if err != nil { +// return err +// } +// someTeam, err := github.NewTeam(ctx, "someTeam", &github.TeamArgs{ +// Description: pulumi.String("Some cool team"), +// }) +// if err != nil { +// return err +// } +// _, err = github.NewTeamMembers(ctx, "someTeamMembers", &github.TeamMembersArgs{ +// TeamId: someTeam.ID(), +// Members: github.TeamMembersMemberArray{ +// &github.TeamMembersMemberArgs{ +// Username: pulumi.String("SomeUser"), +// Role: pulumi.String("maintainer"), +// }, +// &github.TeamMembersMemberArgs{ +// Username: pulumi.String("AnotherUser"), +// Role: pulumi.String("member"), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // GitHub Team Membership can be imported using the team ID `teamid` or team name, e.g. diff --git a/sdk/go/github/teamMembership.go b/sdk/go/github/teamMembership.go index 03e312d9..87771c21 100644 --- a/sdk/go/github/teamMembership.go +++ b/sdk/go/github/teamMembership.go @@ -24,6 +24,47 @@ import ( // // > **Note** Organization owners may not be set as "members" of a team; they may only be set as "maintainers". Attempting to set organization an owner to "member" of a may result in a `pulumi preview` diff that changes their status back to "maintainer". // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-github/sdk/v5/go/github" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := github.NewMembership(ctx, "membershipForSomeUser", &github.MembershipArgs{ +// Username: pulumi.String("SomeUser"), +// Role: pulumi.String("member"), +// }) +// if err != nil { +// return err +// } +// someTeam, err := github.NewTeam(ctx, "someTeam", &github.TeamArgs{ +// Description: pulumi.String("Some cool team"), +// }) +// if err != nil { +// return err +// } +// _, err = github.NewTeamMembership(ctx, "someTeamMembership", &github.TeamMembershipArgs{ +// TeamId: someTeam.ID(), +// Username: pulumi.String("SomeUser"), +// Role: pulumi.String("member"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // GitHub Team Membership can be imported using an ID made up of `teamid:username` or `teamname:username`, e.g. diff --git a/sdk/go/github/teamRepository.go b/sdk/go/github/teamRepository.go index 0bbfe74c..a8efa5f6 100644 --- a/sdk/go/github/teamRepository.go +++ b/sdk/go/github/teamRepository.go @@ -29,6 +29,44 @@ import ( // This resource is non-authoritative, for managing ALL collaborators of a repo, use RepositoryCollaborators // instead. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-github/sdk/v5/go/github" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// someTeam, err := github.NewTeam(ctx, "someTeam", &github.TeamArgs{ +// Description: pulumi.String("Some cool team"), +// }) +// if err != nil { +// return err +// } +// someRepo, err := github.NewRepository(ctx, "someRepo", nil) +// if err != nil { +// return err +// } +// _, err = github.NewTeamRepository(ctx, "someTeamRepo", &github.TeamRepositoryArgs{ +// TeamId: someTeam.ID(), +// Repository: someRepo.Name, +// Permission: pulumi.String("pull"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // GitHub Team Repository can be imported using an ID made up of `team_id:repository` or `team_name:repository`, e.g. diff --git a/sdk/go/github/teamSettings.go b/sdk/go/github/teamSettings.go index 40a38d09..cc652c48 100644 --- a/sdk/go/github/teamSettings.go +++ b/sdk/go/github/teamSettings.go @@ -21,6 +21,43 @@ import ( // // > **Note**: This resource relies on the v4 GraphQl GitHub API. If this API is not available, or the Stone Crop schema preview is not available, then this resource will not work as intended. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-github/sdk/v5/go/github" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// someTeam, err := github.NewTeam(ctx, "someTeam", &github.TeamArgs{ +// Description: pulumi.String("Some cool team"), +// }) +// if err != nil { +// return err +// } +// _, err = github.NewTeamSettings(ctx, "codeReviewSettings", &github.TeamSettingsArgs{ +// TeamId: someTeam.ID(), +// ReviewRequestDelegation: &github.TeamSettingsReviewRequestDelegationArgs{ +// Algorithm: pulumi.String("ROUND_ROBIN"), +// MemberCount: pulumi.Int(1), +// Notify: pulumi.Bool(true), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // GitHub Teams can be imported using the GitHub team ID, or the team slug e.g. diff --git a/sdk/go/github/userGpgKey.go b/sdk/go/github/userGpgKey.go index 71924904..d39e6655 100644 --- a/sdk/go/github/userGpgKey.go +++ b/sdk/go/github/userGpgKey.go @@ -17,6 +17,32 @@ import ( // // This resource allows you to add/remove GPG keys from your user account. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-github/sdk/v5/go/github" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := github.NewUserGpgKey(ctx, "example", &github.UserGpgKeyArgs{ +// ArmoredPublicKey: pulumi.String("-----BEGIN PGP PUBLIC KEY BLOCK-----\n...\n-----END PGP PUBLIC KEY BLOCK-----\n"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // GPG keys are not importable due to the fact that [API](https://developer.github.com/v3/users/gpg_keys/#gpg-keys) does not return previously uploaded GPG key. diff --git a/sdk/go/github/userSshKey.go b/sdk/go/github/userSshKey.go index b78ddc4a..d4cbe734 100644 --- a/sdk/go/github/userSshKey.go +++ b/sdk/go/github/userSshKey.go @@ -17,6 +17,43 @@ import ( // // This resource allows you to add/remove SSH keys from your user account. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "os" +// +// "github.com/pulumi/pulumi-github/sdk/v5/go/github" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func readFileOrPanic(path string) pulumi.StringPtrInput { +// data, err := os.ReadFile(path) +// if err != nil { +// panic(err.Error()) +// } +// return pulumi.String(string(data)) +// } +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := github.NewUserSshKey(ctx, "example", &github.UserSshKeyArgs{ +// Title: pulumi.String("example title"), +// Key: readFileOrPanic("~/.ssh/id_rsa.pub"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // SSH keys can be imported using their ID e.g. diff --git a/sdk/nodejs/actionsEnvironmentSecret.ts b/sdk/nodejs/actionsEnvironmentSecret.ts index 908a9e8c..52bb5fe5 100644 --- a/sdk/nodejs/actionsEnvironmentSecret.ts +++ b/sdk/nodejs/actionsEnvironmentSecret.ts @@ -5,6 +5,43 @@ import * as pulumi from "@pulumi/pulumi"; import * as utilities from "./utilities"; /** + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const exampleSecretActionsEnvironmentSecret = new github.ActionsEnvironmentSecret("exampleSecretActionsEnvironmentSecret", { + * environment: "example_environment", + * secretName: "example_secret_name", + * plaintextValue: _var.some_secret_string, + * }); + * const exampleSecretIndex_actionsEnvironmentSecretActionsEnvironmentSecret = new github.ActionsEnvironmentSecret("exampleSecretIndex/actionsEnvironmentSecretActionsEnvironmentSecret", { + * environment: "example_environment", + * secretName: "example_secret_name", + * encryptedValue: _var.some_encrypted_secret_string, + * }); + * ``` + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const repo = github.getRepository({ + * fullName: "my-org/repo", + * }); + * const repoEnvironment = new github.RepositoryEnvironment("repoEnvironment", { + * repository: repo.then(repo => repo.name), + * environment: "example_environment", + * }); + * const testSecret = new github.ActionsEnvironmentSecret("testSecret", { + * repository: repo.then(repo => repo.name), + * environment: repoEnvironment.environment, + * secretName: "test_secret_name", + * plaintextValue: "%s", + * }); + * ``` + * * ## Import * * This resource does not support importing. If you'd like to help contribute it, please visit our [GitHub page](https://github.com/integrations/terraform-provider-github)! diff --git a/sdk/nodejs/actionsEnvironmentVariable.ts b/sdk/nodejs/actionsEnvironmentVariable.ts index f3ba2047..ef5bce3c 100644 --- a/sdk/nodejs/actionsEnvironmentVariable.ts +++ b/sdk/nodejs/actionsEnvironmentVariable.ts @@ -8,6 +8,38 @@ import * as utilities from "./utilities"; * This resource allows you to create and manage GitHub Actions variables within your GitHub repository environments. * You must have write access to a repository to use this resource. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const exampleVariable = new github.ActionsEnvironmentVariable("exampleVariable", { + * environment: "example_environment", + * value: "example_variable_value", + * variableName: "example_variable_name", + * }); + * ``` + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const repo = github.getRepository({ + * fullName: "my-org/repo", + * }); + * const repoEnvironment = new github.RepositoryEnvironment("repoEnvironment", { + * repository: repo.then(repo => repo.name), + * environment: "example_environment", + * }); + * const exampleVariable = new github.ActionsEnvironmentVariable("exampleVariable", { + * repository: repo.then(repo => repo.name), + * environment: repoEnvironment.environment, + * variableName: "example_variable_name", + * value: "example_variable_value", + * }); + * ``` + * * ## Import * * This resource can be imported using an ID made up of the repository name, environment name, and variable name: diff --git a/sdk/nodejs/actionsOrganizationOidcSubjectClaimCustomizationTemplate.ts b/sdk/nodejs/actionsOrganizationOidcSubjectClaimCustomizationTemplate.ts index 315f22a5..17d88182 100644 --- a/sdk/nodejs/actionsOrganizationOidcSubjectClaimCustomizationTemplate.ts +++ b/sdk/nodejs/actionsOrganizationOidcSubjectClaimCustomizationTemplate.ts @@ -11,6 +11,19 @@ import * as utilities from "./utilities"; * More information on integrating GitHub with cloud providers using OpenID Connect and a list of available claims is * available in the [Actions documentation](https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/about-security-hardening-with-openid-connect). * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const exampleTemplate = new github.ActionsOrganizationOidcSubjectClaimCustomizationTemplate("exampleTemplate", {includeClaimKeys: [ + * "actor", + * "context", + * "repository_owner", + * ]}); + * ``` + * * ## Import * * This resource can be imported using the organization's name. diff --git a/sdk/nodejs/actionsOrganizationPermissions.ts b/sdk/nodejs/actionsOrganizationPermissions.ts index a633d820..384e9a91 100644 --- a/sdk/nodejs/actionsOrganizationPermissions.ts +++ b/sdk/nodejs/actionsOrganizationPermissions.ts @@ -10,6 +10,30 @@ import * as utilities from "./utilities"; * This resource allows you to create and manage GitHub Actions permissions within your GitHub enterprise organizations. * You must have admin access to an organization to use this resource. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const example = new github.Repository("example", {}); + * const test = new github.ActionsOrganizationPermissions("test", { + * allowedActions: "selected", + * enabledRepositories: "selected", + * allowedActionsConfig: { + * githubOwnedAllowed: true, + * patternsAlloweds: [ + * "actions/cache@*", + * "actions/checkout@*", + * ], + * verifiedAllowed: true, + * }, + * enabledRepositoriesConfig: { + * repositoryIds: [example.repoId], + * }, + * }); + * ``` + * * ## Import * * This resource can be imported using the ID of the GitHub organization: diff --git a/sdk/nodejs/actionsOrganizationSecret.ts b/sdk/nodejs/actionsOrganizationSecret.ts index f1b7d3bc..2d225988 100644 --- a/sdk/nodejs/actionsOrganizationSecret.ts +++ b/sdk/nodejs/actionsOrganizationSecret.ts @@ -5,6 +5,45 @@ import * as pulumi from "@pulumi/pulumi"; import * as utilities from "./utilities"; /** + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const exampleSecretActionsOrganizationSecret = new github.ActionsOrganizationSecret("exampleSecretActionsOrganizationSecret", { + * secretName: "example_secret_name", + * visibility: "private", + * plaintextValue: _var.some_secret_string, + * }); + * const exampleSecretIndex_actionsOrganizationSecretActionsOrganizationSecret = new github.ActionsOrganizationSecret("exampleSecretIndex/actionsOrganizationSecretActionsOrganizationSecret", { + * secretName: "example_secret_name", + * visibility: "private", + * encryptedValue: _var.some_encrypted_secret_string, + * }); + * ``` + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const repo = github.getRepository({ + * fullName: "my-org/repo", + * }); + * const exampleSecretActionsOrganizationSecret = new github.ActionsOrganizationSecret("exampleSecretActionsOrganizationSecret", { + * secretName: "example_secret_name", + * visibility: "selected", + * plaintextValue: _var.some_secret_string, + * selectedRepositoryIds: [repo.then(repo => repo.repoId)], + * }); + * const exampleSecretIndex_actionsOrganizationSecretActionsOrganizationSecret = new github.ActionsOrganizationSecret("exampleSecretIndex/actionsOrganizationSecretActionsOrganizationSecret", { + * secretName: "example_secret_name", + * visibility: "selected", + * encryptedValue: _var.some_encrypted_secret_string, + * selectedRepositoryIds: [repo.then(repo => repo.repoId)], + * }); + * ``` + * * ## Import * * This resource can be imported using an ID made up of the secret name: diff --git a/sdk/nodejs/actionsOrganizationSecretRepositories.ts b/sdk/nodejs/actionsOrganizationSecretRepositories.ts index 902a4f5b..7e448d59 100644 --- a/sdk/nodejs/actionsOrganizationSecretRepositories.ts +++ b/sdk/nodejs/actionsOrganizationSecretRepositories.ts @@ -10,6 +10,21 @@ import * as utilities from "./utilities"; * * This resource is only applicable when `visibility` of the existing organization secret has been set to `selected`. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const repo = github.getRepository({ + * fullName: "my-org/repo", + * }); + * const orgSecretRepos = new github.ActionsOrganizationSecretRepositories("orgSecretRepos", { + * secretName: "existing_secret_name", + * selectedRepositoryIds: [repo.then(repo => repo.repoId)], + * }); + * ``` + * * ## Import * * This resource can be imported using an ID made up of the secret name: diff --git a/sdk/nodejs/actionsOrganizationVariable.ts b/sdk/nodejs/actionsOrganizationVariable.ts index f19cfe44..db11abc9 100644 --- a/sdk/nodejs/actionsOrganizationVariable.ts +++ b/sdk/nodejs/actionsOrganizationVariable.ts @@ -8,6 +8,34 @@ import * as utilities from "./utilities"; * This resource allows you to create and manage GitHub Actions variables within your GitHub organization. * You must have write access to a repository to use this resource. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const exampleVariable = new github.ActionsOrganizationVariable("exampleVariable", { + * value: "example_variable_value", + * variableName: "example_variable_name", + * visibility: "private", + * }); + * ``` + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const repo = github.getRepository({ + * fullName: "my-org/repo", + * }); + * const exampleVariable = new github.ActionsOrganizationVariable("exampleVariable", { + * variableName: "example_variable_name", + * visibility: "selected", + * value: "example_variable_value", + * selectedRepositoryIds: [repo.then(repo => repo.repoId)], + * }); + * ``` + * * ## Import * * This resource can be imported using an ID made up of the variable name: diff --git a/sdk/nodejs/actionsRepositoryAccessLevel.ts b/sdk/nodejs/actionsRepositoryAccessLevel.ts index d3d1aef6..3b98a647 100644 --- a/sdk/nodejs/actionsRepositoryAccessLevel.ts +++ b/sdk/nodejs/actionsRepositoryAccessLevel.ts @@ -8,6 +8,19 @@ import * as utilities from "./utilities"; * This resource allows you to set the access level of a non-public repositories actions and reusable workflows for use in other repositories. * You must have admin access to a repository to use this resource. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const example = new github.Repository("example", {visibility: "private"}); + * const test = new github.ActionsRepositoryAccessLevel("test", { + * accessLevel: "user", + * repository: example.name, + * }); + * ``` + * * ## Import * * This resource can be imported using the name of the GitHub repository: diff --git a/sdk/nodejs/actionsRepositoryOidcSubjectClaimCustomizationTemplate.ts b/sdk/nodejs/actionsRepositoryOidcSubjectClaimCustomizationTemplate.ts index 0c538820..3594ea3e 100644 --- a/sdk/nodejs/actionsRepositoryOidcSubjectClaimCustomizationTemplate.ts +++ b/sdk/nodejs/actionsRepositoryOidcSubjectClaimCustomizationTemplate.ts @@ -19,6 +19,24 @@ import * as utilities from "./utilities"; * | `false` | Set | `includeClaimKeys` | * | `false` | Unset | Organization's default if set, otherwise GitHub's default | * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const example = new github.Repository("example", {}); + * const exampleTemplate = new github.ActionsRepositoryOidcSubjectClaimCustomizationTemplate("exampleTemplate", { + * repository: example.name, + * useDefault: false, + * includeClaimKeys: [ + * "actor", + * "context", + * "repository_owner", + * ], + * }); + * ``` + * * ## Import * * This resource can be imported using the repository's name. diff --git a/sdk/nodejs/actionsRepositoryPermissions.ts b/sdk/nodejs/actionsRepositoryPermissions.ts index ad975c35..37857fae 100644 --- a/sdk/nodejs/actionsRepositoryPermissions.ts +++ b/sdk/nodejs/actionsRepositoryPermissions.ts @@ -10,6 +10,27 @@ import * as utilities from "./utilities"; * This resource allows you to enable and manage GitHub Actions permissions for a given repository. * You must have admin access to an repository to use this resource. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const example = new github.Repository("example", {}); + * const test = new github.ActionsRepositoryPermissions("test", { + * allowedActions: "selected", + * allowedActionsConfig: { + * githubOwnedAllowed: true, + * patternsAlloweds: [ + * "actions/cache@*", + * "actions/checkout@*", + * ], + * verifiedAllowed: true, + * }, + * repository: example.name, + * }); + * ``` + * * ## Import * * This resource can be imported using the name of the GitHub repository: diff --git a/sdk/nodejs/actionsRunnerGroup.ts b/sdk/nodejs/actionsRunnerGroup.ts index 08b3652a..f28ad7cb 100644 --- a/sdk/nodejs/actionsRunnerGroup.ts +++ b/sdk/nodejs/actionsRunnerGroup.ts @@ -8,6 +8,19 @@ import * as utilities from "./utilities"; * This resource allows you to create and manage GitHub Actions runner groups within your GitHub enterprise organizations. * You must have admin access to an organization to use this resource. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const exampleRepository = new github.Repository("exampleRepository", {}); + * const exampleActionsRunnerGroup = new github.ActionsRunnerGroup("exampleActionsRunnerGroup", { + * visibility: "selected", + * selectedRepositoryIds: [exampleRepository.repoId], + * }); + * ``` + * * ## Import * * This resource can be imported using the ID of the runner group: diff --git a/sdk/nodejs/actionsSecret.ts b/sdk/nodejs/actionsSecret.ts index eb1bd88c..f9a95c42 100644 --- a/sdk/nodejs/actionsSecret.ts +++ b/sdk/nodejs/actionsSecret.ts @@ -5,6 +5,27 @@ import * as pulumi from "@pulumi/pulumi"; import * as utilities from "./utilities"; /** + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const examplePublicKey = github.getActionsPublicKey({ + * repository: "example_repository", + * }); + * const exampleSecretActionsSecret = new github.ActionsSecret("exampleSecretActionsSecret", { + * repository: "example_repository", + * secretName: "example_secret_name", + * plaintextValue: _var.some_secret_string, + * }); + * const exampleSecretIndex_actionsSecretActionsSecret = new github.ActionsSecret("exampleSecretIndex/actionsSecretActionsSecret", { + * repository: "example_repository", + * secretName: "example_secret_name", + * encryptedValue: _var.some_encrypted_secret_string, + * }); + * ``` + * * ## Import * * This resource can be imported using an ID made up of the `repository` and `secret_name`: diff --git a/sdk/nodejs/actionsVariable.ts b/sdk/nodejs/actionsVariable.ts index ffdd7a05..0e243ae3 100644 --- a/sdk/nodejs/actionsVariable.ts +++ b/sdk/nodejs/actionsVariable.ts @@ -8,6 +8,19 @@ import * as utilities from "./utilities"; * This resource allows you to create and manage GitHub Actions variables within your GitHub repositories. * You must have write access to a repository to use this resource. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const exampleVariable = new github.ActionsVariable("exampleVariable", { + * repository: "example_repository", + * value: "example_variable_value", + * variableName: "example_variable_name", + * }); + * ``` + * * ## Import * * GitHub Actions variables can be imported using an ID made up of `repository:variable_name`, e.g. diff --git a/sdk/nodejs/appInstallationRepository.ts b/sdk/nodejs/appInstallationRepository.ts index 7bedd415..bd95b164 100644 --- a/sdk/nodejs/appInstallationRepository.ts +++ b/sdk/nodejs/appInstallationRepository.ts @@ -17,6 +17,20 @@ import * as utilities from "./utilities"; * by the following the instructions at this * [link](https://docs.github.com/en/github/setting-up-and-managing-organizations-and-teams/reviewing-your-organizations-installed-integrations). * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * // Create a repository. + * const someRepo = new github.Repository("someRepo", {}); + * const someAppRepo = new github.AppInstallationRepository("someAppRepo", { + * installationId: "1234567", + * repository: someRepo.name, + * }); + * ``` + * * ## Import * * GitHub App Installation Repository can be imported using an ID made up of `installation_id:repository`, e.g. diff --git a/sdk/nodejs/branch.ts b/sdk/nodejs/branch.ts index 0adb438a..40e8af7b 100644 --- a/sdk/nodejs/branch.ts +++ b/sdk/nodejs/branch.ts @@ -10,6 +10,18 @@ import * as utilities from "./utilities"; * Additional constraints can be applied to ensure your branch is created from * another branch or commit. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const development = new github.Branch("development", { + * branch: "development", + * repository: "example", + * }); + * ``` + * * ## Import * * GitHub Branch can be imported using an ID made up of `repository:branch`, e.g. diff --git a/sdk/nodejs/branchDefault.ts b/sdk/nodejs/branchDefault.ts index 9da3f2b4..334fafd9 100644 --- a/sdk/nodejs/branchDefault.ts +++ b/sdk/nodejs/branchDefault.ts @@ -11,6 +11,45 @@ import * as utilities from "./utilities"; * * Note that use of this resource is incompatible with the `defaultBranch` option of the `github.Repository` resource. Using both will result in plans always showing a diff. * + * ## Example Usage + * + * Basic usage: + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const example = new github.Repository("example", { + * description: "My awesome codebase", + * autoInit: true, + * }); + * const development = new github.Branch("development", { + * repository: example.name, + * branch: "development", + * }); + * const _default = new github.BranchDefault("default", { + * repository: example.name, + * branch: development.branch, + * }); + * ``` + * + * Renaming to a branch that doesn't exist: + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const example = new github.Repository("example", { + * description: "My awesome codebase", + * autoInit: true, + * }); + * const _default = new github.BranchDefault("default", { + * repository: example.name, + * branch: "development", + * rename: true, + * }); + * ``` + * * ## Import * * GitHub Branch Defaults can be imported using an ID made up of `repository`, e.g. diff --git a/sdk/nodejs/branchProtection.ts b/sdk/nodejs/branchProtection.ts index 4441ad59..9332d65d 100644 --- a/sdk/nodejs/branchProtection.ts +++ b/sdk/nodejs/branchProtection.ts @@ -7,6 +7,57 @@ import * as outputs from "./types/output"; import * as utilities from "./utilities"; /** + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const exampleRepository = new github.Repository("exampleRepository", {}); + * const exampleUser = github.getUser({ + * username: "example", + * }); + * const exampleTeam = new github.Team("exampleTeam", {}); + * // Protect the main branch of the foo repository. Additionally, require that + * // the "ci/travis" context to be passing and only allow the engineers team merge + * // to the branch. + * const exampleBranchProtection = new github.BranchProtection("exampleBranchProtection", { + * repositoryId: exampleRepository.nodeId, + * pattern: "main", + * enforceAdmins: true, + * allowsDeletions: true, + * requiredStatusChecks: [{ + * strict: false, + * contexts: ["ci/travis"], + * }], + * requiredPullRequestReviews: [{ + * dismissStaleReviews: true, + * restrictDismissals: true, + * dismissalRestrictions: [ + * exampleUser.then(exampleUser => exampleUser.nodeId), + * exampleTeam.nodeId, + * "/exampleuser", + * "exampleorganization/exampleteam", + * ], + * }], + * pushRestrictions: [ + * exampleUser.then(exampleUser => exampleUser.nodeId), + * "/exampleuser", + * "exampleorganization/exampleteam", + * ], + * forcePushBypassers: [ + * exampleUser.then(exampleUser => exampleUser.nodeId), + * "/exampleuser", + * "exampleorganization/exampleteam", + * ], + * }); + * const exampleTeamRepository = new github.TeamRepository("exampleTeamRepository", { + * teamId: exampleTeam.id, + * repository: exampleRepository.name, + * permission: "pull", + * }); + * ``` + * * ## Import * * GitHub Branch Protection can be imported using an ID made up of `repository:pattern`, e.g. diff --git a/sdk/nodejs/branchProtectionV3.ts b/sdk/nodejs/branchProtectionV3.ts index 6e147f32..0f014ac2 100644 --- a/sdk/nodejs/branchProtectionV3.ts +++ b/sdk/nodejs/branchProtectionV3.ts @@ -13,6 +13,62 @@ import * as utilities from "./utilities"; * * This resource allows you to configure branch protection for repositories in your organization. When applied, the branch will be protected from forced pushes and deletion. Additional constraints, such as required status checks or restrictions on users, teams, and apps, can also be configured. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * // Protect the main branch of the foo repository. Only allow a specific user to merge to the branch. + * const example = new github.BranchProtectionV3("example", { + * repository: github_repository.example.name, + * branch: "main", + * restrictions: { + * users: ["foo-user"], + * }, + * }); + * ``` + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const exampleRepository = new github.Repository("exampleRepository", {}); + * const exampleTeam = new github.Team("exampleTeam", {}); + * // Protect the main branch of the foo repository. Additionally, require that + * // the "ci/check" check ran by the Github Actions app is passing and only allow + * // the engineers team merge to the branch. + * const exampleBranchProtectionV3 = new github.BranchProtectionV3("exampleBranchProtectionV3", { + * repository: exampleRepository.name, + * branch: "main", + * enforceAdmins: true, + * requiredStatusChecks: { + * strict: false, + * checks: ["ci/check:824642007264"], + * }, + * requiredPullRequestReviews: { + * dismissStaleReviews: true, + * dismissalUsers: ["foo-user"], + * dismissalTeams: [exampleTeam.slug], + * bypassPullRequestAllowances: { + * users: ["foo-user"], + * teams: [exampleTeam.slug], + * apps: ["foo-app"], + * }, + * }, + * restrictions: { + * users: ["foo-user"], + * teams: [exampleTeam.slug], + * apps: ["foo-app"], + * }, + * }); + * const exampleTeamRepository = new github.TeamRepository("exampleTeamRepository", { + * teamId: exampleTeam.id, + * repository: exampleRepository.name, + * permission: "pull", + * }); + * ``` + * * ## Import * * GitHub Branch Protection can be imported using an ID made up of `repository:branch`, e.g. diff --git a/sdk/nodejs/codespacesOrganizationSecret.ts b/sdk/nodejs/codespacesOrganizationSecret.ts index 9a3d24d5..e6cab680 100644 --- a/sdk/nodejs/codespacesOrganizationSecret.ts +++ b/sdk/nodejs/codespacesOrganizationSecret.ts @@ -5,6 +5,45 @@ import * as pulumi from "@pulumi/pulumi"; import * as utilities from "./utilities"; /** + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const exampleSecretCodespacesOrganizationSecret = new github.CodespacesOrganizationSecret("exampleSecretCodespacesOrganizationSecret", { + * secretName: "example_secret_name", + * visibility: "private", + * plaintextValue: _var.some_secret_string, + * }); + * const exampleSecretIndex_codespacesOrganizationSecretCodespacesOrganizationSecret = new github.CodespacesOrganizationSecret("exampleSecretIndex/codespacesOrganizationSecretCodespacesOrganizationSecret", { + * secretName: "example_secret_name", + * visibility: "private", + * encryptedValue: _var.some_encrypted_secret_string, + * }); + * ``` + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const repo = github.getRepository({ + * fullName: "my-org/repo", + * }); + * const exampleSecretCodespacesOrganizationSecret = new github.CodespacesOrganizationSecret("exampleSecretCodespacesOrganizationSecret", { + * secretName: "example_secret_name", + * visibility: "selected", + * plaintextValue: _var.some_secret_string, + * selectedRepositoryIds: [repo.then(repo => repo.repoId)], + * }); + * const exampleSecretIndex_codespacesOrganizationSecretCodespacesOrganizationSecret = new github.CodespacesOrganizationSecret("exampleSecretIndex/codespacesOrganizationSecretCodespacesOrganizationSecret", { + * secretName: "example_secret_name", + * visibility: "selected", + * encryptedValue: _var.some_encrypted_secret_string, + * selectedRepositoryIds: [repo.then(repo => repo.repoId)], + * }); + * ``` + * * ## Import * * This resource can be imported using an ID made up of the secret name diff --git a/sdk/nodejs/codespacesOrganizationSecretRepositories.ts b/sdk/nodejs/codespacesOrganizationSecretRepositories.ts index e58ee495..278cfff3 100644 --- a/sdk/nodejs/codespacesOrganizationSecretRepositories.ts +++ b/sdk/nodejs/codespacesOrganizationSecretRepositories.ts @@ -11,6 +11,21 @@ import * as utilities from "./utilities"; * * This resource is only applicable when `visibility` of the existing organization secret has been set to `selected`. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const repo = github.getRepository({ + * fullName: "my-org/repo", + * }); + * const orgSecretRepos = new github.CodespacesOrganizationSecretRepositories("orgSecretRepos", { + * secretName: "existing_secret_name", + * selectedRepositoryIds: [repo.then(repo => repo.repoId)], + * }); + * ``` + * * ## Import * * This resource can be imported using an ID made up of the secret name: diff --git a/sdk/nodejs/codespacesSecret.ts b/sdk/nodejs/codespacesSecret.ts index f8f85e12..9e7c3cf6 100644 --- a/sdk/nodejs/codespacesSecret.ts +++ b/sdk/nodejs/codespacesSecret.ts @@ -5,6 +5,27 @@ import * as pulumi from "@pulumi/pulumi"; import * as utilities from "./utilities"; /** + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const examplePublicKey = github.getCodespacesPublicKey({ + * repository: "example_repository", + * }); + * const exampleSecretCodespacesSecret = new github.CodespacesSecret("exampleSecretCodespacesSecret", { + * repository: "example_repository", + * secretName: "example_secret_name", + * plaintextValue: _var.some_secret_string, + * }); + * const exampleSecretIndex_codespacesSecretCodespacesSecret = new github.CodespacesSecret("exampleSecretIndex/codespacesSecretCodespacesSecret", { + * repository: "example_repository", + * secretName: "example_secret_name", + * encryptedValue: _var.some_encrypted_secret_string, + * }); + * ``` + * * ## Import * * This resource can be imported using an ID made up of the `repository` and `secret_name`: diff --git a/sdk/nodejs/codespacesUserSecret.ts b/sdk/nodejs/codespacesUserSecret.ts index 15f3b472..e5dcf2cf 100644 --- a/sdk/nodejs/codespacesUserSecret.ts +++ b/sdk/nodejs/codespacesUserSecret.ts @@ -5,6 +5,27 @@ import * as pulumi from "@pulumi/pulumi"; import * as utilities from "./utilities"; /** + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const repo = github.getRepository({ + * fullName: "my-org/repo", + * }); + * const exampleSecretCodespacesUserSecret = new github.CodespacesUserSecret("exampleSecretCodespacesUserSecret", { + * secretName: "example_secret_name", + * plaintextValue: _var.some_secret_string, + * selectedRepositoryIds: [repo.then(repo => repo.repoId)], + * }); + * const exampleSecretIndex_codespacesUserSecretCodespacesUserSecret = new github.CodespacesUserSecret("exampleSecretIndex/codespacesUserSecretCodespacesUserSecret", { + * secretName: "example_secret_name", + * encryptedValue: _var.some_encrypted_secret_string, + * selectedRepositoryIds: [repo.then(repo => repo.repoId)], + * }); + * ``` + * * ## Import * * This resource can be imported using an ID made up of the secret name diff --git a/sdk/nodejs/emuGroupMapping.ts b/sdk/nodejs/emuGroupMapping.ts index 5c91c70e..36af4942 100644 --- a/sdk/nodejs/emuGroupMapping.ts +++ b/sdk/nodejs/emuGroupMapping.ts @@ -7,6 +7,19 @@ import * as utilities from "./utilities"; /** * This resource manages mappings between external groups for enterprise managed users and GitHub teams. It wraps the API detailed [here](https://docs.github.com/en/rest/reference/teams#external-groups). Note that this is a distinct resource from `github.TeamSyncGroupMapping`. `github.EmuGroupMapping` is special to the Enterprise Managed User (EMU) external group feature, whereas `github.TeamSyncGroupMapping` is specific to Identity Provider Groups. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const exampleEmuGroupMapping = new github.EmuGroupMapping("exampleEmuGroupMapping", { + * groupId: 28836, + * teamSlug: "emu-test-team", + * }); + * // The GitHub team name to modify + * ``` + * * ## Import * * GitHub EMU External Group Mappings can be imported using the external `group_id`, e.g. diff --git a/sdk/nodejs/enterpriseOrganization.ts b/sdk/nodejs/enterpriseOrganization.ts index 014d8b59..9b49df77 100644 --- a/sdk/nodejs/enterpriseOrganization.ts +++ b/sdk/nodejs/enterpriseOrganization.ts @@ -7,6 +7,21 @@ import * as utilities from "./utilities"; /** * This resource allows you to create and manage a GitHub enterprise organization. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const org = new github.EnterpriseOrganization("org", { + * enterpriseId: data.github_enterprise.enterprise.id, + * displayName: "Some Awesome Org", + * description: "Organization created with terraform", + * billingEmail: "jon@winteriscoming.com", + * adminLogins: ["jon-snow"], + * }); + * ``` + * * ## Import * * GitHub Enterprise Organization can be imported using the `slug` of the enterprise, combined with the `orgname` of the organization, separated by a `/` character. diff --git a/sdk/nodejs/getActionsEnvironmentSecrets.ts b/sdk/nodejs/getActionsEnvironmentSecrets.ts index 72d470e4..eb7ef1c7 100644 --- a/sdk/nodejs/getActionsEnvironmentSecrets.ts +++ b/sdk/nodejs/getActionsEnvironmentSecrets.ts @@ -8,6 +8,18 @@ import * as utilities from "./utilities"; /** * Use this data source to retrieve the list of secrets of the repository environment. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const example = github.getActionsEnvironmentSecrets({ + * environment: "exampleEnvironment", + * name: "exampleRepo", + * }); + * ``` */ export function getActionsEnvironmentSecrets(args: GetActionsEnvironmentSecretsArgs, opts?: pulumi.InvokeOptions): Promise { @@ -52,6 +64,18 @@ export interface GetActionsEnvironmentSecretsResult { } /** * Use this data source to retrieve the list of secrets of the repository environment. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const example = github.getActionsEnvironmentSecrets({ + * environment: "exampleEnvironment", + * name: "exampleRepo", + * }); + * ``` */ export function getActionsEnvironmentSecretsOutput(args: GetActionsEnvironmentSecretsOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getActionsEnvironmentSecrets(a, opts)) diff --git a/sdk/nodejs/getActionsEnvironmentVariables.ts b/sdk/nodejs/getActionsEnvironmentVariables.ts index e614eacb..7417eae7 100644 --- a/sdk/nodejs/getActionsEnvironmentVariables.ts +++ b/sdk/nodejs/getActionsEnvironmentVariables.ts @@ -8,6 +8,18 @@ import * as utilities from "./utilities"; /** * Use this data source to retrieve the list of variables of the repository environment. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const example = github.getActionsEnvironmentVariables({ + * environment: "exampleEnvironment", + * name: "exampleRepo", + * }); + * ``` */ export function getActionsEnvironmentVariables(args: GetActionsEnvironmentVariablesArgs, opts?: pulumi.InvokeOptions): Promise { @@ -52,6 +64,18 @@ export interface GetActionsEnvironmentVariablesResult { } /** * Use this data source to retrieve the list of variables of the repository environment. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const example = github.getActionsEnvironmentVariables({ + * environment: "exampleEnvironment", + * name: "exampleRepo", + * }); + * ``` */ export function getActionsEnvironmentVariablesOutput(args: GetActionsEnvironmentVariablesOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getActionsEnvironmentVariables(a, opts)) diff --git a/sdk/nodejs/getActionsOrganizationOidcSubjectClaimCustomizationTemplate.ts b/sdk/nodejs/getActionsOrganizationOidcSubjectClaimCustomizationTemplate.ts index 170c4929..63e9ee18 100644 --- a/sdk/nodejs/getActionsOrganizationOidcSubjectClaimCustomizationTemplate.ts +++ b/sdk/nodejs/getActionsOrganizationOidcSubjectClaimCustomizationTemplate.ts @@ -6,6 +6,15 @@ import * as utilities from "./utilities"; /** * Use this data source to retrieve the OpenID Connect subject claim customization template for an organization + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const example = github.getActionsOrganizationOidcSubjectClaimCustomizationTemplate({}); + * ``` */ export function getActionsOrganizationOidcSubjectClaimCustomizationTemplate(opts?: pulumi.InvokeOptions): Promise { @@ -29,6 +38,15 @@ export interface GetActionsOrganizationOidcSubjectClaimCustomizationTemplateResu } /** * Use this data source to retrieve the OpenID Connect subject claim customization template for an organization + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const example = github.getActionsOrganizationOidcSubjectClaimCustomizationTemplate({}); + * ``` */ export function getActionsOrganizationOidcSubjectClaimCustomizationTemplateOutput(opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(getActionsOrganizationOidcSubjectClaimCustomizationTemplate(opts)) diff --git a/sdk/nodejs/getActionsOrganizationPublicKey.ts b/sdk/nodejs/getActionsOrganizationPublicKey.ts index 6ef63a1a..6ab99fdb 100644 --- a/sdk/nodejs/getActionsOrganizationPublicKey.ts +++ b/sdk/nodejs/getActionsOrganizationPublicKey.ts @@ -7,6 +7,15 @@ import * as utilities from "./utilities"; /** * Use this data source to retrieve information about a GitHub Actions Organization public key. This data source is required to be used with other GitHub secrets interactions. * Note that the provider `token` must have admin rights to an organization to retrieve it's action public key. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const example = github.getActionsOrganizationPublicKey({}); + * ``` */ export function getActionsOrganizationPublicKey(opts?: pulumi.InvokeOptions): Promise { @@ -35,6 +44,15 @@ export interface GetActionsOrganizationPublicKeyResult { /** * Use this data source to retrieve information about a GitHub Actions Organization public key. This data source is required to be used with other GitHub secrets interactions. * Note that the provider `token` must have admin rights to an organization to retrieve it's action public key. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const example = github.getActionsOrganizationPublicKey({}); + * ``` */ export function getActionsOrganizationPublicKeyOutput(opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(getActionsOrganizationPublicKey(opts)) diff --git a/sdk/nodejs/getActionsOrganizationRegistrationToken.ts b/sdk/nodejs/getActionsOrganizationRegistrationToken.ts index 8e2c9603..c7149814 100644 --- a/sdk/nodejs/getActionsOrganizationRegistrationToken.ts +++ b/sdk/nodejs/getActionsOrganizationRegistrationToken.ts @@ -6,6 +6,15 @@ import * as utilities from "./utilities"; /** * Use this data source to retrieve a GitHub Actions organization registration token. This token can then be used to register a self-hosted runner. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const example = github.getActionsOrganizationRegistrationToken({}); + * ``` */ export function getActionsOrganizationRegistrationToken(opts?: pulumi.InvokeOptions): Promise { @@ -33,6 +42,15 @@ export interface GetActionsOrganizationRegistrationTokenResult { } /** * Use this data source to retrieve a GitHub Actions organization registration token. This token can then be used to register a self-hosted runner. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const example = github.getActionsOrganizationRegistrationToken({}); + * ``` */ export function getActionsOrganizationRegistrationTokenOutput(opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(getActionsOrganizationRegistrationToken(opts)) diff --git a/sdk/nodejs/getActionsOrganizationSecrets.ts b/sdk/nodejs/getActionsOrganizationSecrets.ts index 0d87d3b7..e6be23c9 100644 --- a/sdk/nodejs/getActionsOrganizationSecrets.ts +++ b/sdk/nodejs/getActionsOrganizationSecrets.ts @@ -8,6 +8,15 @@ import * as utilities from "./utilities"; /** * Use this data source to retrieve the list of secrets of the organization. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const example = github.getActionsOrganizationSecrets({}); + * ``` */ export function getActionsOrganizationSecrets(opts?: pulumi.InvokeOptions): Promise { @@ -31,6 +40,15 @@ export interface GetActionsOrganizationSecretsResult { } /** * Use this data source to retrieve the list of secrets of the organization. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const example = github.getActionsOrganizationSecrets({}); + * ``` */ export function getActionsOrganizationSecretsOutput(opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(getActionsOrganizationSecrets(opts)) diff --git a/sdk/nodejs/getActionsOrganizationVariables.ts b/sdk/nodejs/getActionsOrganizationVariables.ts index dbeabe0f..d7aca614 100644 --- a/sdk/nodejs/getActionsOrganizationVariables.ts +++ b/sdk/nodejs/getActionsOrganizationVariables.ts @@ -8,6 +8,15 @@ import * as utilities from "./utilities"; /** * Use this data source to retrieve the list of variables of the organization. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const example = github.getActionsOrganizationVariables({}); + * ``` */ export function getActionsOrganizationVariables(opts?: pulumi.InvokeOptions): Promise { @@ -31,6 +40,15 @@ export interface GetActionsOrganizationVariablesResult { } /** * Use this data source to retrieve the list of variables of the organization. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const example = github.getActionsOrganizationVariables({}); + * ``` */ export function getActionsOrganizationVariablesOutput(opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(getActionsOrganizationVariables(opts)) diff --git a/sdk/nodejs/getActionsPublicKey.ts b/sdk/nodejs/getActionsPublicKey.ts index c9c52457..9c9ba53c 100644 --- a/sdk/nodejs/getActionsPublicKey.ts +++ b/sdk/nodejs/getActionsPublicKey.ts @@ -7,6 +7,17 @@ import * as utilities from "./utilities"; /** * Use this data source to retrieve information about a GitHub Actions public key. This data source is required to be used with other GitHub secrets interactions. * Note that the provider `token` must have admin rights to a repository to retrieve it's action public key. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const example = github.getActionsPublicKey({ + * repository: "example_repo", + * }); + * ``` */ export function getActionsPublicKey(args: GetActionsPublicKeyArgs, opts?: pulumi.InvokeOptions): Promise { @@ -47,6 +58,17 @@ export interface GetActionsPublicKeyResult { /** * Use this data source to retrieve information about a GitHub Actions public key. This data source is required to be used with other GitHub secrets interactions. * Note that the provider `token` must have admin rights to a repository to retrieve it's action public key. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const example = github.getActionsPublicKey({ + * repository: "example_repo", + * }); + * ``` */ export function getActionsPublicKeyOutput(args: GetActionsPublicKeyOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getActionsPublicKey(a, opts)) diff --git a/sdk/nodejs/getActionsRegistrationToken.ts b/sdk/nodejs/getActionsRegistrationToken.ts index 47d799ae..bd1b98fe 100644 --- a/sdk/nodejs/getActionsRegistrationToken.ts +++ b/sdk/nodejs/getActionsRegistrationToken.ts @@ -6,6 +6,17 @@ import * as utilities from "./utilities"; /** * Use this data source to retrieve a GitHub Actions repository registration token. This token can then be used to register a self-hosted runner. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const example = github.getActionsRegistrationToken({ + * repository: "example_repo", + * }); + * ``` */ export function getActionsRegistrationToken(args: GetActionsRegistrationTokenArgs, opts?: pulumi.InvokeOptions): Promise { @@ -45,6 +56,17 @@ export interface GetActionsRegistrationTokenResult { } /** * Use this data source to retrieve a GitHub Actions repository registration token. This token can then be used to register a self-hosted runner. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const example = github.getActionsRegistrationToken({ + * repository: "example_repo", + * }); + * ``` */ export function getActionsRegistrationTokenOutput(args: GetActionsRegistrationTokenOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getActionsRegistrationToken(a, opts)) diff --git a/sdk/nodejs/getActionsRepositoryOidcSubjectClaimCustomizationTemplate.ts b/sdk/nodejs/getActionsRepositoryOidcSubjectClaimCustomizationTemplate.ts index 910a54a5..4f7c8bee 100644 --- a/sdk/nodejs/getActionsRepositoryOidcSubjectClaimCustomizationTemplate.ts +++ b/sdk/nodejs/getActionsRepositoryOidcSubjectClaimCustomizationTemplate.ts @@ -6,6 +6,17 @@ import * as utilities from "./utilities"; /** * Use this data source to retrieve the OpenID Connect subject claim customization template for a repository + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const example = github.getActionsRepositoryOidcSubjectClaimCustomizationTemplate({ + * name: "example_repository", + * }); + * ``` */ export function getActionsRepositoryOidcSubjectClaimCustomizationTemplate(args: GetActionsRepositoryOidcSubjectClaimCustomizationTemplateArgs, opts?: pulumi.InvokeOptions): Promise { @@ -45,6 +56,17 @@ export interface GetActionsRepositoryOidcSubjectClaimCustomizationTemplateResult } /** * Use this data source to retrieve the OpenID Connect subject claim customization template for a repository + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const example = github.getActionsRepositoryOidcSubjectClaimCustomizationTemplate({ + * name: "example_repository", + * }); + * ``` */ export function getActionsRepositoryOidcSubjectClaimCustomizationTemplateOutput(args: GetActionsRepositoryOidcSubjectClaimCustomizationTemplateOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getActionsRepositoryOidcSubjectClaimCustomizationTemplate(a, opts)) diff --git a/sdk/nodejs/getActionsSecrets.ts b/sdk/nodejs/getActionsSecrets.ts index 1a0bb01e..6fe611ca 100644 --- a/sdk/nodejs/getActionsSecrets.ts +++ b/sdk/nodejs/getActionsSecrets.ts @@ -8,6 +8,17 @@ import * as utilities from "./utilities"; /** * Use this data source to retrieve the list of secrets for a GitHub repository. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const example = github.getActionsSecrets({ + * name: "example", + * }); + * ``` */ export function getActionsSecrets(args?: GetActionsSecretsArgs, opts?: pulumi.InvokeOptions): Promise { args = args || {}; @@ -53,6 +64,17 @@ export interface GetActionsSecretsResult { } /** * Use this data source to retrieve the list of secrets for a GitHub repository. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const example = github.getActionsSecrets({ + * name: "example", + * }); + * ``` */ export function getActionsSecretsOutput(args?: GetActionsSecretsOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getActionsSecrets(a, opts)) diff --git a/sdk/nodejs/getActionsVariables.ts b/sdk/nodejs/getActionsVariables.ts index 3133a84d..259a7e52 100644 --- a/sdk/nodejs/getActionsVariables.ts +++ b/sdk/nodejs/getActionsVariables.ts @@ -8,6 +8,17 @@ import * as utilities from "./utilities"; /** * Use this data source to retrieve the list of variables for a GitHub repository. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const example = github.getActionsVariables({ + * name: "example", + * }); + * ``` */ export function getActionsVariables(args?: GetActionsVariablesArgs, opts?: pulumi.InvokeOptions): Promise { args = args || {}; @@ -53,6 +64,17 @@ export interface GetActionsVariablesResult { } /** * Use this data source to retrieve the list of variables for a GitHub repository. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const example = github.getActionsVariables({ + * name: "example", + * }); + * ``` */ export function getActionsVariablesOutput(args?: GetActionsVariablesOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getActionsVariables(a, opts)) diff --git a/sdk/nodejs/getAppToken.ts b/sdk/nodejs/getAppToken.ts index d7e2f0b7..1868ed84 100644 --- a/sdk/nodejs/getAppToken.ts +++ b/sdk/nodejs/getAppToken.ts @@ -6,6 +6,20 @@ import * as utilities from "./utilities"; /** * Use this data source to generate a [GitHub App JWT](https://docs.github.com/en/apps/creating-github-apps/authenticating-with-a-github-app/generating-a-json-web-token-jwt-for-a-github-app). + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as fs from "fs"; + * import * as github from "@pulumi/github"; + * + * const this = github.getAppToken({ + * appId: "123456", + * installationId: "78910", + * pemFile: fs.readFileSync("foo/bar.pem"), + * }); + * ``` */ export function getAppToken(args: GetAppTokenArgs, opts?: pulumi.InvokeOptions): Promise { @@ -53,6 +67,20 @@ export interface GetAppTokenResult { } /** * Use this data source to generate a [GitHub App JWT](https://docs.github.com/en/apps/creating-github-apps/authenticating-with-a-github-app/generating-a-json-web-token-jwt-for-a-github-app). + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as fs from "fs"; + * import * as github from "@pulumi/github"; + * + * const this = github.getAppToken({ + * appId: "123456", + * installationId: "78910", + * pemFile: fs.readFileSync("foo/bar.pem"), + * }); + * ``` */ export function getAppTokenOutput(args: GetAppTokenOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getAppToken(a, opts)) diff --git a/sdk/nodejs/getBranch.ts b/sdk/nodejs/getBranch.ts index 22cecb9f..dd1bc6fa 100644 --- a/sdk/nodejs/getBranch.ts +++ b/sdk/nodejs/getBranch.ts @@ -6,6 +6,18 @@ import * as utilities from "./utilities"; /** * Use this data source to retrieve information about a repository branch. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const development = github.getBranch({ + * branch: "development", + * repository: "example", + * }); + * ``` */ export function getBranch(args: GetBranchArgs, opts?: pulumi.InvokeOptions): Promise { @@ -55,6 +67,18 @@ export interface GetBranchResult { } /** * Use this data source to retrieve information about a repository branch. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const development = github.getBranch({ + * branch: "development", + * repository: "example", + * }); + * ``` */ export function getBranchOutput(args: GetBranchOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getBranch(a, opts)) diff --git a/sdk/nodejs/getBranchProtectionRules.ts b/sdk/nodejs/getBranchProtectionRules.ts index 39a4f32f..9e201e2d 100644 --- a/sdk/nodejs/getBranchProtectionRules.ts +++ b/sdk/nodejs/getBranchProtectionRules.ts @@ -8,6 +8,17 @@ import * as utilities from "./utilities"; /** * Use this data source to retrieve a list of repository branch protection rules. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const example = github.getBranchProtectionRules({ + * repository: "example", + * }); + * ``` */ export function getBranchProtectionRules(args: GetBranchProtectionRulesArgs, opts?: pulumi.InvokeOptions): Promise { @@ -43,6 +54,17 @@ export interface GetBranchProtectionRulesResult { } /** * Use this data source to retrieve a list of repository branch protection rules. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const example = github.getBranchProtectionRules({ + * repository: "example", + * }); + * ``` */ export function getBranchProtectionRulesOutput(args: GetBranchProtectionRulesOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getBranchProtectionRules(a, opts)) diff --git a/sdk/nodejs/getCodespacesOrganizationPublicKey.ts b/sdk/nodejs/getCodespacesOrganizationPublicKey.ts index baca1560..14521beb 100644 --- a/sdk/nodejs/getCodespacesOrganizationPublicKey.ts +++ b/sdk/nodejs/getCodespacesOrganizationPublicKey.ts @@ -7,6 +7,15 @@ import * as utilities from "./utilities"; /** * Use this data source to retrieve information about a GitHub Codespaces Organization public key. This data source is required to be used with other GitHub secrets interactions. * Note that the provider `token` must have admin rights to an organization to retrieve it's Codespaces public key. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const example = github.getCodespacesOrganizationPublicKey({}); + * ``` */ export function getCodespacesOrganizationPublicKey(opts?: pulumi.InvokeOptions): Promise { @@ -35,6 +44,15 @@ export interface GetCodespacesOrganizationPublicKeyResult { /** * Use this data source to retrieve information about a GitHub Codespaces Organization public key. This data source is required to be used with other GitHub secrets interactions. * Note that the provider `token` must have admin rights to an organization to retrieve it's Codespaces public key. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const example = github.getCodespacesOrganizationPublicKey({}); + * ``` */ export function getCodespacesOrganizationPublicKeyOutput(opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(getCodespacesOrganizationPublicKey(opts)) diff --git a/sdk/nodejs/getCodespacesOrganizationSecrets.ts b/sdk/nodejs/getCodespacesOrganizationSecrets.ts index 2ebd9ec6..6ba3798b 100644 --- a/sdk/nodejs/getCodespacesOrganizationSecrets.ts +++ b/sdk/nodejs/getCodespacesOrganizationSecrets.ts @@ -8,6 +8,15 @@ import * as utilities from "./utilities"; /** * Use this data source to retrieve the list of codespaces secrets of the organization. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const example = github.getCodespacesOrganizationSecrets({}); + * ``` */ export function getCodespacesOrganizationSecrets(opts?: pulumi.InvokeOptions): Promise { @@ -31,6 +40,15 @@ export interface GetCodespacesOrganizationSecretsResult { } /** * Use this data source to retrieve the list of codespaces secrets of the organization. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const example = github.getCodespacesOrganizationSecrets({}); + * ``` */ export function getCodespacesOrganizationSecretsOutput(opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(getCodespacesOrganizationSecrets(opts)) diff --git a/sdk/nodejs/getCodespacesPublicKey.ts b/sdk/nodejs/getCodespacesPublicKey.ts index 94812158..7fa187b7 100644 --- a/sdk/nodejs/getCodespacesPublicKey.ts +++ b/sdk/nodejs/getCodespacesPublicKey.ts @@ -7,6 +7,17 @@ import * as utilities from "./utilities"; /** * Use this data source to retrieve information about a GitHub Codespaces public key. This data source is required to be used with other GitHub secrets interactions. * Note that the provider `token` must have admin rights to a repository to retrieve it's Codespaces public key. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const example = github.getCodespacesPublicKey({ + * repository: "example_repo", + * }); + * ``` */ export function getCodespacesPublicKey(args: GetCodespacesPublicKeyArgs, opts?: pulumi.InvokeOptions): Promise { @@ -47,6 +58,17 @@ export interface GetCodespacesPublicKeyResult { /** * Use this data source to retrieve information about a GitHub Codespaces public key. This data source is required to be used with other GitHub secrets interactions. * Note that the provider `token` must have admin rights to a repository to retrieve it's Codespaces public key. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const example = github.getCodespacesPublicKey({ + * repository: "example_repo", + * }); + * ``` */ export function getCodespacesPublicKeyOutput(args: GetCodespacesPublicKeyOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getCodespacesPublicKey(a, opts)) diff --git a/sdk/nodejs/getCodespacesSecrets.ts b/sdk/nodejs/getCodespacesSecrets.ts index f9eaa5d8..c5805b73 100644 --- a/sdk/nodejs/getCodespacesSecrets.ts +++ b/sdk/nodejs/getCodespacesSecrets.ts @@ -8,6 +8,20 @@ import * as utilities from "./utilities"; /** * Use this data source to retrieve the list of codespaces secrets for a GitHub repository. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const example = github.getCodespacesSecrets({ + * name: "example_repository", + * }); + * const example2 = github.getCodespacesSecrets({ + * fullName: "org/example_repository", + * }); + * ``` */ export function getCodespacesSecrets(args?: GetCodespacesSecretsArgs, opts?: pulumi.InvokeOptions): Promise { args = args || {}; @@ -53,6 +67,20 @@ export interface GetCodespacesSecretsResult { } /** * Use this data source to retrieve the list of codespaces secrets for a GitHub repository. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const example = github.getCodespacesSecrets({ + * name: "example_repository", + * }); + * const example2 = github.getCodespacesSecrets({ + * fullName: "org/example_repository", + * }); + * ``` */ export function getCodespacesSecretsOutput(args?: GetCodespacesSecretsOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getCodespacesSecrets(a, opts)) diff --git a/sdk/nodejs/getCodespacesUserPublicKey.ts b/sdk/nodejs/getCodespacesUserPublicKey.ts index 8354d949..608be6c7 100644 --- a/sdk/nodejs/getCodespacesUserPublicKey.ts +++ b/sdk/nodejs/getCodespacesUserPublicKey.ts @@ -7,6 +7,15 @@ import * as utilities from "./utilities"; /** * Use this data source to retrieve information about a GitHub Codespaces User public key. This data source is required to be used with other GitHub secrets interactions. * Note that the provider `token` must have admin rights to an user to retrieve it's Codespaces public key. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const example = github.getCodespacesUserPublicKey({}); + * ``` */ export function getCodespacesUserPublicKey(opts?: pulumi.InvokeOptions): Promise { @@ -35,6 +44,15 @@ export interface GetCodespacesUserPublicKeyResult { /** * Use this data source to retrieve information about a GitHub Codespaces User public key. This data source is required to be used with other GitHub secrets interactions. * Note that the provider `token` must have admin rights to an user to retrieve it's Codespaces public key. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const example = github.getCodespacesUserPublicKey({}); + * ``` */ export function getCodespacesUserPublicKeyOutput(opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(getCodespacesUserPublicKey(opts)) diff --git a/sdk/nodejs/getCodespacesUserSecrets.ts b/sdk/nodejs/getCodespacesUserSecrets.ts index 0659ed6a..6de7fc8e 100644 --- a/sdk/nodejs/getCodespacesUserSecrets.ts +++ b/sdk/nodejs/getCodespacesUserSecrets.ts @@ -8,6 +8,15 @@ import * as utilities from "./utilities"; /** * Use this data source to retrieve the list of codespaces secrets of the user. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const example = github.getCodespacesUserSecrets({}); + * ``` */ export function getCodespacesUserSecrets(opts?: pulumi.InvokeOptions): Promise { @@ -31,6 +40,15 @@ export interface GetCodespacesUserSecretsResult { } /** * Use this data source to retrieve the list of codespaces secrets of the user. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const example = github.getCodespacesUserSecrets({}); + * ``` */ export function getCodespacesUserSecretsOutput(opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(getCodespacesUserSecrets(opts)) diff --git a/sdk/nodejs/getCollaborators.ts b/sdk/nodejs/getCollaborators.ts index 9860903c..45452694 100644 --- a/sdk/nodejs/getCollaborators.ts +++ b/sdk/nodejs/getCollaborators.ts @@ -8,6 +8,18 @@ import * as utilities from "./utilities"; /** * Use this data source to retrieve the collaborators for a given repository. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const test = github.getCollaborators({ + * owner: "example_owner", + * repository: "example_repository", + * }); + * ``` */ export function getCollaborators(args: GetCollaboratorsArgs, opts?: pulumi.InvokeOptions): Promise { @@ -55,6 +67,18 @@ export interface GetCollaboratorsResult { } /** * Use this data source to retrieve the collaborators for a given repository. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const test = github.getCollaborators({ + * owner: "example_owner", + * repository: "example_repository", + * }); + * ``` */ export function getCollaboratorsOutput(args: GetCollaboratorsOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getCollaborators(a, opts)) diff --git a/sdk/nodejs/getDependabotOrganizationPublicKey.ts b/sdk/nodejs/getDependabotOrganizationPublicKey.ts index 6f817364..66a73cfb 100644 --- a/sdk/nodejs/getDependabotOrganizationPublicKey.ts +++ b/sdk/nodejs/getDependabotOrganizationPublicKey.ts @@ -7,6 +7,15 @@ import * as utilities from "./utilities"; /** * Use this data source to retrieve information about a GitHub Dependabot Organization public key. This data source is required to be used with other GitHub secrets interactions. * Note that the provider `token` must have admin rights to an organization to retrieve it's Dependabot public key. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const example = github.getDependabotOrganizationPublicKey({}); + * ``` */ export function getDependabotOrganizationPublicKey(opts?: pulumi.InvokeOptions): Promise { @@ -35,6 +44,15 @@ export interface GetDependabotOrganizationPublicKeyResult { /** * Use this data source to retrieve information about a GitHub Dependabot Organization public key. This data source is required to be used with other GitHub secrets interactions. * Note that the provider `token` must have admin rights to an organization to retrieve it's Dependabot public key. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const example = github.getDependabotOrganizationPublicKey({}); + * ``` */ export function getDependabotOrganizationPublicKeyOutput(opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(getDependabotOrganizationPublicKey(opts)) diff --git a/sdk/nodejs/getDependabotOrganizationSecrets.ts b/sdk/nodejs/getDependabotOrganizationSecrets.ts index d611fcf4..6f0f0c94 100644 --- a/sdk/nodejs/getDependabotOrganizationSecrets.ts +++ b/sdk/nodejs/getDependabotOrganizationSecrets.ts @@ -8,6 +8,15 @@ import * as utilities from "./utilities"; /** * Use this data source to retrieve the list of dependabot secrets of the organization. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const example = github.getDependabotOrganizationSecrets({}); + * ``` */ export function getDependabotOrganizationSecrets(opts?: pulumi.InvokeOptions): Promise { @@ -31,6 +40,15 @@ export interface GetDependabotOrganizationSecretsResult { } /** * Use this data source to retrieve the list of dependabot secrets of the organization. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const example = github.getDependabotOrganizationSecrets({}); + * ``` */ export function getDependabotOrganizationSecretsOutput(opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(getDependabotOrganizationSecrets(opts)) diff --git a/sdk/nodejs/getDependabotSecrets.ts b/sdk/nodejs/getDependabotSecrets.ts index a1e2365a..11efbe7e 100644 --- a/sdk/nodejs/getDependabotSecrets.ts +++ b/sdk/nodejs/getDependabotSecrets.ts @@ -8,6 +8,17 @@ import * as utilities from "./utilities"; /** * Use this data source to retrieve the list of dependabot secrets for a GitHub repository. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const example = github.getDependabotSecrets({ + * name: "example", + * }); + * ``` */ export function getDependabotSecrets(args?: GetDependabotSecretsArgs, opts?: pulumi.InvokeOptions): Promise { args = args || {}; @@ -53,6 +64,17 @@ export interface GetDependabotSecretsResult { } /** * Use this data source to retrieve the list of dependabot secrets for a GitHub repository. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const example = github.getDependabotSecrets({ + * name: "example", + * }); + * ``` */ export function getDependabotSecretsOutput(args?: GetDependabotSecretsOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getDependabotSecrets(a, opts)) diff --git a/sdk/nodejs/getEnterprise.ts b/sdk/nodejs/getEnterprise.ts index cccfe4f4..a80194cf 100644 --- a/sdk/nodejs/getEnterprise.ts +++ b/sdk/nodejs/getEnterprise.ts @@ -6,6 +6,17 @@ import * as utilities from "./utilities"; /** * Use this data source to retrieve basic information about a GitHub enterprise. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const example = github.getEnterprise({ + * slug: "example-co", + * }); + * ``` */ export function getEnterprise(args: GetEnterpriseArgs, opts?: pulumi.InvokeOptions): Promise { @@ -56,6 +67,17 @@ export interface GetEnterpriseResult { } /** * Use this data source to retrieve basic information about a GitHub enterprise. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const example = github.getEnterprise({ + * slug: "example-co", + * }); + * ``` */ export function getEnterpriseOutput(args: GetEnterpriseOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getEnterprise(a, opts)) diff --git a/sdk/nodejs/getExternalGroups.ts b/sdk/nodejs/getExternalGroups.ts index b43686cc..ce0fab7b 100644 --- a/sdk/nodejs/getExternalGroups.ts +++ b/sdk/nodejs/getExternalGroups.ts @@ -8,6 +8,17 @@ import * as utilities from "./utilities"; /** * Use this data source to retrieve external groups belonging to an organization. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const exampleExternalGroups = github.getExternalGroups({}); + * const localGroups = exampleExternalGroups; + * export const groups = localGroups; + * ``` */ export function getExternalGroups(opts?: pulumi.InvokeOptions): Promise { @@ -31,6 +42,17 @@ export interface GetExternalGroupsResult { } /** * Use this data source to retrieve external groups belonging to an organization. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const exampleExternalGroups = github.getExternalGroups({}); + * const localGroups = exampleExternalGroups; + * export const groups = localGroups; + * ``` */ export function getExternalGroupsOutput(opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(getExternalGroups(opts)) diff --git a/sdk/nodejs/getGithubApp.ts b/sdk/nodejs/getGithubApp.ts index d9587343..25628904 100644 --- a/sdk/nodejs/getGithubApp.ts +++ b/sdk/nodejs/getGithubApp.ts @@ -6,6 +6,17 @@ import * as utilities from "./utilities"; /** * Use this data source to retrieve information about an app. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const foobar = github.getGithubApp({ + * slug: "foobar", + * }); + * ``` */ export function getGithubApp(args: GetGithubAppArgs, opts?: pulumi.InvokeOptions): Promise { @@ -49,6 +60,17 @@ export interface GetGithubAppResult { } /** * Use this data source to retrieve information about an app. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const foobar = github.getGithubApp({ + * slug: "foobar", + * }); + * ``` */ export function getGithubAppOutput(args: GetGithubAppOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getGithubApp(a, opts)) diff --git a/sdk/nodejs/getIpRanges.ts b/sdk/nodejs/getIpRanges.ts index e82c5721..1f157320 100644 --- a/sdk/nodejs/getIpRanges.ts +++ b/sdk/nodejs/getIpRanges.ts @@ -6,6 +6,15 @@ import * as utilities from "./utilities"; /** * Use this data source to retrieve information about GitHub's IP addresses. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const test = github.getIpRanges({}); + * ``` */ export function getIpRanges(opts?: pulumi.InvokeOptions): Promise { @@ -121,6 +130,15 @@ export interface GetIpRangesResult { } /** * Use this data source to retrieve information about GitHub's IP addresses. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const test = github.getIpRanges({}); + * ``` */ export function getIpRangesOutput(opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(getIpRanges(opts)) diff --git a/sdk/nodejs/getMembership.ts b/sdk/nodejs/getMembership.ts index e81042ca..6037fd29 100644 --- a/sdk/nodejs/getMembership.ts +++ b/sdk/nodejs/getMembership.ts @@ -9,6 +9,17 @@ import * as utilities from "./utilities"; * as what role they have within it. * If the user's membership in the organization is pending their acceptance of an invite, * the role they would have once they accept will be returned. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const membershipForSomeUser = github.getMembership({ + * username: "SomeUser", + * }); + * ``` */ export function getMembership(args: GetMembershipArgs, opts?: pulumi.InvokeOptions): Promise { @@ -64,6 +75,17 @@ export interface GetMembershipResult { * as what role they have within it. * If the user's membership in the organization is pending their acceptance of an invite, * the role they would have once they accept will be returned. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const membershipForSomeUser = github.getMembership({ + * username: "SomeUser", + * }); + * ``` */ export function getMembershipOutput(args: GetMembershipOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getMembership(a, opts)) diff --git a/sdk/nodejs/getOrganization.ts b/sdk/nodejs/getOrganization.ts index daec4c5c..c9e7d75b 100644 --- a/sdk/nodejs/getOrganization.ts +++ b/sdk/nodejs/getOrganization.ts @@ -6,6 +6,17 @@ import * as utilities from "./utilities"; /** * Use this data source to retrieve basic information about a GitHub Organization. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const example = github.getOrganization({ + * name: "github", + * }); + * ``` */ export function getOrganization(args: GetOrganizationArgs, opts?: pulumi.InvokeOptions): Promise { @@ -146,6 +157,17 @@ export interface GetOrganizationResult { } /** * Use this data source to retrieve basic information about a GitHub Organization. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const example = github.getOrganization({ + * name: "github", + * }); + * ``` */ export function getOrganizationOutput(args: GetOrganizationOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getOrganization(a, opts)) diff --git a/sdk/nodejs/getOrganizationCustomRole.ts b/sdk/nodejs/getOrganizationCustomRole.ts index 80eed714..26ace55f 100644 --- a/sdk/nodejs/getOrganizationCustomRole.ts +++ b/sdk/nodejs/getOrganizationCustomRole.ts @@ -8,6 +8,17 @@ import * as utilities from "./utilities"; * Use this data source to retrieve information about a custom role in a GitHub Organization. * * > Note: Custom roles are currently only available in GitHub Enterprise Cloud. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const example = github.getOrganizationCustomRole({ + * name: "example", + * }); + * ``` */ export function getOrganizationCustomRole(args: GetOrganizationCustomRoleArgs, opts?: pulumi.InvokeOptions): Promise { @@ -53,6 +64,17 @@ export interface GetOrganizationCustomRoleResult { * Use this data source to retrieve information about a custom role in a GitHub Organization. * * > Note: Custom roles are currently only available in GitHub Enterprise Cloud. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const example = github.getOrganizationCustomRole({ + * name: "example", + * }); + * ``` */ export function getOrganizationCustomRoleOutput(args: GetOrganizationCustomRoleOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getOrganizationCustomRole(a, opts)) diff --git a/sdk/nodejs/getOrganizationExternalIdentities.ts b/sdk/nodejs/getOrganizationExternalIdentities.ts index 83cd50d7..af7307ab 100644 --- a/sdk/nodejs/getOrganizationExternalIdentities.ts +++ b/sdk/nodejs/getOrganizationExternalIdentities.ts @@ -9,6 +9,15 @@ import * as utilities from "./utilities"; /** * Use this data source to retrieve each organization member's SAML or SCIM user * attributes. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const all = github.getOrganizationExternalIdentities({}); + * ``` */ export function getOrganizationExternalIdentities(opts?: pulumi.InvokeOptions): Promise { @@ -33,6 +42,15 @@ export interface GetOrganizationExternalIdentitiesResult { /** * Use this data source to retrieve each organization member's SAML or SCIM user * attributes. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const all = github.getOrganizationExternalIdentities({}); + * ``` */ export function getOrganizationExternalIdentitiesOutput(opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(getOrganizationExternalIdentities(opts)) diff --git a/sdk/nodejs/getOrganizationIpAllowList.ts b/sdk/nodejs/getOrganizationIpAllowList.ts index 1a0f0c20..23f23a0a 100644 --- a/sdk/nodejs/getOrganizationIpAllowList.ts +++ b/sdk/nodejs/getOrganizationIpAllowList.ts @@ -10,6 +10,15 @@ import * as utilities from "./utilities"; * Use this data source to retrieve information about the IP allow list of an organization. * The allow list for IP addresses will block access to private resources via the web, API, * and Git from any IP addresses that are not on the allow list. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const all = github.getOrganizationIpAllowList({}); + * ``` */ export function getOrganizationIpAllowList(opts?: pulumi.InvokeOptions): Promise { @@ -36,6 +45,15 @@ export interface GetOrganizationIpAllowListResult { * Use this data source to retrieve information about the IP allow list of an organization. * The allow list for IP addresses will block access to private resources via the web, API, * and Git from any IP addresses that are not on the allow list. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const all = github.getOrganizationIpAllowList({}); + * ``` */ export function getOrganizationIpAllowListOutput(opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(getOrganizationIpAllowList(opts)) diff --git a/sdk/nodejs/getOrganizationTeamSyncGroups.ts b/sdk/nodejs/getOrganizationTeamSyncGroups.ts index f5db9d89..2c32d899 100644 --- a/sdk/nodejs/getOrganizationTeamSyncGroups.ts +++ b/sdk/nodejs/getOrganizationTeamSyncGroups.ts @@ -8,6 +8,15 @@ import * as utilities from "./utilities"; /** * Use this data source to retrieve the identity provider (IdP) groups for an organization. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const test = github.getOrganizationTeamSyncGroups({}); + * ``` */ export function getOrganizationTeamSyncGroups(opts?: pulumi.InvokeOptions): Promise { @@ -31,6 +40,15 @@ export interface GetOrganizationTeamSyncGroupsResult { } /** * Use this data source to retrieve the identity provider (IdP) groups for an organization. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const test = github.getOrganizationTeamSyncGroups({}); + * ``` */ export function getOrganizationTeamSyncGroupsOutput(opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(getOrganizationTeamSyncGroups(opts)) diff --git a/sdk/nodejs/getOrganizationTeams.ts b/sdk/nodejs/getOrganizationTeams.ts index 656cfd50..7f9848b1 100644 --- a/sdk/nodejs/getOrganizationTeams.ts +++ b/sdk/nodejs/getOrganizationTeams.ts @@ -8,6 +8,28 @@ import * as utilities from "./utilities"; /** * Use this data source to retrieve information about all GitHub teams in an organization. + * + * ## Example Usage + * + * To retrieve *all* teams of the organization: + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const all = github.getOrganizationTeams({}); + * ``` + * + * To retrieve only the team's at the root of the organization: + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const rootTeams = github.getOrganizationTeams({ + * rootTeamsOnly: true, + * }); + * ``` */ export function getOrganizationTeams(args?: GetOrganizationTeamsArgs, opts?: pulumi.InvokeOptions): Promise { args = args || {}; @@ -65,6 +87,28 @@ export interface GetOrganizationTeamsResult { } /** * Use this data source to retrieve information about all GitHub teams in an organization. + * + * ## Example Usage + * + * To retrieve *all* teams of the organization: + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const all = github.getOrganizationTeams({}); + * ``` + * + * To retrieve only the team's at the root of the organization: + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const rootTeams = github.getOrganizationTeams({ + * rootTeamsOnly: true, + * }); + * ``` */ export function getOrganizationTeamsOutput(args?: GetOrganizationTeamsOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getOrganizationTeams(a, opts)) diff --git a/sdk/nodejs/getOrganizationWebhooks.ts b/sdk/nodejs/getOrganizationWebhooks.ts index a91e8ab8..0d6c1150 100644 --- a/sdk/nodejs/getOrganizationWebhooks.ts +++ b/sdk/nodejs/getOrganizationWebhooks.ts @@ -8,6 +8,17 @@ import * as utilities from "./utilities"; /** * Use this data source to retrieve all webhooks of the organization. + * + * ## Example Usage + * + * To retrieve *all* webhooks of the organization: + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const all = github.getOrganizationWebhooks({}); + * ``` */ export function getOrganizationWebhooks(opts?: pulumi.InvokeOptions): Promise { @@ -32,6 +43,17 @@ export interface GetOrganizationWebhooksResult { } /** * Use this data source to retrieve all webhooks of the organization. + * + * ## Example Usage + * + * To retrieve *all* webhooks of the organization: + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const all = github.getOrganizationWebhooks({}); + * ``` */ export function getOrganizationWebhooksOutput(opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(getOrganizationWebhooks(opts)) diff --git a/sdk/nodejs/getRef.ts b/sdk/nodejs/getRef.ts index 4ba40820..4f60a652 100644 --- a/sdk/nodejs/getRef.ts +++ b/sdk/nodejs/getRef.ts @@ -6,6 +6,19 @@ import * as utilities from "./utilities"; /** * Use this data source to retrieve information about a repository ref. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const development = github.getRef({ + * owner: "example", + * ref: "heads/development", + * repository: "example", + * }); + * ``` */ export function getRef(args: GetRefArgs, opts?: pulumi.InvokeOptions): Promise { @@ -57,6 +70,19 @@ export interface GetRefResult { } /** * Use this data source to retrieve information about a repository ref. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const development = github.getRef({ + * owner: "example", + * ref: "heads/development", + * repository: "example", + * }); + * ``` */ export function getRefOutput(args: GetRefOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getRef(a, opts)) diff --git a/sdk/nodejs/getRepositories.ts b/sdk/nodejs/getRepositories.ts index 7aae705a..250d94fe 100644 --- a/sdk/nodejs/getRepositories.ts +++ b/sdk/nodejs/getRepositories.ts @@ -9,6 +9,18 @@ import * as utilities from "./utilities"; * [as documented in official API docs](https://developer.github.com/v3/search/#about-the-search-api). * * Use this data source to retrieve a list of GitHub repositories using a search query. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const example = github.getRepositories({ + * includeRepoId: true, + * query: "org:hashicorp language:Go", + * }); + * ``` */ export function getRepositories(args: GetRepositoriesArgs, opts?: pulumi.InvokeOptions): Promise { @@ -67,6 +79,18 @@ export interface GetRepositoriesResult { * [as documented in official API docs](https://developer.github.com/v3/search/#about-the-search-api). * * Use this data source to retrieve a list of GitHub repositories using a search query. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const example = github.getRepositories({ + * includeRepoId: true, + * query: "org:hashicorp language:Go", + * }); + * ``` */ export function getRepositoriesOutput(args: GetRepositoriesOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getRepositories(a, opts)) diff --git a/sdk/nodejs/getRepository.ts b/sdk/nodejs/getRepository.ts index 5007eb1d..0da59331 100644 --- a/sdk/nodejs/getRepository.ts +++ b/sdk/nodejs/getRepository.ts @@ -8,6 +8,17 @@ import * as utilities from "./utilities"; /** * Use this data source to retrieve information about a GitHub repository. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const example = github.getRepository({ + * fullName: "hashicorp/terraform", + * }); + * ``` */ export function getRepository(args?: GetRepositoryArgs, opts?: pulumi.InvokeOptions): Promise { args = args || {}; @@ -184,6 +195,17 @@ export interface GetRepositoryResult { } /** * Use this data source to retrieve information about a GitHub repository. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const example = github.getRepository({ + * fullName: "hashicorp/terraform", + * }); + * ``` */ export function getRepositoryOutput(args?: GetRepositoryOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getRepository(a, opts)) diff --git a/sdk/nodejs/getRepositoryAutolinkReferences.ts b/sdk/nodejs/getRepositoryAutolinkReferences.ts index de35f9bd..0b3a9deb 100644 --- a/sdk/nodejs/getRepositoryAutolinkReferences.ts +++ b/sdk/nodejs/getRepositoryAutolinkReferences.ts @@ -8,6 +8,17 @@ import * as utilities from "./utilities"; /** * Use this data source to retrieve autolink references for a repository. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const example = github.getRepositoryAutolinkReferences({ + * repository: "example-repository", + * }); + * ``` */ export function getRepositoryAutolinkReferences(args: GetRepositoryAutolinkReferencesArgs, opts?: pulumi.InvokeOptions): Promise { @@ -43,6 +54,17 @@ export interface GetRepositoryAutolinkReferencesResult { } /** * Use this data source to retrieve autolink references for a repository. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const example = github.getRepositoryAutolinkReferences({ + * repository: "example-repository", + * }); + * ``` */ export function getRepositoryAutolinkReferencesOutput(args: GetRepositoryAutolinkReferencesOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getRepositoryAutolinkReferences(a, opts)) diff --git a/sdk/nodejs/getRepositoryBranches.ts b/sdk/nodejs/getRepositoryBranches.ts index 156b6e80..06fe0dbd 100644 --- a/sdk/nodejs/getRepositoryBranches.ts +++ b/sdk/nodejs/getRepositoryBranches.ts @@ -8,6 +8,17 @@ import * as utilities from "./utilities"; /** * Use this data source to retrieve information about branches in a repository. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const example = github.getRepositoryBranches({ + * repository: "example-repository", + * }); + * ``` */ export function getRepositoryBranches(args: GetRepositoryBranchesArgs, opts?: pulumi.InvokeOptions): Promise { @@ -55,6 +66,17 @@ export interface GetRepositoryBranchesResult { } /** * Use this data source to retrieve information about branches in a repository. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const example = github.getRepositoryBranches({ + * repository: "example-repository", + * }); + * ``` */ export function getRepositoryBranchesOutput(args: GetRepositoryBranchesOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getRepositoryBranches(a, opts)) diff --git a/sdk/nodejs/getRepositoryDeployKeys.ts b/sdk/nodejs/getRepositoryDeployKeys.ts index 37b8acd7..1b02b3fd 100644 --- a/sdk/nodejs/getRepositoryDeployKeys.ts +++ b/sdk/nodejs/getRepositoryDeployKeys.ts @@ -8,6 +8,17 @@ import * as utilities from "./utilities"; /** * Use this data source to retrieve all deploy keys of a repository. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const example = github.getRepositoryDeployKeys({ + * repository: "example-repository", + * }); + * ``` */ export function getRepositoryDeployKeys(args: GetRepositoryDeployKeysArgs, opts?: pulumi.InvokeOptions): Promise { @@ -43,6 +54,17 @@ export interface GetRepositoryDeployKeysResult { } /** * Use this data source to retrieve all deploy keys of a repository. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const example = github.getRepositoryDeployKeys({ + * repository: "example-repository", + * }); + * ``` */ export function getRepositoryDeployKeysOutput(args: GetRepositoryDeployKeysOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getRepositoryDeployKeys(a, opts)) diff --git a/sdk/nodejs/getRepositoryDeploymentBranchPolicies.ts b/sdk/nodejs/getRepositoryDeploymentBranchPolicies.ts index be174f13..038b4fff 100644 --- a/sdk/nodejs/getRepositoryDeploymentBranchPolicies.ts +++ b/sdk/nodejs/getRepositoryDeploymentBranchPolicies.ts @@ -8,6 +8,18 @@ import * as utilities from "./utilities"; /** * Use this data source to retrieve deployment branch policies for a repository / environment. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const example = github.getRepositoryDeploymentBranchPolicies({ + * environmentName: "env_name", + * repository: "example-repository", + * }); + * ``` */ export function getRepositoryDeploymentBranchPolicies(args: GetRepositoryDeploymentBranchPoliciesArgs, opts?: pulumi.InvokeOptions): Promise { @@ -49,6 +61,18 @@ export interface GetRepositoryDeploymentBranchPoliciesResult { } /** * Use this data source to retrieve deployment branch policies for a repository / environment. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const example = github.getRepositoryDeploymentBranchPolicies({ + * environmentName: "env_name", + * repository: "example-repository", + * }); + * ``` */ export function getRepositoryDeploymentBranchPoliciesOutput(args: GetRepositoryDeploymentBranchPoliciesOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getRepositoryDeploymentBranchPolicies(a, opts)) diff --git a/sdk/nodejs/getRepositoryEnvironments.ts b/sdk/nodejs/getRepositoryEnvironments.ts index 6fe174d5..73af07e3 100644 --- a/sdk/nodejs/getRepositoryEnvironments.ts +++ b/sdk/nodejs/getRepositoryEnvironments.ts @@ -8,6 +8,17 @@ import * as utilities from "./utilities"; /** * Use this data source to retrieve information about environments for a repository. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const example = github.getRepositoryEnvironments({ + * repository: "example-repository", + * }); + * ``` */ export function getRepositoryEnvironments(args: GetRepositoryEnvironmentsArgs, opts?: pulumi.InvokeOptions): Promise { @@ -43,6 +54,17 @@ export interface GetRepositoryEnvironmentsResult { } /** * Use this data source to retrieve information about environments for a repository. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const example = github.getRepositoryEnvironments({ + * repository: "example-repository", + * }); + * ``` */ export function getRepositoryEnvironmentsOutput(args: GetRepositoryEnvironmentsOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getRepositoryEnvironments(a, opts)) diff --git a/sdk/nodejs/getRepositoryFile.ts b/sdk/nodejs/getRepositoryFile.ts index b6600f16..0b9ab1cd 100644 --- a/sdk/nodejs/getRepositoryFile.ts +++ b/sdk/nodejs/getRepositoryFile.ts @@ -7,6 +7,19 @@ import * as utilities from "./utilities"; /** * This data source allows you to read files within a * GitHub repository. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const foo = github.getRepositoryFile({ + * repository: github_repository.foo.name, + * branch: "main", + * file: ".gitignore", + * }); + * ``` */ export function getRepositoryFile(args: GetRepositoryFileArgs, opts?: pulumi.InvokeOptions): Promise { @@ -79,6 +92,19 @@ export interface GetRepositoryFileResult { /** * This data source allows you to read files within a * GitHub repository. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const foo = github.getRepositoryFile({ + * repository: github_repository.foo.name, + * branch: "main", + * file: ".gitignore", + * }); + * ``` */ export function getRepositoryFileOutput(args: GetRepositoryFileOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getRepositoryFile(a, opts)) diff --git a/sdk/nodejs/getRepositoryMilestone.ts b/sdk/nodejs/getRepositoryMilestone.ts index f9b490eb..266b845f 100644 --- a/sdk/nodejs/getRepositoryMilestone.ts +++ b/sdk/nodejs/getRepositoryMilestone.ts @@ -6,6 +6,19 @@ import * as utilities from "./utilities"; /** * Use this data source to retrieve information about a specific GitHub milestone in a repository. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const example = github.getRepositoryMilestone({ + * number: 1, + * owner: "example-owner", + * repository: "example-repository", + * }); + * ``` */ export function getRepositoryMilestone(args: GetRepositoryMilestoneArgs, opts?: pulumi.InvokeOptions): Promise { @@ -65,6 +78,19 @@ export interface GetRepositoryMilestoneResult { } /** * Use this data source to retrieve information about a specific GitHub milestone in a repository. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const example = github.getRepositoryMilestone({ + * number: 1, + * owner: "example-owner", + * repository: "example-repository", + * }); + * ``` */ export function getRepositoryMilestoneOutput(args: GetRepositoryMilestoneOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getRepositoryMilestone(a, opts)) diff --git a/sdk/nodejs/getRepositoryPullRequest.ts b/sdk/nodejs/getRepositoryPullRequest.ts index d65049f0..9104aa85 100644 --- a/sdk/nodejs/getRepositoryPullRequest.ts +++ b/sdk/nodejs/getRepositoryPullRequest.ts @@ -6,6 +6,18 @@ import * as utilities from "./utilities"; /** * Use this data source to retrieve information about a specific GitHub Pull Request in a repository. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const example = github.getRepositoryPullRequest({ + * baseRepository: "example_repository", + * number: 1, + * }); + * ``` */ export function getRepositoryPullRequest(args: GetRepositoryPullRequestArgs, opts?: pulumi.InvokeOptions): Promise { @@ -106,6 +118,18 @@ export interface GetRepositoryPullRequestResult { } /** * Use this data source to retrieve information about a specific GitHub Pull Request in a repository. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const example = github.getRepositoryPullRequest({ + * baseRepository: "example_repository", + * number: 1, + * }); + * ``` */ export function getRepositoryPullRequestOutput(args: GetRepositoryPullRequestOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getRepositoryPullRequest(a, opts)) diff --git a/sdk/nodejs/getRepositoryPullRequests.ts b/sdk/nodejs/getRepositoryPullRequests.ts index 518883ea..e5844fdc 100644 --- a/sdk/nodejs/getRepositoryPullRequests.ts +++ b/sdk/nodejs/getRepositoryPullRequests.ts @@ -8,6 +8,21 @@ import * as utilities from "./utilities"; /** * Use this data source to retrieve information about multiple GitHub Pull Requests in a repository. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const example = github.getRepositoryPullRequests({ + * baseRef: "main", + * baseRepository: "example-repository", + * sortBy: "updated", + * sortDirection: "desc", + * state: "open", + * }); + * ``` */ export function getRepositoryPullRequests(args: GetRepositoryPullRequestsArgs, opts?: pulumi.InvokeOptions): Promise { @@ -88,6 +103,21 @@ export interface GetRepositoryPullRequestsResult { } /** * Use this data source to retrieve information about multiple GitHub Pull Requests in a repository. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const example = github.getRepositoryPullRequests({ + * baseRef: "main", + * baseRepository: "example-repository", + * sortBy: "updated", + * sortDirection: "desc", + * state: "open", + * }); + * ``` */ export function getRepositoryPullRequestsOutput(args: GetRepositoryPullRequestsOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getRepositoryPullRequests(a, opts)) diff --git a/sdk/nodejs/getRepositoryTeams.ts b/sdk/nodejs/getRepositoryTeams.ts index 3d167098..6c799a81 100644 --- a/sdk/nodejs/getRepositoryTeams.ts +++ b/sdk/nodejs/getRepositoryTeams.ts @@ -8,6 +8,17 @@ import * as utilities from "./utilities"; /** * Use this data source to retrieve the list of teams which have access to a GitHub repository. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const example = github.getRepositoryTeams({ + * name: "example", + * }); + * ``` */ export function getRepositoryTeams(args?: GetRepositoryTeamsArgs, opts?: pulumi.InvokeOptions): Promise { args = args || {}; @@ -53,6 +64,17 @@ export interface GetRepositoryTeamsResult { } /** * Use this data source to retrieve the list of teams which have access to a GitHub repository. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const example = github.getRepositoryTeams({ + * name: "example", + * }); + * ``` */ export function getRepositoryTeamsOutput(args?: GetRepositoryTeamsOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getRepositoryTeams(a, opts)) diff --git a/sdk/nodejs/getRepositoryWebhooks.ts b/sdk/nodejs/getRepositoryWebhooks.ts index b2b8e25d..7afc01b0 100644 --- a/sdk/nodejs/getRepositoryWebhooks.ts +++ b/sdk/nodejs/getRepositoryWebhooks.ts @@ -8,6 +8,19 @@ import * as utilities from "./utilities"; /** * Use this data source to retrieve webhooks for a given repository. + * + * ## Example Usage + * + * To retrieve webhooks of a repository: + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const repo = github.getRepositoryWebhooks({ + * repository: "foo", + * }); + * ``` */ export function getRepositoryWebhooks(args: GetRepositoryWebhooksArgs, opts?: pulumi.InvokeOptions): Promise { @@ -41,6 +54,19 @@ export interface GetRepositoryWebhooksResult { } /** * Use this data source to retrieve webhooks for a given repository. + * + * ## Example Usage + * + * To retrieve webhooks of a repository: + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const repo = github.getRepositoryWebhooks({ + * repository: "foo", + * }); + * ``` */ export function getRepositoryWebhooksOutput(args: GetRepositoryWebhooksOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getRepositoryWebhooks(a, opts)) diff --git a/sdk/nodejs/getRestApi.ts b/sdk/nodejs/getRestApi.ts index a7d3ae1f..3a544075 100644 --- a/sdk/nodejs/getRestApi.ts +++ b/sdk/nodejs/getRestApi.ts @@ -6,6 +6,17 @@ import * as utilities from "./utilities"; /** * Use this data source to retrieve information about a GitHub resource through REST API. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const example = github.getRestApi({ + * endpoint: "repos/example_repo/git/refs/heads/main", + * }); + * ``` */ export function getRestApi(args: GetRestApiArgs, opts?: pulumi.InvokeOptions): Promise { @@ -53,6 +64,17 @@ export interface GetRestApiResult { } /** * Use this data source to retrieve information about a GitHub resource through REST API. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const example = github.getRestApi({ + * endpoint: "repos/example_repo/git/refs/heads/main", + * }); + * ``` */ export function getRestApiOutput(args: GetRestApiOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getRestApi(a, opts)) diff --git a/sdk/nodejs/getSshKeys.ts b/sdk/nodejs/getSshKeys.ts index 364e1da8..d8d80ef0 100644 --- a/sdk/nodejs/getSshKeys.ts +++ b/sdk/nodejs/getSshKeys.ts @@ -6,6 +6,15 @@ import * as utilities from "./utilities"; /** * Use this data source to retrieve information about GitHub's SSH keys. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const test = github.getSshKeys({}); + * ``` */ export function getSshKeys(opts?: pulumi.InvokeOptions): Promise { @@ -29,6 +38,15 @@ export interface GetSshKeysResult { } /** * Use this data source to retrieve information about GitHub's SSH keys. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const test = github.getSshKeys({}); + * ``` */ export function getSshKeysOutput(opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(getSshKeys(opts)) diff --git a/sdk/nodejs/getTeam.ts b/sdk/nodejs/getTeam.ts index 0d517884..756ce8f7 100644 --- a/sdk/nodejs/getTeam.ts +++ b/sdk/nodejs/getTeam.ts @@ -8,6 +8,17 @@ import * as utilities from "./utilities"; /** * Use this data source to retrieve information about a GitHub team. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const example = github.getTeam({ + * slug: "example", + * }); + * ``` */ export function getTeam(args: GetTeamArgs, opts?: pulumi.InvokeOptions): Promise { @@ -89,6 +100,17 @@ export interface GetTeamResult { } /** * Use this data source to retrieve information about a GitHub team. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const example = github.getTeam({ + * slug: "example", + * }); + * ``` */ export function getTeamOutput(args: GetTeamOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getTeam(a, opts)) diff --git a/sdk/nodejs/getTree.ts b/sdk/nodejs/getTree.ts index e06238b1..872e4085 100644 --- a/sdk/nodejs/getTree.ts +++ b/sdk/nodejs/getTree.ts @@ -8,6 +8,27 @@ import * as utilities from "./utilities"; /** * Use this data source to retrieve information about a single tree. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const thisRepository = github.getRepository({ + * name: "example", + * }); + * const thisBranch = Promise.all([thisRepository, thisRepository]).then(([thisRepository, thisRepository1]) => github.getBranch({ + * branch: thisRepository.defaultBranch, + * repository: thisRepository1.name, + * })); + * const thisTree = Promise.all([thisRepository, thisBranch]).then(([thisRepository, thisBranch]) => github.getTree({ + * recursive: false, + * repository: thisRepository.name, + * treeSha: thisBranch.sha, + * })); + * export const entries = thisTree.then(thisTree => thisTree.entries); + * ``` */ export function getTree(args: GetTreeArgs, opts?: pulumi.InvokeOptions): Promise { @@ -55,6 +76,27 @@ export interface GetTreeResult { } /** * Use this data source to retrieve information about a single tree. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const thisRepository = github.getRepository({ + * name: "example", + * }); + * const thisBranch = Promise.all([thisRepository, thisRepository]).then(([thisRepository, thisRepository1]) => github.getBranch({ + * branch: thisRepository.defaultBranch, + * repository: thisRepository1.name, + * })); + * const thisTree = Promise.all([thisRepository, thisBranch]).then(([thisRepository, thisBranch]) => github.getTree({ + * recursive: false, + * repository: thisRepository.name, + * treeSha: thisBranch.sha, + * })); + * export const entries = thisTree.then(thisTree => thisTree.entries); + * ``` */ export function getTreeOutput(args: GetTreeOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getTree(a, opts)) diff --git a/sdk/nodejs/getUser.ts b/sdk/nodejs/getUser.ts index 9de9c506..0a748b47 100644 --- a/sdk/nodejs/getUser.ts +++ b/sdk/nodejs/getUser.ts @@ -6,6 +6,21 @@ import * as utilities from "./utilities"; /** * Use this data source to retrieve information about a GitHub user. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const example = github.getUser({ + * username: "example", + * }); + * const current = github.getUser({ + * username: "", + * }); + * export const currentGithubLogin = current.then(current => current.login); + * ``` */ export function getUser(args: GetUserArgs, opts?: pulumi.InvokeOptions): Promise { @@ -117,6 +132,21 @@ export interface GetUserResult { } /** * Use this data source to retrieve information about a GitHub user. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const example = github.getUser({ + * username: "example", + * }); + * const current = github.getUser({ + * username: "", + * }); + * export const currentGithubLogin = current.then(current => current.login); + * ``` */ export function getUserOutput(args: GetUserOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getUser(a, opts)) diff --git a/sdk/nodejs/getUserExternalIdentity.ts b/sdk/nodejs/getUserExternalIdentity.ts index 577245c2..51e3d1e5 100644 --- a/sdk/nodejs/getUserExternalIdentity.ts +++ b/sdk/nodejs/getUserExternalIdentity.ts @@ -7,6 +7,17 @@ import * as utilities from "./utilities"; /** * Use this data source to retrieve a specific organization member's SAML or SCIM user * attributes. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const exampleUser = github.getUserExternalIdentity({ + * username: "example-user", + * }); + * ``` */ export function getUserExternalIdentity(args: GetUserExternalIdentityArgs, opts?: pulumi.InvokeOptions): Promise { @@ -56,6 +67,17 @@ export interface GetUserExternalIdentityResult { /** * Use this data source to retrieve a specific organization member's SAML or SCIM user * attributes. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const exampleUser = github.getUserExternalIdentity({ + * username: "example-user", + * }); + * ``` */ export function getUserExternalIdentityOutput(args: GetUserExternalIdentityOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getUserExternalIdentity(a, opts)) diff --git a/sdk/nodejs/getUsers.ts b/sdk/nodejs/getUsers.ts index 9af372c5..7b84e052 100644 --- a/sdk/nodejs/getUsers.ts +++ b/sdk/nodejs/getUsers.ts @@ -6,6 +6,23 @@ import * as utilities from "./utilities"; /** * Use this data source to retrieve information about multiple GitHub users at once. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const example = github.getUsers({ + * usernames: [ + * "example1", + * "example2", + * "example3", + * ], + * }); + * export const validUsers = example.then(example => example.logins); + * export const invalidUsers = example.then(example => example.unknownLogins); + * ``` */ export function getUsers(args: GetUsersArgs, opts?: pulumi.InvokeOptions): Promise { @@ -53,6 +70,23 @@ export interface GetUsersResult { } /** * Use this data source to retrieve information about multiple GitHub users at once. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const example = github.getUsers({ + * usernames: [ + * "example1", + * "example2", + * "example3", + * ], + * }); + * export const validUsers = example.then(example => example.logins); + * export const invalidUsers = example.then(example => example.unknownLogins); + * ``` */ export function getUsersOutput(args: GetUsersOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getUsers(a, opts)) diff --git a/sdk/nodejs/issue.ts b/sdk/nodejs/issue.ts index c6e53b31..220ff63c 100644 --- a/sdk/nodejs/issue.ts +++ b/sdk/nodejs/issue.ts @@ -10,6 +10,55 @@ import * as utilities from "./utilities"; * This resource allows you to create and manage issue within your * GitHub repository. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * // Create a simple issue + * const testRepository = new github.Repository("testRepository", { + * autoInit: true, + * hasIssues: true, + * }); + * const testIssue = new github.Issue("testIssue", { + * repository: testRepository.name, + * title: "My issue title", + * body: "The body of my issue", + * }); + * ``` + * ### With Milestone And Project Assignment + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * // Create an issue with milestone and project assignment + * const testRepository = new github.Repository("testRepository", { + * autoInit: true, + * hasIssues: true, + * }); + * const testRepositoryMilestone = new github.RepositoryMilestone("testRepositoryMilestone", { + * owner: testRepository.fullName.apply(fullName => fullName.split("/")).apply(split => split[0]), + * repository: testRepository.name, + * title: "v1.0.0", + * description: "General Availability", + * dueDate: "2022-11-22", + * state: "open", + * }); + * const testIssue = new github.Issue("testIssue", { + * repository: testRepository.name, + * title: "My issue", + * body: "My issue body", + * labels: [ + * "bug", + * "documentation", + * ], + * assignees: ["bob-github"], + * milestoneNumber: testRepositoryMilestone.number, + * }); + * ``` + * * ## Import * * GitHub Issues can be imported using an ID made up of `repository:number`, e.g. diff --git a/sdk/nodejs/issueLabel.ts b/sdk/nodejs/issueLabel.ts index cc7572be..d0552d66 100644 --- a/sdk/nodejs/issueLabel.ts +++ b/sdk/nodejs/issueLabel.ts @@ -5,6 +5,19 @@ import * as pulumi from "@pulumi/pulumi"; import * as utilities from "./utilities"; /** + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * // Create a new, red colored label + * const testRepo = new github.IssueLabel("testRepo", { + * color: "FF0000", + * repository: "test-repo", + * }); + * ``` + * * ## Import * * GitHub Issue Labels can be imported using an ID made up of `repository:name`, e.g. diff --git a/sdk/nodejs/membership.ts b/sdk/nodejs/membership.ts index ad9e848e..686790f3 100644 --- a/sdk/nodejs/membership.ts +++ b/sdk/nodejs/membership.ts @@ -11,6 +11,19 @@ import * as utilities from "./utilities"; * an invitation will be sent to the user to become part of the organization. When * destroyed, either the invitation will be cancelled or the user will be removed. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * // Add a user to the organization + * const membershipForSomeUser = new github.Membership("membershipForSomeUser", { + * role: "member", + * username: "SomeUser", + * }); + * ``` + * * ## Import * * GitHub Membership can be imported using an ID made up of `organization:username`, e.g. diff --git a/sdk/nodejs/organizationBlock.ts b/sdk/nodejs/organizationBlock.ts index 1cfd1b64..e09e5e75 100644 --- a/sdk/nodejs/organizationBlock.ts +++ b/sdk/nodejs/organizationBlock.ts @@ -6,6 +6,15 @@ import * as utilities from "./utilities"; /** * This resource allows you to create and manage blocks for GitHub organizations. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const example = new github.OrganizationBlock("example", {username: "paultyng"}); + * ``` */ export class OrganizationBlock extends pulumi.CustomResource { /** diff --git a/sdk/nodejs/organizationCustomRole.ts b/sdk/nodejs/organizationCustomRole.ts index fef86287..e8a0d40b 100644 --- a/sdk/nodejs/organizationCustomRole.ts +++ b/sdk/nodejs/organizationCustomRole.ts @@ -9,6 +9,39 @@ import * as utilities from "./utilities"; * * > Note: Custom roles are currently only available in GitHub Enterprise Cloud. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const example = new github.OrganizationCustomRole("example", { + * baseRole: "read", + * description: "Example custom role that uses the read role as its base", + * permissions: [ + * "add_assignee", + * "add_label", + * "bypass_branch_protection", + * "close_issue", + * "close_pull_request", + * "mark_as_duplicate", + * "create_tag", + * "delete_issue", + * "delete_tag", + * "manage_deploy_keys", + * "push_protected_branch", + * "read_code_scanning", + * "reopen_issue", + * "reopen_pull_request", + * "request_pr_review", + * "resolve_dependabot_alerts", + * "resolve_secret_scanning_alerts", + * "view_secret_scanning_alerts", + * "write_code_scanning", + * ], + * }); + * ``` + * * ## Import * * Custom roles can be imported using the `id` of the role. The `id` of the custom role can be found using the [list custom roles in an organization](https://docs.github.com/en/enterprise-cloud@latest/rest/orgs/custom-roles#list-custom-repository-roles-in-an-organization) API. diff --git a/sdk/nodejs/organizationProject.ts b/sdk/nodejs/organizationProject.ts index 4d690d4e..f0a1f90d 100644 --- a/sdk/nodejs/organizationProject.ts +++ b/sdk/nodejs/organizationProject.ts @@ -6,6 +6,15 @@ import * as utilities from "./utilities"; /** * This resource allows you to create and manage projects for GitHub organization. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const project = new github.OrganizationProject("project", {body: "This is a organization project."}); + * ``` */ export class OrganizationProject extends pulumi.CustomResource { /** diff --git a/sdk/nodejs/organizationSecurityManager.ts b/sdk/nodejs/organizationSecurityManager.ts index fa124ed6..ae21b7cd 100644 --- a/sdk/nodejs/organizationSecurityManager.ts +++ b/sdk/nodejs/organizationSecurityManager.ts @@ -5,6 +5,16 @@ import * as pulumi from "@pulumi/pulumi"; import * as utilities from "./utilities"; /** + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const someTeamTeam = new github.Team("someTeamTeam", {description: "Some cool team"}); + * const someTeamOrganizationSecurityManager = new github.OrganizationSecurityManager("someTeamOrganizationSecurityManager", {teamSlug: someTeamTeam.slug}); + * ``` + * * ## Import * * GitHub Security Manager Teams can be imported using the GitHub team ID e.g. diff --git a/sdk/nodejs/organizationSettings.ts b/sdk/nodejs/organizationSettings.ts index 69399baf..f1a92a18 100644 --- a/sdk/nodejs/organizationSettings.ts +++ b/sdk/nodejs/organizationSettings.ts @@ -7,6 +7,41 @@ import * as utilities from "./utilities"; /** * This resource allows you to create and manage settings for a GitHub Organization. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const test = new github.OrganizationSettings("test", { + * advancedSecurityEnabledForNewRepositories: false, + * billingEmail: "test@example.com", + * blog: "https://example.com", + * company: "Test Company", + * defaultRepositoryPermission: "read", + * dependabotAlertsEnabledForNewRepositories: false, + * dependabotSecurityUpdatesEnabledForNewRepositories: false, + * dependencyGraphEnabledForNewRepositories: false, + * description: "Test Description", + * email: "test@example.com", + * hasOrganizationProjects: true, + * hasRepositoryProjects: true, + * location: "Test Location", + * membersCanCreateInternalRepositories: true, + * membersCanCreatePages: true, + * membersCanCreatePrivatePages: true, + * membersCanCreatePrivateRepositories: true, + * membersCanCreatePublicPages: true, + * membersCanCreatePublicRepositories: true, + * membersCanCreateRepositories: true, + * membersCanForkPrivateRepositories: true, + * secretScanningEnabledForNewRepositories: false, + * secretScanningPushProtectionEnabledForNewRepositories: false, + * twitterUsername: "Test", + * webCommitSignoffRequired: true, + * }); + * ``` + * * ## Import * * Organization settings can be imported using the `id` of the organization. The `id` of the organization can be found using the [get an organization](https://docs.github.com/en/rest/orgs/orgs#get-an-organization) API. diff --git a/sdk/nodejs/organizationWebhook.ts b/sdk/nodejs/organizationWebhook.ts index 7fe822c4..d77a46e9 100644 --- a/sdk/nodejs/organizationWebhook.ts +++ b/sdk/nodejs/organizationWebhook.ts @@ -9,6 +9,23 @@ import * as utilities from "./utilities"; /** * This resource allows you to create and manage webhooks for GitHub organization. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const foo = new github.OrganizationWebhook("foo", { + * active: false, + * configuration: { + * contentType: "form", + * insecureSsl: false, + * url: "https://google.de/", + * }, + * events: ["issues"], + * }); + * ``` + * * ## Import * * Organization webhooks can be imported using the `id` of the webhook. The `id` of the webhook can be found in the URL of the webhook. For example, `"https://github.com/organizations/foo-org/settings/hooks/123456789"`. diff --git a/sdk/nodejs/projectCard.ts b/sdk/nodejs/projectCard.ts index 21f942ef..13db78ae 100644 --- a/sdk/nodejs/projectCard.ts +++ b/sdk/nodejs/projectCard.ts @@ -7,6 +7,46 @@ import * as utilities from "./utilities"; /** * This resource allows you to create and manage cards for GitHub projects. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const project = new github.OrganizationProject("project", {body: "This is an organization project."}); + * const column = new github.ProjectColumn("column", {projectId: project.id}); + * const card = new github.ProjectCard("card", { + * columnId: column.columnId, + * note: "## Unaccepted 👇", + * }); + * ``` + * ### Adding An Issue To A Project + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const testRepository = new github.Repository("testRepository", { + * hasProjects: true, + * hasIssues: true, + * }); + * const testIssue = new github.Issue("testIssue", { + * repository: testRepository.id, + * title: "Test issue title", + * body: "Test issue body", + * }); + * const testRepositoryProject = new github.RepositoryProject("testRepositoryProject", { + * repository: testRepository.name, + * body: "this is a test project", + * }); + * const testProjectColumn = new github.ProjectColumn("testProjectColumn", {projectId: testRepositoryProject.id}); + * const testProjectCard = new github.ProjectCard("testProjectCard", { + * columnId: testProjectColumn.columnId, + * contentId: testIssue.issueId, + * contentType: "Issue", + * }); + * ``` + * * ## Import * * A GitHub Project Card can be imported using its [Card ID](https://developer.github.com/v3/projects/cards/#get-a-project-card): diff --git a/sdk/nodejs/projectColumn.ts b/sdk/nodejs/projectColumn.ts index 0fc62606..c4842702 100644 --- a/sdk/nodejs/projectColumn.ts +++ b/sdk/nodejs/projectColumn.ts @@ -6,6 +6,16 @@ import * as utilities from "./utilities"; /** * This resource allows you to create and manage columns for GitHub projects. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const project = new github.OrganizationProject("project", {body: "This is an organization project."}); + * const column = new github.ProjectColumn("column", {projectId: project.id}); + * ``` */ export class ProjectColumn extends pulumi.CustomResource { /** diff --git a/sdk/nodejs/release.ts b/sdk/nodejs/release.ts index 1e8baa9c..c36a3739 100644 --- a/sdk/nodejs/release.ts +++ b/sdk/nodejs/release.ts @@ -8,6 +8,42 @@ import * as utilities from "./utilities"; * This resource allows you to create and manage a release in a specific * GitHub repository. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const repo = new github.Repository("repo", { + * description: "GitHub repo managed by Terraform", + * "private": false, + * }); + * const example = new github.Release("example", { + * repository: repo.name, + * tagName: "v1.0.0", + * }); + * ``` + * ### On Non-Default Branch + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const exampleRepository = new github.Repository("exampleRepository", {autoInit: true}); + * const exampleBranch = new github.Branch("exampleBranch", { + * repository: exampleRepository.name, + * branch: "branch_name", + * sourceBranch: exampleRepository.defaultBranch, + * }); + * const exampleRelease = new github.Release("exampleRelease", { + * repository: exampleRepository.name, + * tagName: "v1.0.0", + * targetCommitish: exampleBranch.branch, + * draft: false, + * prerelease: false, + * }); + * ``` + * * ## Import * * This resource can be imported using the `name` of the repository, combined with the `id` of the release, and a `:` character for separating components, e.g. diff --git a/sdk/nodejs/repository.ts b/sdk/nodejs/repository.ts index c63717e1..ab53ee84 100644 --- a/sdk/nodejs/repository.ts +++ b/sdk/nodejs/repository.ts @@ -14,6 +14,40 @@ import * as utilities from "./utilities"; * the `contents:write` permission or else the `allowMergeCommit`, `allowRebaseMerge`, * and `allowSquashMerge` attributes will be ignored, causing confusing diffs. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const example = new github.Repository("example", { + * description: "My awesome codebase", + * template: { + * includeAllBranches: true, + * owner: "github", + * repository: "terraform-template-module", + * }, + * visibility: "public", + * }); + * ``` + * ### With GitHub Pages Enabled + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const example = new github.Repository("example", { + * description: "My awesome web page", + * pages: { + * source: { + * branch: "master", + * path: "/docs", + * }, + * }, + * "private": false, + * }); + * ``` + * * ## Import * * Repositories can be imported using the `name`, e.g. diff --git a/sdk/nodejs/repositoryAutolinkReference.ts b/sdk/nodejs/repositoryAutolinkReference.ts index e89566f4..cff72091 100644 --- a/sdk/nodejs/repositoryAutolinkReference.ts +++ b/sdk/nodejs/repositoryAutolinkReference.ts @@ -7,6 +7,23 @@ import * as utilities from "./utilities"; /** * This resource allows you to create and manage an autolink reference for a single repository. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const repo = new github.Repository("repo", { + * description: "GitHub repo managed by Terraform", + * "private": false, + * }); + * const autolink = new github.RepositoryAutolinkReference("autolink", { + * repository: repo.name, + * keyPrefix: "TICKET-", + * targetUrlTemplate: "https://example.com/TICKET?query=", + * }); + * ``` + * * ## Import * * ### Import by key prefix diff --git a/sdk/nodejs/repositoryCollaborator.ts b/sdk/nodejs/repositoryCollaborator.ts index c402d5d4..00389599 100644 --- a/sdk/nodejs/repositoryCollaborator.ts +++ b/sdk/nodejs/repositoryCollaborator.ts @@ -30,6 +30,20 @@ import * as utilities from "./utilities"; * - [Adding outside collaborators to repositories in your organization](https://help.github.com/articles/adding-outside-collaborators-to-repositories-in-your-organization/) * - [Converting an organization member to an outside collaborator](https://help.github.com/articles/converting-an-organization-member-to-an-outside-collaborator/) * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * // Add a collaborator to a repository + * const aRepoCollaborator = new github.RepositoryCollaborator("aRepoCollaborator", { + * permission: "admin", + * repository: "our-cool-repo", + * username: "SomeUser", + * }); + * ``` + * * ## Import * * GitHub Repository Collaborators can be imported using an ID made up of `repository:username`, e.g. diff --git a/sdk/nodejs/repositoryCollaborators.ts b/sdk/nodejs/repositoryCollaborators.ts index 3adc8a4b..9d0efee9 100644 --- a/sdk/nodejs/repositoryCollaborators.ts +++ b/sdk/nodejs/repositoryCollaborators.ts @@ -32,6 +32,28 @@ import * as utilities from "./utilities"; * - [Adding outside collaborators to repositories in your organization](https://help.github.com/articles/adding-outside-collaborators-to-repositories-in-your-organization/) * - [Converting an organization member to an outside collaborators](https://help.github.com/articles/converting-an-organization-member-to-an-outside-collaborator/) * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * // Add collaborators to a repository + * const someTeam = new github.Team("someTeam", {description: "Some cool team"}); + * const someRepo = new github.Repository("someRepo", {}); + * const someRepoCollaborators = new github.RepositoryCollaborators("someRepoCollaborators", { + * repository: someRepo.name, + * users: [{ + * permission: "admin", + * username: "SomeUser", + * }], + * teams: [{ + * permission: "pull", + * teamId: someTeam.slug, + * }], + * }); + * ``` + * * ## Import * * GitHub Repository Collaborators can be imported using the name `name`, e.g. diff --git a/sdk/nodejs/repositoryDeployKey.ts b/sdk/nodejs/repositoryDeployKey.ts index 99d7493c..2af12b3e 100644 --- a/sdk/nodejs/repositoryDeployKey.ts +++ b/sdk/nodejs/repositoryDeployKey.ts @@ -16,6 +16,21 @@ import * as utilities from "./utilities"; * Further documentation on GitHub repository deploy keys: * - [About deploy keys](https://developer.github.com/guides/managing-deploy-keys/#deploy-keys) * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * // Add a deploy key + * const exampleRepositoryDeployKey = new github.RepositoryDeployKey("exampleRepositoryDeployKey", { + * key: "ssh-rsa AAA...", + * readOnly: false, + * repository: "test-repo", + * title: "Repository test key", + * }); + * ``` + * * ## Import * * Repository deploy keys can be imported using a colon-separated pair of repository name and GitHub's key id. The latter can be obtained by GitHub's SDKs and API. diff --git a/sdk/nodejs/repositoryDeploymentBranchPolicy.ts b/sdk/nodejs/repositoryDeploymentBranchPolicy.ts index 18a127f3..549b99cf 100644 --- a/sdk/nodejs/repositoryDeploymentBranchPolicy.ts +++ b/sdk/nodejs/repositoryDeploymentBranchPolicy.ts @@ -7,6 +7,28 @@ import * as utilities from "./utilities"; /** * This resource allows you to create and manage deployment branch policies. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const env = new github.RepositoryEnvironment("env", { + * repository: "my_repo", + * environment: "my_env", + * deploymentBranchPolicy: { + * protectedBranches: false, + * customBranchPolicies: true, + * }, + * }); + * const foo = new github.RepositoryDeploymentBranchPolicy("foo", { + * repository: "my_repo", + * environmentName: "my_env", + * }, { + * dependsOn: [env], + * }); + * ``` + * * ## Import * * ```sh diff --git a/sdk/nodejs/repositoryEnvironment.ts b/sdk/nodejs/repositoryEnvironment.ts index 58ae6dd7..8e472327 100644 --- a/sdk/nodejs/repositoryEnvironment.ts +++ b/sdk/nodejs/repositoryEnvironment.ts @@ -9,6 +9,29 @@ import * as utilities from "./utilities"; /** * This resource allows you to create and manage environments for a GitHub repository. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const current = github.getUser({ + * username: "", + * }); + * const exampleRepository = new github.Repository("exampleRepository", {description: "My awesome codebase"}); + * const exampleRepositoryEnvironment = new github.RepositoryEnvironment("exampleRepositoryEnvironment", { + * environment: "example", + * repository: exampleRepository.name, + * reviewers: [{ + * users: [current.then(current => current.id)], + * }], + * deploymentBranchPolicy: { + * protectedBranches: true, + * customBranchPolicies: false, + * }, + * }); + * ``` + * * ## Import * * GitHub Repository Environment can be imported using an ID made up of `name` of the repository combined with the `environment` name of the environment, separated by a `:` character, e.g. diff --git a/sdk/nodejs/repositoryEnvironmentDeploymentPolicy.ts b/sdk/nodejs/repositoryEnvironmentDeploymentPolicy.ts index 67fbd9a9..fc71d60d 100644 --- a/sdk/nodejs/repositoryEnvironmentDeploymentPolicy.ts +++ b/sdk/nodejs/repositoryEnvironmentDeploymentPolicy.ts @@ -7,6 +7,35 @@ import * as utilities from "./utilities"; /** * This resource allows you to create and manage environment deployment branch policies for a GitHub repository. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const current = github.getUser({ + * username: "", + * }); + * const testRepository = new github.Repository("testRepository", {}); + * const testRepositoryEnvironment = new github.RepositoryEnvironment("testRepositoryEnvironment", { + * repository: testRepository.name, + * environment: "environment/test", + * waitTimer: 10000, + * reviewers: [{ + * users: [current.then(current => current.id)], + * }], + * deploymentBranchPolicy: { + * protectedBranches: false, + * customBranchPolicies: true, + * }, + * }); + * const testRepositoryEnvironmentDeploymentPolicy = new github.RepositoryEnvironmentDeploymentPolicy("testRepositoryEnvironmentDeploymentPolicy", { + * repository: testRepository.name, + * environment: testRepositoryEnvironment.environment, + * branchPattern: "releases/*", + * }); + * ``` + * * ## Import * * GitHub Repository Environment Deployment Policy can be imported using an ID made up of `name` of the repository combined with the `environment` name of the environment with the `Id` of the deployment policy, separated by a `:` character, e.g. diff --git a/sdk/nodejs/repositoryFile.ts b/sdk/nodejs/repositoryFile.ts index 023f5319..dcdbad95 100644 --- a/sdk/nodejs/repositoryFile.ts +++ b/sdk/nodejs/repositoryFile.ts @@ -8,6 +8,25 @@ import * as utilities from "./utilities"; * This resource allows you to create and manage files within a * GitHub repository. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const fooRepository = new github.Repository("fooRepository", {autoInit: true}); + * const fooRepositoryFile = new github.RepositoryFile("fooRepositoryFile", { + * repository: fooRepository.name, + * branch: "main", + * file: ".gitignore", + * content: "**/*.tfstate", + * commitMessage: "Managed by Terraform", + * commitAuthor: "Terraform User", + * commitEmail: "terraform@example.com", + * overwriteOnCreate: true, + * }); + * ``` + * * ## Import * * Repository files can be imported using a combination of the `repo` and `file`, e.g. diff --git a/sdk/nodejs/repositoryMilestone.ts b/sdk/nodejs/repositoryMilestone.ts index 7c823312..417db1ab 100644 --- a/sdk/nodejs/repositoryMilestone.ts +++ b/sdk/nodejs/repositoryMilestone.ts @@ -9,6 +9,20 @@ import * as utilities from "./utilities"; * * This resource allows you to create and manage milestones for a GitHub Repository within an organization or user account. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * // Create a milestone for a repository + * const example = new github.RepositoryMilestone("example", { + * owner: "example-owner", + * repository: "example-repository", + * title: "v1.1.0", + * }); + * ``` + * * ## Import * * A GitHub Repository Milestone can be imported using an ID made up of `owner/repository/number`, e.g. diff --git a/sdk/nodejs/repositoryProject.ts b/sdk/nodejs/repositoryProject.ts index b35d343a..eb4a6d9a 100644 --- a/sdk/nodejs/repositoryProject.ts +++ b/sdk/nodejs/repositoryProject.ts @@ -6,6 +6,22 @@ import * as utilities from "./utilities"; /** * This resource allows you to create and manage projects for GitHub repository. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const example = new github.Repository("example", { + * description: "My awesome codebase", + * hasProjects: true, + * }); + * const project = new github.RepositoryProject("project", { + * body: "This is a repository project.", + * repository: example.name, + * }); + * ``` */ export class RepositoryProject extends pulumi.CustomResource { /** diff --git a/sdk/nodejs/repositoryPullRequest.ts b/sdk/nodejs/repositoryPullRequest.ts index e409208f..f3dfa4e2 100644 --- a/sdk/nodejs/repositoryPullRequest.ts +++ b/sdk/nodejs/repositoryPullRequest.ts @@ -6,6 +6,21 @@ import * as utilities from "./utilities"; /** * This resource allows you to create and manage PullRequests for repositories within your GitHub organization or personal account. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const example = new github.RepositoryPullRequest("example", { + * baseRef: "main", + * baseRepository: "example-repository", + * body: "This will change everything", + * headRef: "feature-branch", + * title: "My newest feature", + * }); + * ``` */ export class RepositoryPullRequest extends pulumi.CustomResource { /** diff --git a/sdk/nodejs/repositoryRuleset.ts b/sdk/nodejs/repositoryRuleset.ts index c8f72141..002c0bff 100644 --- a/sdk/nodejs/repositoryRuleset.ts +++ b/sdk/nodejs/repositoryRuleset.ts @@ -11,6 +11,41 @@ import * as utilities from "./utilities"; * * This resource allows you to create and manage rulesets on the repository level. When applied, a new ruleset will be created. When destroyed, that ruleset will be removed. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const exampleRepository = new github.Repository("exampleRepository", {description: "Example repository"}); + * const exampleRepositoryRuleset = new github.RepositoryRuleset("exampleRepositoryRuleset", { + * repository: exampleRepository.name, + * target: "branch", + * enforcement: "active", + * conditions: { + * refName: { + * includes: ["~ALL"], + * excludes: [], + * }, + * }, + * bypassActors: [{ + * actorId: 13473, + * actorType: "Integration", + * bypassMode: "always", + * }], + * rules: { + * creation: true, + * update: true, + * deletion: true, + * requiredLinearHistory: true, + * requiredSignatures: true, + * requiredDeployments: { + * requiredDeploymentEnvironments: ["test"], + * }, + * }, + * }); + * ``` + * * ## Import * * GitHub Repository Rulesets can be imported using the GitHub repository name and ruleset ID e.g. diff --git a/sdk/nodejs/repositoryTagProtection.ts b/sdk/nodejs/repositoryTagProtection.ts index afaba53f..bd26c0d2 100644 --- a/sdk/nodejs/repositoryTagProtection.ts +++ b/sdk/nodejs/repositoryTagProtection.ts @@ -7,6 +7,18 @@ import * as utilities from "./utilities"; /** * This resource allows you to create and manage a repository tag protection for repositories within your GitHub organization or personal account. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const example = new github.RepositoryTagProtection("example", { + * pattern: "v*", + * repository: "example-repository", + * }); + * ``` + * * ## Import * * Repository tag protections can be imported using the `name` of the repository, combined with the `id` of the tag protection, separated by a `/` character. The `id` of the tag protection can be found using the [GitHub API](https://docs.github.com/en/rest/repos/tags#list-tag-protection-states-for-a-repository). diff --git a/sdk/nodejs/repositoryTopics.ts b/sdk/nodejs/repositoryTopics.ts index d2df0a0b..cf427700 100644 --- a/sdk/nodejs/repositoryTopics.ts +++ b/sdk/nodejs/repositoryTopics.ts @@ -5,6 +5,24 @@ import * as pulumi from "@pulumi/pulumi"; import * as utilities from "./utilities"; /** + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const testRepository = github.getRepository({ + * name: "test", + * }); + * const testRepositoryTopics = new github.RepositoryTopics("testRepositoryTopics", { + * repository: github_repository.test.name, + * topics: [ + * "topic-1", + * "topic-2", + * ], + * }); + * ``` + * * ## Import * * Repository topics can be imported using the `name` of the repository. diff --git a/sdk/nodejs/repositoryWebhook.ts b/sdk/nodejs/repositoryWebhook.ts index aeaeba15..a070fa40 100644 --- a/sdk/nodejs/repositoryWebhook.ts +++ b/sdk/nodejs/repositoryWebhook.ts @@ -10,6 +10,29 @@ import * as utilities from "./utilities"; * This resource allows you to create and manage webhooks for repositories within your * GitHub organization or personal account. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const repo = new github.Repository("repo", { + * description: "Terraform acceptance tests", + * homepageUrl: "http://example.com/", + * visibility: "public", + * }); + * const foo = new github.RepositoryWebhook("foo", { + * repository: repo.name, + * configuration: { + * url: "https://google.de/", + * contentType: "form", + * insecureSsl: false, + * }, + * active: false, + * events: ["issues"], + * }); + * ``` + * * ## Import * * Repository webhooks can be imported using the `name` of the repository, combined with the `id` of the webhook, separated by a `/` character. The `id` of the webhook can be found in the URL of the webhook. For example`"https://github.com/foo-org/foo-repo/settings/hooks/14711452"`. diff --git a/sdk/nodejs/team.ts b/sdk/nodejs/team.ts index 6fd8f088..05424606 100644 --- a/sdk/nodejs/team.ts +++ b/sdk/nodejs/team.ts @@ -10,6 +10,19 @@ import * as utilities from "./utilities"; * This resource allows you to add/remove teams from your organization. When applied, * a new team will be created. When destroyed, that team will be removed. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * // Add a team to the organization + * const someTeam = new github.Team("someTeam", { + * description: "Some cool team", + * privacy: "closed", + * }); + * ``` + * * ## Import * * GitHub Teams can be imported using the GitHub team ID or name e.g. diff --git a/sdk/nodejs/teamMembers.ts b/sdk/nodejs/teamMembers.ts index 6ea5481c..67acfef5 100644 --- a/sdk/nodejs/teamMembers.ts +++ b/sdk/nodejs/teamMembers.ts @@ -7,6 +7,37 @@ import * as outputs from "./types/output"; import * as utilities from "./utilities"; /** + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * // Add a user to the organization + * const membershipForSomeUser = new github.Membership("membershipForSomeUser", { + * username: "SomeUser", + * role: "member", + * }); + * const membershipForAnotherUser = new github.Membership("membershipForAnotherUser", { + * username: "AnotherUser", + * role: "member", + * }); + * const someTeam = new github.Team("someTeam", {description: "Some cool team"}); + * const someTeamMembers = new github.TeamMembers("someTeamMembers", { + * teamId: someTeam.id, + * members: [ + * { + * username: "SomeUser", + * role: "maintainer", + * }, + * { + * username: "AnotherUser", + * role: "member", + * }, + * ], + * }); + * ``` + * * ## Import * * GitHub Team Membership can be imported using the team ID `teamid` or team name, e.g. diff --git a/sdk/nodejs/teamMembership.ts b/sdk/nodejs/teamMembership.ts index 1c9d7e29..8abc03e9 100644 --- a/sdk/nodejs/teamMembership.ts +++ b/sdk/nodejs/teamMembership.ts @@ -16,6 +16,25 @@ import * as utilities from "./utilities"; * * > **Note** Organization owners may not be set as "members" of a team; they may only be set as "maintainers". Attempting to set organization an owner to "member" of a may result in a `pulumi preview` diff that changes their status back to "maintainer". * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * // Add a user to the organization + * const membershipForSomeUser = new github.Membership("membershipForSomeUser", { + * username: "SomeUser", + * role: "member", + * }); + * const someTeam = new github.Team("someTeam", {description: "Some cool team"}); + * const someTeamMembership = new github.TeamMembership("someTeamMembership", { + * teamId: someTeam.id, + * username: "SomeUser", + * role: "member", + * }); + * ``` + * * ## Import * * GitHub Team Membership can be imported using an ID made up of `teamid:username` or `teamname:username`, e.g. diff --git a/sdk/nodejs/teamRepository.ts b/sdk/nodejs/teamRepository.ts index 2994fd9a..6bcb117f 100644 --- a/sdk/nodejs/teamRepository.ts +++ b/sdk/nodejs/teamRepository.ts @@ -21,6 +21,22 @@ import * as utilities from "./utilities"; * This resource is non-authoritative, for managing ALL collaborators of a repo, use github.RepositoryCollaborators * instead. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * // Add a repository to the team + * const someTeam = new github.Team("someTeam", {description: "Some cool team"}); + * const someRepo = new github.Repository("someRepo", {}); + * const someTeamRepo = new github.TeamRepository("someTeamRepo", { + * teamId: someTeam.id, + * repository: someRepo.name, + * permission: "pull", + * }); + * ``` + * * ## Import * * GitHub Team Repository can be imported using an ID made up of `team_id:repository` or `team_name:repository`, e.g. diff --git a/sdk/nodejs/teamSettings.ts b/sdk/nodejs/teamSettings.ts index f4c095e7..30741328 100644 --- a/sdk/nodejs/teamSettings.ts +++ b/sdk/nodejs/teamSettings.ts @@ -15,6 +15,24 @@ import * as utilities from "./utilities"; * * > **Note**: This resource relies on the v4 GraphQl GitHub API. If this API is not available, or the Stone Crop schema preview is not available, then this resource will not work as intended. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * // Add a repository to the team + * const someTeam = new github.Team("someTeam", {description: "Some cool team"}); + * const codeReviewSettings = new github.TeamSettings("codeReviewSettings", { + * teamId: someTeam.id, + * reviewRequestDelegation: { + * algorithm: "ROUND_ROBIN", + * memberCount: 1, + * notify: true, + * }, + * }); + * ``` + * * ## Import * * GitHub Teams can be imported using the GitHub team ID, or the team slug e.g. diff --git a/sdk/nodejs/userGpgKey.ts b/sdk/nodejs/userGpgKey.ts index 1c98b45c..778cbcde 100644 --- a/sdk/nodejs/userGpgKey.ts +++ b/sdk/nodejs/userGpgKey.ts @@ -9,6 +9,18 @@ import * as utilities from "./utilities"; * * This resource allows you to add/remove GPG keys from your user account. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const example = new github.UserGpgKey("example", {armoredPublicKey: `-----BEGIN PGP PUBLIC KEY BLOCK----- + * ... + * -----END PGP PUBLIC KEY BLOCK----- + * `}); + * ``` + * * ## Import * * GPG keys are not importable due to the fact that [API](https://developer.github.com/v3/users/gpg_keys/#gpg-keys) does not return previously uploaded GPG key. diff --git a/sdk/nodejs/userSshKey.ts b/sdk/nodejs/userSshKey.ts index fe37cbc8..6fdf7645 100644 --- a/sdk/nodejs/userSshKey.ts +++ b/sdk/nodejs/userSshKey.ts @@ -9,6 +9,19 @@ import * as utilities from "./utilities"; * * This resource allows you to add/remove SSH keys from your user account. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as fs from "fs"; + * import * as github from "@pulumi/github"; + * + * const example = new github.UserSshKey("example", { + * title: "example title", + * key: fs.readFileSync("~/.ssh/id_rsa.pub"), + * }); + * ``` + * * ## Import * * SSH keys can be imported using their ID e.g. diff --git a/sdk/python/pulumi_github/actions_environment_secret.py b/sdk/python/pulumi_github/actions_environment_secret.py index a8ec8ec5..bad9ec7c 100644 --- a/sdk/python/pulumi_github/actions_environment_secret.py +++ b/sdk/python/pulumi_github/actions_environment_secret.py @@ -292,6 +292,37 @@ def __init__(__self__, secret_name: Optional[pulumi.Input[str]] = None, __props__=None): """ + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example_secret_actions_environment_secret = github.ActionsEnvironmentSecret("exampleSecretActionsEnvironmentSecret", + environment="example_environment", + secret_name="example_secret_name", + plaintext_value=var["some_secret_string"]) + example_secret_index_actions_environment_secret_actions_environment_secret = github.ActionsEnvironmentSecret("exampleSecretIndex/actionsEnvironmentSecretActionsEnvironmentSecret", + environment="example_environment", + secret_name="example_secret_name", + encrypted_value=var["some_encrypted_secret_string"]) + ``` + + ```python + import pulumi + import pulumi_github as github + + repo = github.get_repository(full_name="my-org/repo") + repo_environment = github.RepositoryEnvironment("repoEnvironment", + repository=repo.name, + environment="example_environment") + test_secret = github.ActionsEnvironmentSecret("testSecret", + repository=repo.name, + environment=repo_environment.environment, + secret_name="test_secret_name", + plaintext_value="%s") + ``` + ## Import This resource does not support importing. If you'd like to help contribute it, please visit our [GitHub page](https://github.com/integrations/terraform-provider-github)! @@ -311,6 +342,37 @@ def __init__(__self__, args: ActionsEnvironmentSecretArgs, opts: Optional[pulumi.ResourceOptions] = None): """ + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example_secret_actions_environment_secret = github.ActionsEnvironmentSecret("exampleSecretActionsEnvironmentSecret", + environment="example_environment", + secret_name="example_secret_name", + plaintext_value=var["some_secret_string"]) + example_secret_index_actions_environment_secret_actions_environment_secret = github.ActionsEnvironmentSecret("exampleSecretIndex/actionsEnvironmentSecretActionsEnvironmentSecret", + environment="example_environment", + secret_name="example_secret_name", + encrypted_value=var["some_encrypted_secret_string"]) + ``` + + ```python + import pulumi + import pulumi_github as github + + repo = github.get_repository(full_name="my-org/repo") + repo_environment = github.RepositoryEnvironment("repoEnvironment", + repository=repo.name, + environment="example_environment") + test_secret = github.ActionsEnvironmentSecret("testSecret", + repository=repo.name, + environment=repo_environment.environment, + secret_name="test_secret_name", + plaintext_value="%s") + ``` + ## Import This resource does not support importing. If you'd like to help contribute it, please visit our [GitHub page](https://github.com/integrations/terraform-provider-github)! diff --git a/sdk/python/pulumi_github/actions_environment_variable.py b/sdk/python/pulumi_github/actions_environment_variable.py index 9bcb03f2..743dd707 100644 --- a/sdk/python/pulumi_github/actions_environment_variable.py +++ b/sdk/python/pulumi_github/actions_environment_variable.py @@ -251,6 +251,33 @@ def __init__(__self__, This resource allows you to create and manage GitHub Actions variables within your GitHub repository environments. You must have write access to a repository to use this resource. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example_variable = github.ActionsEnvironmentVariable("exampleVariable", + environment="example_environment", + value="example_variable_value", + variable_name="example_variable_name") + ``` + + ```python + import pulumi + import pulumi_github as github + + repo = github.get_repository(full_name="my-org/repo") + repo_environment = github.RepositoryEnvironment("repoEnvironment", + repository=repo.name, + environment="example_environment") + example_variable = github.ActionsEnvironmentVariable("exampleVariable", + repository=repo.name, + environment=repo_environment.environment, + variable_name="example_variable_name", + value="example_variable_value") + ``` + ## Import This resource can be imported using an ID made up of the repository name, environment name, and variable name: @@ -276,6 +303,33 @@ def __init__(__self__, This resource allows you to create and manage GitHub Actions variables within your GitHub repository environments. You must have write access to a repository to use this resource. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example_variable = github.ActionsEnvironmentVariable("exampleVariable", + environment="example_environment", + value="example_variable_value", + variable_name="example_variable_name") + ``` + + ```python + import pulumi + import pulumi_github as github + + repo = github.get_repository(full_name="my-org/repo") + repo_environment = github.RepositoryEnvironment("repoEnvironment", + repository=repo.name, + environment="example_environment") + example_variable = github.ActionsEnvironmentVariable("exampleVariable", + repository=repo.name, + environment=repo_environment.environment, + variable_name="example_variable_name", + value="example_variable_value") + ``` + ## Import This resource can be imported using an ID made up of the repository name, environment name, and variable name: diff --git a/sdk/python/pulumi_github/actions_organization_oidc_subject_claim_customization_template.py b/sdk/python/pulumi_github/actions_organization_oidc_subject_claim_customization_template.py index 1763906f..39bb171f 100644 --- a/sdk/python/pulumi_github/actions_organization_oidc_subject_claim_customization_template.py +++ b/sdk/python/pulumi_github/actions_organization_oidc_subject_claim_customization_template.py @@ -100,6 +100,19 @@ def __init__(__self__, More information on integrating GitHub with cloud providers using OpenID Connect and a list of available claims is available in the [Actions documentation](https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/about-security-hardening-with-openid-connect). + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example_template = github.ActionsOrganizationOidcSubjectClaimCustomizationTemplate("exampleTemplate", include_claim_keys=[ + "actor", + "context", + "repository_owner", + ]) + ``` + ## Import This resource can be imported using the organization's name. @@ -125,6 +138,19 @@ def __init__(__self__, More information on integrating GitHub with cloud providers using OpenID Connect and a list of available claims is available in the [Actions documentation](https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/about-security-hardening-with-openid-connect). + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example_template = github.ActionsOrganizationOidcSubjectClaimCustomizationTemplate("exampleTemplate", include_claim_keys=[ + "actor", + "context", + "repository_owner", + ]) + ``` + ## Import This resource can be imported using the organization's name. diff --git a/sdk/python/pulumi_github/actions_organization_permissions.py b/sdk/python/pulumi_github/actions_organization_permissions.py index 9838b018..88456113 100644 --- a/sdk/python/pulumi_github/actions_organization_permissions.py +++ b/sdk/python/pulumi_github/actions_organization_permissions.py @@ -222,6 +222,29 @@ def __init__(__self__, This resource allows you to create and manage GitHub Actions permissions within your GitHub enterprise organizations. You must have admin access to an organization to use this resource. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example = github.Repository("example") + test = github.ActionsOrganizationPermissions("test", + allowed_actions="selected", + enabled_repositories="selected", + allowed_actions_config=github.ActionsOrganizationPermissionsAllowedActionsConfigArgs( + github_owned_allowed=True, + patterns_alloweds=[ + "actions/cache@*", + "actions/checkout@*", + ], + verified_allowed=True, + ), + enabled_repositories_config=github.ActionsOrganizationPermissionsEnabledRepositoriesConfigArgs( + repository_ids=[example.repo_id], + )) + ``` + ## Import This resource can be imported using the ID of the GitHub organization: @@ -247,6 +270,29 @@ def __init__(__self__, This resource allows you to create and manage GitHub Actions permissions within your GitHub enterprise organizations. You must have admin access to an organization to use this resource. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example = github.Repository("example") + test = github.ActionsOrganizationPermissions("test", + allowed_actions="selected", + enabled_repositories="selected", + allowed_actions_config=github.ActionsOrganizationPermissionsAllowedActionsConfigArgs( + github_owned_allowed=True, + patterns_alloweds=[ + "actions/cache@*", + "actions/checkout@*", + ], + verified_allowed=True, + ), + enabled_repositories_config=github.ActionsOrganizationPermissionsEnabledRepositoriesConfigArgs( + repository_ids=[example.repo_id], + )) + ``` + ## Import This resource can be imported using the ID of the GitHub organization: diff --git a/sdk/python/pulumi_github/actions_organization_secret.py b/sdk/python/pulumi_github/actions_organization_secret.py index dd6d2a21..193edd96 100644 --- a/sdk/python/pulumi_github/actions_organization_secret.py +++ b/sdk/python/pulumi_github/actions_organization_secret.py @@ -299,6 +299,39 @@ def __init__(__self__, visibility: Optional[pulumi.Input[str]] = None, __props__=None): """ + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example_secret_actions_organization_secret = github.ActionsOrganizationSecret("exampleSecretActionsOrganizationSecret", + secret_name="example_secret_name", + visibility="private", + plaintext_value=var["some_secret_string"]) + example_secret_index_actions_organization_secret_actions_organization_secret = github.ActionsOrganizationSecret("exampleSecretIndex/actionsOrganizationSecretActionsOrganizationSecret", + secret_name="example_secret_name", + visibility="private", + encrypted_value=var["some_encrypted_secret_string"]) + ``` + + ```python + import pulumi + import pulumi_github as github + + repo = github.get_repository(full_name="my-org/repo") + example_secret_actions_organization_secret = github.ActionsOrganizationSecret("exampleSecretActionsOrganizationSecret", + secret_name="example_secret_name", + visibility="selected", + plaintext_value=var["some_secret_string"], + selected_repository_ids=[repo.repo_id]) + example_secret_index_actions_organization_secret_actions_organization_secret = github.ActionsOrganizationSecret("exampleSecretIndex/actionsOrganizationSecretActionsOrganizationSecret", + secret_name="example_secret_name", + visibility="selected", + encrypted_value=var["some_encrypted_secret_string"], + selected_repository_ids=[repo.repo_id]) + ``` + ## Import This resource can be imported using an ID made up of the secret name: @@ -324,6 +357,39 @@ def __init__(__self__, args: ActionsOrganizationSecretArgs, opts: Optional[pulumi.ResourceOptions] = None): """ + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example_secret_actions_organization_secret = github.ActionsOrganizationSecret("exampleSecretActionsOrganizationSecret", + secret_name="example_secret_name", + visibility="private", + plaintext_value=var["some_secret_string"]) + example_secret_index_actions_organization_secret_actions_organization_secret = github.ActionsOrganizationSecret("exampleSecretIndex/actionsOrganizationSecretActionsOrganizationSecret", + secret_name="example_secret_name", + visibility="private", + encrypted_value=var["some_encrypted_secret_string"]) + ``` + + ```python + import pulumi + import pulumi_github as github + + repo = github.get_repository(full_name="my-org/repo") + example_secret_actions_organization_secret = github.ActionsOrganizationSecret("exampleSecretActionsOrganizationSecret", + secret_name="example_secret_name", + visibility="selected", + plaintext_value=var["some_secret_string"], + selected_repository_ids=[repo.repo_id]) + example_secret_index_actions_organization_secret_actions_organization_secret = github.ActionsOrganizationSecret("exampleSecretIndex/actionsOrganizationSecretActionsOrganizationSecret", + secret_name="example_secret_name", + visibility="selected", + encrypted_value=var["some_encrypted_secret_string"], + selected_repository_ids=[repo.repo_id]) + ``` + ## Import This resource can be imported using an ID made up of the secret name: diff --git a/sdk/python/pulumi_github/actions_organization_secret_repositories.py b/sdk/python/pulumi_github/actions_organization_secret_repositories.py index 78fe3572..07faf146 100644 --- a/sdk/python/pulumi_github/actions_organization_secret_repositories.py +++ b/sdk/python/pulumi_github/actions_organization_secret_repositories.py @@ -141,6 +141,18 @@ def __init__(__self__, This resource is only applicable when `visibility` of the existing organization secret has been set to `selected`. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + repo = github.get_repository(full_name="my-org/repo") + org_secret_repos = github.ActionsOrganizationSecretRepositories("orgSecretRepos", + secret_name="existing_secret_name", + selected_repository_ids=[repo.repo_id]) + ``` + ## Import This resource can be imported using an ID made up of the secret name: @@ -166,6 +178,18 @@ def __init__(__self__, This resource is only applicable when `visibility` of the existing organization secret has been set to `selected`. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + repo = github.get_repository(full_name="my-org/repo") + org_secret_repos = github.ActionsOrganizationSecretRepositories("orgSecretRepos", + secret_name="existing_secret_name", + selected_repository_ids=[repo.repo_id]) + ``` + ## Import This resource can be imported using an ID made up of the secret name: diff --git a/sdk/python/pulumi_github/actions_organization_variable.py b/sdk/python/pulumi_github/actions_organization_variable.py index e7f09449..e41bf89f 100644 --- a/sdk/python/pulumi_github/actions_organization_variable.py +++ b/sdk/python/pulumi_github/actions_organization_variable.py @@ -258,6 +258,30 @@ def __init__(__self__, This resource allows you to create and manage GitHub Actions variables within your GitHub organization. You must have write access to a repository to use this resource. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example_variable = github.ActionsOrganizationVariable("exampleVariable", + value="example_variable_value", + variable_name="example_variable_name", + visibility="private") + ``` + + ```python + import pulumi + import pulumi_github as github + + repo = github.get_repository(full_name="my-org/repo") + example_variable = github.ActionsOrganizationVariable("exampleVariable", + variable_name="example_variable_name", + visibility="selected", + value="example_variable_value", + selected_repository_ids=[repo.repo_id]) + ``` + ## Import This resource can be imported using an ID made up of the variable name: @@ -284,6 +308,30 @@ def __init__(__self__, This resource allows you to create and manage GitHub Actions variables within your GitHub organization. You must have write access to a repository to use this resource. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example_variable = github.ActionsOrganizationVariable("exampleVariable", + value="example_variable_value", + variable_name="example_variable_name", + visibility="private") + ``` + + ```python + import pulumi + import pulumi_github as github + + repo = github.get_repository(full_name="my-org/repo") + example_variable = github.ActionsOrganizationVariable("exampleVariable", + variable_name="example_variable_name", + visibility="selected", + value="example_variable_value", + selected_repository_ids=[repo.repo_id]) + ``` + ## Import This resource can be imported using an ID made up of the variable name: diff --git a/sdk/python/pulumi_github/actions_repository_access_level.py b/sdk/python/pulumi_github/actions_repository_access_level.py index aed6691b..670ab881 100644 --- a/sdk/python/pulumi_github/actions_repository_access_level.py +++ b/sdk/python/pulumi_github/actions_repository_access_level.py @@ -135,6 +135,18 @@ def __init__(__self__, This resource allows you to set the access level of a non-public repositories actions and reusable workflows for use in other repositories. You must have admin access to a repository to use this resource. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example = github.Repository("example", visibility="private") + test = github.ActionsRepositoryAccessLevel("test", + access_level="user", + repository=example.name) + ``` + ## Import This resource can be imported using the name of the GitHub repository: @@ -158,6 +170,18 @@ def __init__(__self__, This resource allows you to set the access level of a non-public repositories actions and reusable workflows for use in other repositories. You must have admin access to a repository to use this resource. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example = github.Repository("example", visibility="private") + test = github.ActionsRepositoryAccessLevel("test", + access_level="user", + repository=example.name) + ``` + ## Import This resource can be imported using the name of the GitHub repository: diff --git a/sdk/python/pulumi_github/actions_repository_oidc_subject_claim_customization_template.py b/sdk/python/pulumi_github/actions_repository_oidc_subject_claim_customization_template.py index 47c1f7cf..2b17125c 100644 --- a/sdk/python/pulumi_github/actions_repository_oidc_subject_claim_customization_template.py +++ b/sdk/python/pulumi_github/actions_repository_oidc_subject_claim_customization_template.py @@ -191,6 +191,23 @@ def __init__(__self__, | `false` | Set | `include_claim_keys` | | `false` | Unset | Organization's default if set, otherwise GitHub's default | + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example = github.Repository("example") + example_template = github.ActionsRepositoryOidcSubjectClaimCustomizationTemplate("exampleTemplate", + repository=example.name, + use_default=False, + include_claim_keys=[ + "actor", + "context", + "repository_owner", + ]) + ``` + ## Import This resource can be imported using the repository's name. @@ -227,6 +244,23 @@ def __init__(__self__, | `false` | Set | `include_claim_keys` | | `false` | Unset | Organization's default if set, otherwise GitHub's default | + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example = github.Repository("example") + example_template = github.ActionsRepositoryOidcSubjectClaimCustomizationTemplate("exampleTemplate", + repository=example.name, + use_default=False, + include_claim_keys=[ + "actor", + "context", + "repository_owner", + ]) + ``` + ## Import This resource can be imported using the repository's name. diff --git a/sdk/python/pulumi_github/actions_repository_permissions.py b/sdk/python/pulumi_github/actions_repository_permissions.py index c83e0f8d..a5ee2211 100644 --- a/sdk/python/pulumi_github/actions_repository_permissions.py +++ b/sdk/python/pulumi_github/actions_repository_permissions.py @@ -214,6 +214,26 @@ def __init__(__self__, This resource allows you to enable and manage GitHub Actions permissions for a given repository. You must have admin access to an repository to use this resource. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example = github.Repository("example") + test = github.ActionsRepositoryPermissions("test", + allowed_actions="selected", + allowed_actions_config=github.ActionsRepositoryPermissionsAllowedActionsConfigArgs( + github_owned_allowed=True, + patterns_alloweds=[ + "actions/cache@*", + "actions/checkout@*", + ], + verified_allowed=True, + ), + repository=example.name) + ``` + ## Import This resource can be imported using the name of the GitHub repository: @@ -239,6 +259,26 @@ def __init__(__self__, This resource allows you to enable and manage GitHub Actions permissions for a given repository. You must have admin access to an repository to use this resource. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example = github.Repository("example") + test = github.ActionsRepositoryPermissions("test", + allowed_actions="selected", + allowed_actions_config=github.ActionsRepositoryPermissionsAllowedActionsConfigArgs( + github_owned_allowed=True, + patterns_alloweds=[ + "actions/cache@*", + "actions/checkout@*", + ], + verified_allowed=True, + ), + repository=example.name) + ``` + ## Import This resource can be imported using the name of the GitHub repository: diff --git a/sdk/python/pulumi_github/actions_runner_group.py b/sdk/python/pulumi_github/actions_runner_group.py index 22818830..8d528125 100644 --- a/sdk/python/pulumi_github/actions_runner_group.py +++ b/sdk/python/pulumi_github/actions_runner_group.py @@ -388,6 +388,18 @@ def __init__(__self__, This resource allows you to create and manage GitHub Actions runner groups within your GitHub enterprise organizations. You must have admin access to an organization to use this resource. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example_repository = github.Repository("exampleRepository") + example_actions_runner_group = github.ActionsRunnerGroup("exampleActionsRunnerGroup", + visibility="selected", + selected_repository_ids=[example_repository.repo_id]) + ``` + ## Import This resource can be imported using the ID of the runner group: @@ -415,6 +427,18 @@ def __init__(__self__, This resource allows you to create and manage GitHub Actions runner groups within your GitHub enterprise organizations. You must have admin access to an organization to use this resource. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example_repository = github.Repository("exampleRepository") + example_actions_runner_group = github.ActionsRunnerGroup("exampleActionsRunnerGroup", + visibility="selected", + selected_repository_ids=[example_repository.repo_id]) + ``` + ## Import This resource can be imported using the ID of the runner group: diff --git a/sdk/python/pulumi_github/actions_secret.py b/sdk/python/pulumi_github/actions_secret.py index cc071c44..8d55b420 100644 --- a/sdk/python/pulumi_github/actions_secret.py +++ b/sdk/python/pulumi_github/actions_secret.py @@ -254,6 +254,23 @@ def __init__(__self__, secret_name: Optional[pulumi.Input[str]] = None, __props__=None): """ + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example_public_key = github.get_actions_public_key(repository="example_repository") + example_secret_actions_secret = github.ActionsSecret("exampleSecretActionsSecret", + repository="example_repository", + secret_name="example_secret_name", + plaintext_value=var["some_secret_string"]) + example_secret_index_actions_secret_actions_secret = github.ActionsSecret("exampleSecretIndex/actionsSecretActionsSecret", + repository="example_repository", + secret_name="example_secret_name", + encrypted_value=var["some_encrypted_secret_string"]) + ``` + ## Import This resource can be imported using an ID made up of the `repository` and `secret_name`: @@ -277,6 +294,23 @@ def __init__(__self__, args: ActionsSecretArgs, opts: Optional[pulumi.ResourceOptions] = None): """ + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example_public_key = github.get_actions_public_key(repository="example_repository") + example_secret_actions_secret = github.ActionsSecret("exampleSecretActionsSecret", + repository="example_repository", + secret_name="example_secret_name", + plaintext_value=var["some_secret_string"]) + example_secret_index_actions_secret_actions_secret = github.ActionsSecret("exampleSecretIndex/actionsSecretActionsSecret", + repository="example_repository", + secret_name="example_secret_name", + encrypted_value=var["some_encrypted_secret_string"]) + ``` + ## Import This resource can be imported using an ID made up of the `repository` and `secret_name`: diff --git a/sdk/python/pulumi_github/actions_variable.py b/sdk/python/pulumi_github/actions_variable.py index 81845cfb..dfa88bbb 100644 --- a/sdk/python/pulumi_github/actions_variable.py +++ b/sdk/python/pulumi_github/actions_variable.py @@ -213,6 +213,18 @@ def __init__(__self__, This resource allows you to create and manage GitHub Actions variables within your GitHub repositories. You must have write access to a repository to use this resource. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example_variable = github.ActionsVariable("exampleVariable", + repository="example_repository", + value="example_variable_value", + variable_name="example_variable_name") + ``` + ## Import GitHub Actions variables can be imported using an ID made up of `repository:variable_name`, e.g. @@ -237,6 +249,18 @@ def __init__(__self__, This resource allows you to create and manage GitHub Actions variables within your GitHub repositories. You must have write access to a repository to use this resource. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example_variable = github.ActionsVariable("exampleVariable", + repository="example_repository", + value="example_variable_value", + variable_name="example_variable_name") + ``` + ## Import GitHub Actions variables can be imported using an ID made up of `repository:variable_name`, e.g. diff --git a/sdk/python/pulumi_github/app_installation_repository.py b/sdk/python/pulumi_github/app_installation_repository.py index 3918f737..96dcdb41 100644 --- a/sdk/python/pulumi_github/app_installation_repository.py +++ b/sdk/python/pulumi_github/app_installation_repository.py @@ -160,6 +160,19 @@ def __init__(__self__, by the following the instructions at this [link](https://docs.github.com/en/github/setting-up-and-managing-organizations-and-teams/reviewing-your-organizations-installed-integrations). + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + # Create a repository. + some_repo = github.Repository("someRepo") + some_app_repo = github.AppInstallationRepository("someAppRepo", + installation_id="1234567", + repository=some_repo.name) + ``` + ## Import GitHub App Installation Repository can be imported using an ID made up of `installation_id:repository`, e.g. @@ -192,6 +205,19 @@ def __init__(__self__, by the following the instructions at this [link](https://docs.github.com/en/github/setting-up-and-managing-organizations-and-teams/reviewing-your-organizations-installed-integrations). + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + # Create a repository. + some_repo = github.Repository("someRepo") + some_app_repo = github.AppInstallationRepository("someAppRepo", + installation_id="1234567", + repository=some_repo.name) + ``` + ## Import GitHub App Installation Repository can be imported using an ID made up of `installation_id:repository`, e.g. diff --git a/sdk/python/pulumi_github/branch.py b/sdk/python/pulumi_github/branch.py index a88b055d..9cbc9862 100644 --- a/sdk/python/pulumi_github/branch.py +++ b/sdk/python/pulumi_github/branch.py @@ -269,6 +269,17 @@ def __init__(__self__, Additional constraints can be applied to ensure your branch is created from another branch or commit. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + development = github.Branch("development", + branch="development", + repository="example") + ``` + ## Import GitHub Branch can be imported using an ID made up of `repository:branch`, e.g. @@ -306,6 +317,17 @@ def __init__(__self__, Additional constraints can be applied to ensure your branch is created from another branch or commit. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + development = github.Branch("development", + branch="development", + repository="example") + ``` + ## Import GitHub Branch can be imported using an ID made up of `repository:branch`, e.g. diff --git a/sdk/python/pulumi_github/branch_default.py b/sdk/python/pulumi_github/branch_default.py index 903702d0..c2bea1d7 100644 --- a/sdk/python/pulumi_github/branch_default.py +++ b/sdk/python/pulumi_github/branch_default.py @@ -171,6 +171,40 @@ def __init__(__self__, Note that use of this resource is incompatible with the `default_branch` option of the `Repository` resource. Using both will result in plans always showing a diff. + ## Example Usage + + Basic usage: + + ```python + import pulumi + import pulumi_github as github + + example = github.Repository("example", + description="My awesome codebase", + auto_init=True) + development = github.Branch("development", + repository=example.name, + branch="development") + default = github.BranchDefault("default", + repository=example.name, + branch=development.branch) + ``` + + Renaming to a branch that doesn't exist: + + ```python + import pulumi + import pulumi_github as github + + example = github.Repository("example", + description="My awesome codebase", + auto_init=True) + default = github.BranchDefault("default", + repository=example.name, + branch="development", + rename=True) + ``` + ## Import GitHub Branch Defaults can be imported using an ID made up of `repository`, e.g. @@ -198,6 +232,40 @@ def __init__(__self__, Note that use of this resource is incompatible with the `default_branch` option of the `Repository` resource. Using both will result in plans always showing a diff. + ## Example Usage + + Basic usage: + + ```python + import pulumi + import pulumi_github as github + + example = github.Repository("example", + description="My awesome codebase", + auto_init=True) + development = github.Branch("development", + repository=example.name, + branch="development") + default = github.BranchDefault("default", + repository=example.name, + branch=development.branch) + ``` + + Renaming to a branch that doesn't exist: + + ```python + import pulumi + import pulumi_github as github + + example = github.Repository("example", + description="My awesome codebase", + auto_init=True) + default = github.BranchDefault("default", + repository=example.name, + branch="development", + rename=True) + ``` + ## Import GitHub Branch Defaults can be imported using an ID made up of `repository`, e.g. diff --git a/sdk/python/pulumi_github/branch_protection.py b/sdk/python/pulumi_github/branch_protection.py index 293d2fc0..70938128 100644 --- a/sdk/python/pulumi_github/branch_protection.py +++ b/sdk/python/pulumi_github/branch_protection.py @@ -626,6 +626,53 @@ def __init__(__self__, required_status_checks: Optional[pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['BranchProtectionRequiredStatusCheckArgs']]]]] = None, __props__=None): """ + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example_repository = github.Repository("exampleRepository") + example_user = github.get_user(username="example") + example_team = github.Team("exampleTeam") + # Protect the main branch of the foo repository. Additionally, require that + # the "ci/travis" context to be passing and only allow the engineers team merge + # to the branch. + example_branch_protection = github.BranchProtection("exampleBranchProtection", + repository_id=example_repository.node_id, + pattern="main", + enforce_admins=True, + allows_deletions=True, + required_status_checks=[github.BranchProtectionRequiredStatusCheckArgs( + strict=False, + contexts=["ci/travis"], + )], + required_pull_request_reviews=[github.BranchProtectionRequiredPullRequestReviewArgs( + dismiss_stale_reviews=True, + restrict_dismissals=True, + dismissal_restrictions=[ + example_user.node_id, + example_team.node_id, + "/exampleuser", + "exampleorganization/exampleteam", + ], + )], + push_restrictions=[ + example_user.node_id, + "/exampleuser", + "exampleorganization/exampleteam", + ], + force_push_bypassers=[ + example_user.node_id, + "/exampleuser", + "exampleorganization/exampleteam", + ]) + example_team_repository = github.TeamRepository("exampleTeamRepository", + team_id=example_team.id, + repository=example_repository.name, + permission="pull") + ``` + ## Import GitHub Branch Protection can be imported using an ID made up of `repository:pattern`, e.g. @@ -658,6 +705,53 @@ def __init__(__self__, args: BranchProtectionArgs, opts: Optional[pulumi.ResourceOptions] = None): """ + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example_repository = github.Repository("exampleRepository") + example_user = github.get_user(username="example") + example_team = github.Team("exampleTeam") + # Protect the main branch of the foo repository. Additionally, require that + # the "ci/travis" context to be passing and only allow the engineers team merge + # to the branch. + example_branch_protection = github.BranchProtection("exampleBranchProtection", + repository_id=example_repository.node_id, + pattern="main", + enforce_admins=True, + allows_deletions=True, + required_status_checks=[github.BranchProtectionRequiredStatusCheckArgs( + strict=False, + contexts=["ci/travis"], + )], + required_pull_request_reviews=[github.BranchProtectionRequiredPullRequestReviewArgs( + dismiss_stale_reviews=True, + restrict_dismissals=True, + dismissal_restrictions=[ + example_user.node_id, + example_team.node_id, + "/exampleuser", + "exampleorganization/exampleteam", + ], + )], + push_restrictions=[ + example_user.node_id, + "/exampleuser", + "exampleorganization/exampleteam", + ], + force_push_bypassers=[ + example_user.node_id, + "/exampleuser", + "exampleorganization/exampleteam", + ]) + example_team_repository = github.TeamRepository("exampleTeamRepository", + team_id=example_team.id, + repository=example_repository.name, + permission="pull") + ``` + ## Import GitHub Branch Protection can be imported using an ID made up of `repository:pattern`, e.g. diff --git a/sdk/python/pulumi_github/branch_protection_v3.py b/sdk/python/pulumi_github/branch_protection_v3.py index bd6d804a..bdef3862 100644 --- a/sdk/python/pulumi_github/branch_protection_v3.py +++ b/sdk/python/pulumi_github/branch_protection_v3.py @@ -392,6 +392,59 @@ def __init__(__self__, This resource allows you to configure branch protection for repositories in your organization. When applied, the branch will be protected from forced pushes and deletion. Additional constraints, such as required status checks or restrictions on users, teams, and apps, can also be configured. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + # Protect the main branch of the foo repository. Only allow a specific user to merge to the branch. + example = github.BranchProtectionV3("example", + repository=github_repository["example"]["name"], + branch="main", + restrictions=github.BranchProtectionV3RestrictionsArgs( + users=["foo-user"], + )) + ``` + + ```python + import pulumi + import pulumi_github as github + + example_repository = github.Repository("exampleRepository") + example_team = github.Team("exampleTeam") + # Protect the main branch of the foo repository. Additionally, require that + # the "ci/check" check ran by the Github Actions app is passing and only allow + # the engineers team merge to the branch. + example_branch_protection_v3 = github.BranchProtectionV3("exampleBranchProtectionV3", + repository=example_repository.name, + branch="main", + enforce_admins=True, + required_status_checks=github.BranchProtectionV3RequiredStatusChecksArgs( + strict=False, + checks=["ci/check:824642007264"], + ), + required_pull_request_reviews=github.BranchProtectionV3RequiredPullRequestReviewsArgs( + dismiss_stale_reviews=True, + dismissal_users=["foo-user"], + dismissal_teams=[example_team.slug], + bypass_pull_request_allowances=github.BranchProtectionV3RequiredPullRequestReviewsBypassPullRequestAllowancesArgs( + users=["foo-user"], + teams=[example_team.slug], + apps=["foo-app"], + ), + ), + restrictions=github.BranchProtectionV3RestrictionsArgs( + users=["foo-user"], + teams=[example_team.slug], + apps=["foo-app"], + )) + example_team_repository = github.TeamRepository("exampleTeamRepository", + team_id=example_team.id, + repository=example_repository.name, + permission="pull") + ``` + ## Import GitHub Branch Protection can be imported using an ID made up of `repository:branch`, e.g. @@ -424,6 +477,59 @@ def __init__(__self__, This resource allows you to configure branch protection for repositories in your organization. When applied, the branch will be protected from forced pushes and deletion. Additional constraints, such as required status checks or restrictions on users, teams, and apps, can also be configured. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + # Protect the main branch of the foo repository. Only allow a specific user to merge to the branch. + example = github.BranchProtectionV3("example", + repository=github_repository["example"]["name"], + branch="main", + restrictions=github.BranchProtectionV3RestrictionsArgs( + users=["foo-user"], + )) + ``` + + ```python + import pulumi + import pulumi_github as github + + example_repository = github.Repository("exampleRepository") + example_team = github.Team("exampleTeam") + # Protect the main branch of the foo repository. Additionally, require that + # the "ci/check" check ran by the Github Actions app is passing and only allow + # the engineers team merge to the branch. + example_branch_protection_v3 = github.BranchProtectionV3("exampleBranchProtectionV3", + repository=example_repository.name, + branch="main", + enforce_admins=True, + required_status_checks=github.BranchProtectionV3RequiredStatusChecksArgs( + strict=False, + checks=["ci/check:824642007264"], + ), + required_pull_request_reviews=github.BranchProtectionV3RequiredPullRequestReviewsArgs( + dismiss_stale_reviews=True, + dismissal_users=["foo-user"], + dismissal_teams=[example_team.slug], + bypass_pull_request_allowances=github.BranchProtectionV3RequiredPullRequestReviewsBypassPullRequestAllowancesArgs( + users=["foo-user"], + teams=[example_team.slug], + apps=["foo-app"], + ), + ), + restrictions=github.BranchProtectionV3RestrictionsArgs( + users=["foo-user"], + teams=[example_team.slug], + apps=["foo-app"], + )) + example_team_repository = github.TeamRepository("exampleTeamRepository", + team_id=example_team.id, + repository=example_repository.name, + permission="pull") + ``` + ## Import GitHub Branch Protection can be imported using an ID made up of `repository:branch`, e.g. diff --git a/sdk/python/pulumi_github/codespaces_organization_secret.py b/sdk/python/pulumi_github/codespaces_organization_secret.py index df186a0e..b6ce7502 100644 --- a/sdk/python/pulumi_github/codespaces_organization_secret.py +++ b/sdk/python/pulumi_github/codespaces_organization_secret.py @@ -299,6 +299,39 @@ def __init__(__self__, visibility: Optional[pulumi.Input[str]] = None, __props__=None): """ + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example_secret_codespaces_organization_secret = github.CodespacesOrganizationSecret("exampleSecretCodespacesOrganizationSecret", + secret_name="example_secret_name", + visibility="private", + plaintext_value=var["some_secret_string"]) + example_secret_index_codespaces_organization_secret_codespaces_organization_secret = github.CodespacesOrganizationSecret("exampleSecretIndex/codespacesOrganizationSecretCodespacesOrganizationSecret", + secret_name="example_secret_name", + visibility="private", + encrypted_value=var["some_encrypted_secret_string"]) + ``` + + ```python + import pulumi + import pulumi_github as github + + repo = github.get_repository(full_name="my-org/repo") + example_secret_codespaces_organization_secret = github.CodespacesOrganizationSecret("exampleSecretCodespacesOrganizationSecret", + secret_name="example_secret_name", + visibility="selected", + plaintext_value=var["some_secret_string"], + selected_repository_ids=[repo.repo_id]) + example_secret_index_codespaces_organization_secret_codespaces_organization_secret = github.CodespacesOrganizationSecret("exampleSecretIndex/codespacesOrganizationSecretCodespacesOrganizationSecret", + secret_name="example_secret_name", + visibility="selected", + encrypted_value=var["some_encrypted_secret_string"], + selected_repository_ids=[repo.repo_id]) + ``` + ## Import This resource can be imported using an ID made up of the secret name @@ -325,6 +358,39 @@ def __init__(__self__, args: CodespacesOrganizationSecretArgs, opts: Optional[pulumi.ResourceOptions] = None): """ + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example_secret_codespaces_organization_secret = github.CodespacesOrganizationSecret("exampleSecretCodespacesOrganizationSecret", + secret_name="example_secret_name", + visibility="private", + plaintext_value=var["some_secret_string"]) + example_secret_index_codespaces_organization_secret_codespaces_organization_secret = github.CodespacesOrganizationSecret("exampleSecretIndex/codespacesOrganizationSecretCodespacesOrganizationSecret", + secret_name="example_secret_name", + visibility="private", + encrypted_value=var["some_encrypted_secret_string"]) + ``` + + ```python + import pulumi + import pulumi_github as github + + repo = github.get_repository(full_name="my-org/repo") + example_secret_codespaces_organization_secret = github.CodespacesOrganizationSecret("exampleSecretCodespacesOrganizationSecret", + secret_name="example_secret_name", + visibility="selected", + plaintext_value=var["some_secret_string"], + selected_repository_ids=[repo.repo_id]) + example_secret_index_codespaces_organization_secret_codespaces_organization_secret = github.CodespacesOrganizationSecret("exampleSecretIndex/codespacesOrganizationSecretCodespacesOrganizationSecret", + secret_name="example_secret_name", + visibility="selected", + encrypted_value=var["some_encrypted_secret_string"], + selected_repository_ids=[repo.repo_id]) + ``` + ## Import This resource can be imported using an ID made up of the secret name diff --git a/sdk/python/pulumi_github/codespaces_organization_secret_repositories.py b/sdk/python/pulumi_github/codespaces_organization_secret_repositories.py index bba31ccb..d1a865bd 100644 --- a/sdk/python/pulumi_github/codespaces_organization_secret_repositories.py +++ b/sdk/python/pulumi_github/codespaces_organization_secret_repositories.py @@ -142,6 +142,18 @@ def __init__(__self__, This resource is only applicable when `visibility` of the existing organization secret has been set to `selected`. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + repo = github.get_repository(full_name="my-org/repo") + org_secret_repos = github.CodespacesOrganizationSecretRepositories("orgSecretRepos", + secret_name="existing_secret_name", + selected_repository_ids=[repo.repo_id]) + ``` + ## Import This resource can be imported using an ID made up of the secret name: @@ -168,6 +180,18 @@ def __init__(__self__, This resource is only applicable when `visibility` of the existing organization secret has been set to `selected`. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + repo = github.get_repository(full_name="my-org/repo") + org_secret_repos = github.CodespacesOrganizationSecretRepositories("orgSecretRepos", + secret_name="existing_secret_name", + selected_repository_ids=[repo.repo_id]) + ``` + ## Import This resource can be imported using an ID made up of the secret name: diff --git a/sdk/python/pulumi_github/codespaces_secret.py b/sdk/python/pulumi_github/codespaces_secret.py index c5c3b570..c4233f2a 100644 --- a/sdk/python/pulumi_github/codespaces_secret.py +++ b/sdk/python/pulumi_github/codespaces_secret.py @@ -254,6 +254,23 @@ def __init__(__self__, secret_name: Optional[pulumi.Input[str]] = None, __props__=None): """ + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example_public_key = github.get_codespaces_public_key(repository="example_repository") + example_secret_codespaces_secret = github.CodespacesSecret("exampleSecretCodespacesSecret", + repository="example_repository", + secret_name="example_secret_name", + plaintext_value=var["some_secret_string"]) + example_secret_index_codespaces_secret_codespaces_secret = github.CodespacesSecret("exampleSecretIndex/codespacesSecretCodespacesSecret", + repository="example_repository", + secret_name="example_secret_name", + encrypted_value=var["some_encrypted_secret_string"]) + ``` + ## Import This resource can be imported using an ID made up of the `repository` and `secret_name`: @@ -277,6 +294,23 @@ def __init__(__self__, args: CodespacesSecretArgs, opts: Optional[pulumi.ResourceOptions] = None): """ + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example_public_key = github.get_codespaces_public_key(repository="example_repository") + example_secret_codespaces_secret = github.CodespacesSecret("exampleSecretCodespacesSecret", + repository="example_repository", + secret_name="example_secret_name", + plaintext_value=var["some_secret_string"]) + example_secret_index_codespaces_secret_codespaces_secret = github.CodespacesSecret("exampleSecretIndex/codespacesSecretCodespacesSecret", + repository="example_repository", + secret_name="example_secret_name", + encrypted_value=var["some_encrypted_secret_string"]) + ``` + ## Import This resource can be imported using an ID made up of the `repository` and `secret_name`: diff --git a/sdk/python/pulumi_github/codespaces_user_secret.py b/sdk/python/pulumi_github/codespaces_user_secret.py index 406c0f2d..825c1133 100644 --- a/sdk/python/pulumi_github/codespaces_user_secret.py +++ b/sdk/python/pulumi_github/codespaces_user_secret.py @@ -257,6 +257,23 @@ def __init__(__self__, selected_repository_ids: Optional[pulumi.Input[Sequence[pulumi.Input[int]]]] = None, __props__=None): """ + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + repo = github.get_repository(full_name="my-org/repo") + example_secret_codespaces_user_secret = github.CodespacesUserSecret("exampleSecretCodespacesUserSecret", + secret_name="example_secret_name", + plaintext_value=var["some_secret_string"], + selected_repository_ids=[repo.repo_id]) + example_secret_index_codespaces_user_secret_codespaces_user_secret = github.CodespacesUserSecret("exampleSecretIndex/codespacesUserSecretCodespacesUserSecret", + secret_name="example_secret_name", + encrypted_value=var["some_encrypted_secret_string"], + selected_repository_ids=[repo.repo_id]) + ``` + ## Import This resource can be imported using an ID made up of the secret name @@ -281,6 +298,23 @@ def __init__(__self__, args: CodespacesUserSecretArgs, opts: Optional[pulumi.ResourceOptions] = None): """ + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + repo = github.get_repository(full_name="my-org/repo") + example_secret_codespaces_user_secret = github.CodespacesUserSecret("exampleSecretCodespacesUserSecret", + secret_name="example_secret_name", + plaintext_value=var["some_secret_string"], + selected_repository_ids=[repo.repo_id]) + example_secret_index_codespaces_user_secret_codespaces_user_secret = github.CodespacesUserSecret("exampleSecretIndex/codespacesUserSecretCodespacesUserSecret", + secret_name="example_secret_name", + encrypted_value=var["some_encrypted_secret_string"], + selected_repository_ids=[repo.repo_id]) + ``` + ## Import This resource can be imported using an ID made up of the secret name diff --git a/sdk/python/pulumi_github/emu_group_mapping.py b/sdk/python/pulumi_github/emu_group_mapping.py index 6a74bbeb..387cc7a3 100644 --- a/sdk/python/pulumi_github/emu_group_mapping.py +++ b/sdk/python/pulumi_github/emu_group_mapping.py @@ -152,6 +152,18 @@ def __init__(__self__, """ This resource manages mappings between external groups for enterprise managed users and GitHub teams. It wraps the API detailed [here](https://docs.github.com/en/rest/reference/teams#external-groups). Note that this is a distinct resource from `TeamSyncGroupMapping`. `EmuGroupMapping` is special to the Enterprise Managed User (EMU) external group feature, whereas `TeamSyncGroupMapping` is specific to Identity Provider Groups. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example_emu_group_mapping = github.EmuGroupMapping("exampleEmuGroupMapping", + group_id=28836, + team_slug="emu-test-team") + # The GitHub team name to modify + ``` + ## Import GitHub EMU External Group Mappings can be imported using the external `group_id`, e.g. @@ -174,6 +186,18 @@ def __init__(__self__, """ This resource manages mappings between external groups for enterprise managed users and GitHub teams. It wraps the API detailed [here](https://docs.github.com/en/rest/reference/teams#external-groups). Note that this is a distinct resource from `TeamSyncGroupMapping`. `EmuGroupMapping` is special to the Enterprise Managed User (EMU) external group feature, whereas `TeamSyncGroupMapping` is specific to Identity Provider Groups. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example_emu_group_mapping = github.EmuGroupMapping("exampleEmuGroupMapping", + group_id=28836, + team_slug="emu-test-team") + # The GitHub team name to modify + ``` + ## Import GitHub EMU External Group Mappings can be imported using the external `group_id`, e.g. diff --git a/sdk/python/pulumi_github/enterprise_organization.py b/sdk/python/pulumi_github/enterprise_organization.py index 19a5a75e..7ca39df2 100644 --- a/sdk/python/pulumi_github/enterprise_organization.py +++ b/sdk/python/pulumi_github/enterprise_organization.py @@ -295,6 +295,20 @@ def __init__(__self__, """ This resource allows you to create and manage a GitHub enterprise organization. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + org = github.EnterpriseOrganization("org", + enterprise_id=data["github_enterprise"]["enterprise"]["id"], + display_name="Some Awesome Org", + description="Organization created with terraform", + billing_email="jon@winteriscoming.com", + admin_logins=["jon-snow"]) + ``` + ## Import GitHub Enterprise Organization can be imported using the `slug` of the enterprise, combined with the `orgname` of the organization, separated by a `/` character. @@ -321,6 +335,20 @@ def __init__(__self__, """ This resource allows you to create and manage a GitHub enterprise organization. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + org = github.EnterpriseOrganization("org", + enterprise_id=data["github_enterprise"]["enterprise"]["id"], + display_name="Some Awesome Org", + description="Organization created with terraform", + billing_email="jon@winteriscoming.com", + admin_logins=["jon-snow"]) + ``` + ## Import GitHub Enterprise Organization can be imported using the `slug` of the enterprise, combined with the `orgname` of the organization, separated by a `/` character. diff --git a/sdk/python/pulumi_github/get_actions_environment_secrets.py b/sdk/python/pulumi_github/get_actions_environment_secrets.py index 7870f577..7746ef2a 100644 --- a/sdk/python/pulumi_github/get_actions_environment_secrets.py +++ b/sdk/python/pulumi_github/get_actions_environment_secrets.py @@ -94,6 +94,16 @@ def get_actions_environment_secrets(environment: Optional[str] = None, """ Use this data source to retrieve the list of secrets of the repository environment. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example = github.get_actions_environment_secrets(environment="exampleEnvironment", + name="exampleRepo") + ``` + :param str name: Name of the secret """ @@ -120,6 +130,16 @@ def get_actions_environment_secrets_output(environment: Optional[pulumi.Input[st """ Use this data source to retrieve the list of secrets of the repository environment. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example = github.get_actions_environment_secrets(environment="exampleEnvironment", + name="exampleRepo") + ``` + :param str name: Name of the secret """ diff --git a/sdk/python/pulumi_github/get_actions_environment_variables.py b/sdk/python/pulumi_github/get_actions_environment_variables.py index 215ed401..a34d2fa9 100644 --- a/sdk/python/pulumi_github/get_actions_environment_variables.py +++ b/sdk/python/pulumi_github/get_actions_environment_variables.py @@ -94,6 +94,16 @@ def get_actions_environment_variables(environment: Optional[str] = None, """ Use this data source to retrieve the list of variables of the repository environment. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example = github.get_actions_environment_variables(environment="exampleEnvironment", + name="exampleRepo") + ``` + :param str name: Name of the variable """ @@ -120,6 +130,16 @@ def get_actions_environment_variables_output(environment: Optional[pulumi.Input[ """ Use this data source to retrieve the list of variables of the repository environment. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example = github.get_actions_environment_variables(environment="exampleEnvironment", + name="exampleRepo") + ``` + :param str name: Name of the variable """ diff --git a/sdk/python/pulumi_github/get_actions_organization_oidc_subject_claim_customization_template.py b/sdk/python/pulumi_github/get_actions_organization_oidc_subject_claim_customization_template.py index 2aa84419..c3aa369f 100644 --- a/sdk/python/pulumi_github/get_actions_organization_oidc_subject_claim_customization_template.py +++ b/sdk/python/pulumi_github/get_actions_organization_oidc_subject_claim_customization_template.py @@ -59,6 +59,15 @@ def __await__(self): def get_actions_organization_oidc_subject_claim_customization_template(opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetActionsOrganizationOidcSubjectClaimCustomizationTemplateResult: """ Use this data source to retrieve the OpenID Connect subject claim customization template for an organization + + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example = github.get_actions_organization_oidc_subject_claim_customization_template() + ``` """ __args__ = dict() opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts) @@ -73,5 +82,14 @@ def get_actions_organization_oidc_subject_claim_customization_template(opts: Opt def get_actions_organization_oidc_subject_claim_customization_template_output(opts: Optional[pulumi.InvokeOptions] = None) -> pulumi.Output[GetActionsOrganizationOidcSubjectClaimCustomizationTemplateResult]: """ Use this data source to retrieve the OpenID Connect subject claim customization template for an organization + + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example = github.get_actions_organization_oidc_subject_claim_customization_template() + ``` """ ... diff --git a/sdk/python/pulumi_github/get_actions_organization_public_key.py b/sdk/python/pulumi_github/get_actions_organization_public_key.py index d9132738..2abe9dfa 100644 --- a/sdk/python/pulumi_github/get_actions_organization_public_key.py +++ b/sdk/python/pulumi_github/get_actions_organization_public_key.py @@ -72,6 +72,15 @@ def get_actions_organization_public_key(opts: Optional[pulumi.InvokeOptions] = N """ Use this data source to retrieve information about a GitHub Actions Organization public key. This data source is required to be used with other GitHub secrets interactions. Note that the provider `token` must have admin rights to an organization to retrieve it's action public key. + + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example = github.get_actions_organization_public_key() + ``` """ __args__ = dict() opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts) @@ -88,5 +97,14 @@ def get_actions_organization_public_key_output(opts: Optional[pulumi.InvokeOptio """ Use this data source to retrieve information about a GitHub Actions Organization public key. This data source is required to be used with other GitHub secrets interactions. Note that the provider `token` must have admin rights to an organization to retrieve it's action public key. + + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example = github.get_actions_organization_public_key() + ``` """ ... diff --git a/sdk/python/pulumi_github/get_actions_organization_registration_token.py b/sdk/python/pulumi_github/get_actions_organization_registration_token.py index 5975156d..cabbbffe 100644 --- a/sdk/python/pulumi_github/get_actions_organization_registration_token.py +++ b/sdk/python/pulumi_github/get_actions_organization_registration_token.py @@ -71,6 +71,15 @@ def __await__(self): def get_actions_organization_registration_token(opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetActionsOrganizationRegistrationTokenResult: """ Use this data source to retrieve a GitHub Actions organization registration token. This token can then be used to register a self-hosted runner. + + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example = github.get_actions_organization_registration_token() + ``` """ __args__ = dict() opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts) @@ -86,5 +95,14 @@ def get_actions_organization_registration_token(opts: Optional[pulumi.InvokeOpti def get_actions_organization_registration_token_output(opts: Optional[pulumi.InvokeOptions] = None) -> pulumi.Output[GetActionsOrganizationRegistrationTokenResult]: """ Use this data source to retrieve a GitHub Actions organization registration token. This token can then be used to register a self-hosted runner. + + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example = github.get_actions_organization_registration_token() + ``` """ ... diff --git a/sdk/python/pulumi_github/get_actions_organization_secrets.py b/sdk/python/pulumi_github/get_actions_organization_secrets.py index a1b88122..60176a68 100644 --- a/sdk/python/pulumi_github/get_actions_organization_secrets.py +++ b/sdk/python/pulumi_github/get_actions_organization_secrets.py @@ -60,6 +60,15 @@ def __await__(self): def get_actions_organization_secrets(opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetActionsOrganizationSecretsResult: """ Use this data source to retrieve the list of secrets of the organization. + + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example = github.get_actions_organization_secrets() + ``` """ __args__ = dict() opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts) @@ -74,5 +83,14 @@ def get_actions_organization_secrets(opts: Optional[pulumi.InvokeOptions] = None def get_actions_organization_secrets_output(opts: Optional[pulumi.InvokeOptions] = None) -> pulumi.Output[GetActionsOrganizationSecretsResult]: """ Use this data source to retrieve the list of secrets of the organization. + + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example = github.get_actions_organization_secrets() + ``` """ ... diff --git a/sdk/python/pulumi_github/get_actions_organization_variables.py b/sdk/python/pulumi_github/get_actions_organization_variables.py index 1d242bad..68b40dff 100644 --- a/sdk/python/pulumi_github/get_actions_organization_variables.py +++ b/sdk/python/pulumi_github/get_actions_organization_variables.py @@ -60,6 +60,15 @@ def __await__(self): def get_actions_organization_variables(opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetActionsOrganizationVariablesResult: """ Use this data source to retrieve the list of variables of the organization. + + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example = github.get_actions_organization_variables() + ``` """ __args__ = dict() opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts) @@ -74,5 +83,14 @@ def get_actions_organization_variables(opts: Optional[pulumi.InvokeOptions] = No def get_actions_organization_variables_output(opts: Optional[pulumi.InvokeOptions] = None) -> pulumi.Output[GetActionsOrganizationVariablesResult]: """ Use this data source to retrieve the list of variables of the organization. + + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example = github.get_actions_organization_variables() + ``` """ ... diff --git a/sdk/python/pulumi_github/get_actions_public_key.py b/sdk/python/pulumi_github/get_actions_public_key.py index 3c44b96b..510696b7 100644 --- a/sdk/python/pulumi_github/get_actions_public_key.py +++ b/sdk/python/pulumi_github/get_actions_public_key.py @@ -83,6 +83,15 @@ def get_actions_public_key(repository: Optional[str] = None, Use this data source to retrieve information about a GitHub Actions public key. This data source is required to be used with other GitHub secrets interactions. Note that the provider `token` must have admin rights to a repository to retrieve it's action public key. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example = github.get_actions_public_key(repository="example_repo") + ``` + :param str repository: Name of the repository to get public key from. """ @@ -105,6 +114,15 @@ def get_actions_public_key_output(repository: Optional[pulumi.Input[str]] = None Use this data source to retrieve information about a GitHub Actions public key. This data source is required to be used with other GitHub secrets interactions. Note that the provider `token` must have admin rights to a repository to retrieve it's action public key. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example = github.get_actions_public_key(repository="example_repo") + ``` + :param str repository: Name of the repository to get public key from. """ diff --git a/sdk/python/pulumi_github/get_actions_registration_token.py b/sdk/python/pulumi_github/get_actions_registration_token.py index 977a8f1d..773020b6 100644 --- a/sdk/python/pulumi_github/get_actions_registration_token.py +++ b/sdk/python/pulumi_github/get_actions_registration_token.py @@ -82,6 +82,15 @@ def get_actions_registration_token(repository: Optional[str] = None, """ Use this data source to retrieve a GitHub Actions repository registration token. This token can then be used to register a self-hosted runner. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example = github.get_actions_registration_token(repository="example_repo") + ``` + :param str repository: Name of the repository to get a GitHub Actions registration token for. """ @@ -103,6 +112,15 @@ def get_actions_registration_token_output(repository: Optional[pulumi.Input[str] """ Use this data source to retrieve a GitHub Actions repository registration token. This token can then be used to register a self-hosted runner. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example = github.get_actions_registration_token(repository="example_repo") + ``` + :param str repository: Name of the repository to get a GitHub Actions registration token for. """ diff --git a/sdk/python/pulumi_github/get_actions_repository_oidc_subject_claim_customization_template.py b/sdk/python/pulumi_github/get_actions_repository_oidc_subject_claim_customization_template.py index 48977eaf..1588a935 100644 --- a/sdk/python/pulumi_github/get_actions_repository_oidc_subject_claim_customization_template.py +++ b/sdk/python/pulumi_github/get_actions_repository_oidc_subject_claim_customization_template.py @@ -82,6 +82,15 @@ def get_actions_repository_oidc_subject_claim_customization_template(name: Optio """ Use this data source to retrieve the OpenID Connect subject claim customization template for a repository + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example = github.get_actions_repository_oidc_subject_claim_customization_template(name="example_repository") + ``` + :param str name: Name of the repository to get the OpenID Connect subject claim customization template for. """ @@ -103,6 +112,15 @@ def get_actions_repository_oidc_subject_claim_customization_template_output(name """ Use this data source to retrieve the OpenID Connect subject claim customization template for a repository + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example = github.get_actions_repository_oidc_subject_claim_customization_template(name="example_repository") + ``` + :param str name: Name of the repository to get the OpenID Connect subject claim customization template for. """ diff --git a/sdk/python/pulumi_github/get_actions_secrets.py b/sdk/python/pulumi_github/get_actions_secrets.py index c73eaf81..90e07e1c 100644 --- a/sdk/python/pulumi_github/get_actions_secrets.py +++ b/sdk/python/pulumi_github/get_actions_secrets.py @@ -84,6 +84,15 @@ def get_actions_secrets(full_name: Optional[str] = None, """ Use this data source to retrieve the list of secrets for a GitHub repository. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example = github.get_actions_secrets(name="example") + ``` + :param str full_name: Full name of the repository (in `org/name` format). :param str name: The name of the repository. @@ -108,6 +117,15 @@ def get_actions_secrets_output(full_name: Optional[pulumi.Input[Optional[str]]] """ Use this data source to retrieve the list of secrets for a GitHub repository. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example = github.get_actions_secrets(name="example") + ``` + :param str full_name: Full name of the repository (in `org/name` format). :param str name: The name of the repository. diff --git a/sdk/python/pulumi_github/get_actions_variables.py b/sdk/python/pulumi_github/get_actions_variables.py index a03e4782..9bc133e2 100644 --- a/sdk/python/pulumi_github/get_actions_variables.py +++ b/sdk/python/pulumi_github/get_actions_variables.py @@ -84,6 +84,15 @@ def get_actions_variables(full_name: Optional[str] = None, """ Use this data source to retrieve the list of variables for a GitHub repository. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example = github.get_actions_variables(name="example") + ``` + :param str full_name: Full name of the repository (in `org/name` format). :param str name: The name of the repository. @@ -108,6 +117,15 @@ def get_actions_variables_output(full_name: Optional[pulumi.Input[Optional[str]] """ Use this data source to retrieve the list of variables for a GitHub repository. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example = github.get_actions_variables(name="example") + ``` + :param str full_name: Full name of the repository (in `org/name` format). :param str name: The name of the repository. diff --git a/sdk/python/pulumi_github/get_app_token.py b/sdk/python/pulumi_github/get_app_token.py index 80cf434d..e64181b1 100644 --- a/sdk/python/pulumi_github/get_app_token.py +++ b/sdk/python/pulumi_github/get_app_token.py @@ -90,6 +90,17 @@ def get_app_token(app_id: Optional[str] = None, """ Use this data source to generate a [GitHub App JWT](https://docs.github.com/en/apps/creating-github-apps/authenticating-with-a-github-app/generating-a-json-web-token-jwt-for-a-github-app). + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + this = github.get_app_token(app_id="123456", + installation_id="78910", + pem_file=(lambda path: open(path).read())("foo/bar.pem")) + ``` + :param str app_id: This is the ID of the GitHub App. :param str installation_id: This is the ID of the GitHub App installation. @@ -118,6 +129,17 @@ def get_app_token_output(app_id: Optional[pulumi.Input[str]] = None, """ Use this data source to generate a [GitHub App JWT](https://docs.github.com/en/apps/creating-github-apps/authenticating-with-a-github-app/generating-a-json-web-token-jwt-for-a-github-app). + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + this = github.get_app_token(app_id="123456", + installation_id="78910", + pem_file=(lambda path: open(path).read())("foo/bar.pem")) + ``` + :param str app_id: This is the ID of the GitHub App. :param str installation_id: This is the ID of the GitHub App installation. diff --git a/sdk/python/pulumi_github/get_branch.py b/sdk/python/pulumi_github/get_branch.py index 8f0e8c70..cb154214 100644 --- a/sdk/python/pulumi_github/get_branch.py +++ b/sdk/python/pulumi_github/get_branch.py @@ -104,6 +104,16 @@ def get_branch(branch: Optional[str] = None, """ Use this data source to retrieve information about a repository branch. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + development = github.get_branch(branch="development", + repository="example") + ``` + :param str branch: The repository branch to retrieve. :param str repository: The GitHub repository name. @@ -130,6 +140,16 @@ def get_branch_output(branch: Optional[pulumi.Input[str]] = None, """ Use this data source to retrieve information about a repository branch. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + development = github.get_branch(branch="development", + repository="example") + ``` + :param str branch: The repository branch to retrieve. :param str repository: The GitHub repository name. diff --git a/sdk/python/pulumi_github/get_branch_protection_rules.py b/sdk/python/pulumi_github/get_branch_protection_rules.py index 12d40b23..b9b45bbf 100644 --- a/sdk/python/pulumi_github/get_branch_protection_rules.py +++ b/sdk/python/pulumi_github/get_branch_protection_rules.py @@ -71,6 +71,15 @@ def get_branch_protection_rules(repository: Optional[str] = None, """ Use this data source to retrieve a list of repository branch protection rules. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example = github.get_branch_protection_rules(repository="example") + ``` + :param str repository: The GitHub repository name. """ @@ -91,6 +100,15 @@ def get_branch_protection_rules_output(repository: Optional[pulumi.Input[str]] = """ Use this data source to retrieve a list of repository branch protection rules. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example = github.get_branch_protection_rules(repository="example") + ``` + :param str repository: The GitHub repository name. """ diff --git a/sdk/python/pulumi_github/get_codespaces_organization_public_key.py b/sdk/python/pulumi_github/get_codespaces_organization_public_key.py index b5243394..823f6407 100644 --- a/sdk/python/pulumi_github/get_codespaces_organization_public_key.py +++ b/sdk/python/pulumi_github/get_codespaces_organization_public_key.py @@ -72,6 +72,15 @@ def get_codespaces_organization_public_key(opts: Optional[pulumi.InvokeOptions] """ Use this data source to retrieve information about a GitHub Codespaces Organization public key. This data source is required to be used with other GitHub secrets interactions. Note that the provider `token` must have admin rights to an organization to retrieve it's Codespaces public key. + + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example = github.get_codespaces_organization_public_key() + ``` """ __args__ = dict() opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts) @@ -88,5 +97,14 @@ def get_codespaces_organization_public_key_output(opts: Optional[pulumi.InvokeOp """ Use this data source to retrieve information about a GitHub Codespaces Organization public key. This data source is required to be used with other GitHub secrets interactions. Note that the provider `token` must have admin rights to an organization to retrieve it's Codespaces public key. + + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example = github.get_codespaces_organization_public_key() + ``` """ ... diff --git a/sdk/python/pulumi_github/get_codespaces_organization_secrets.py b/sdk/python/pulumi_github/get_codespaces_organization_secrets.py index 2729c73e..c381d797 100644 --- a/sdk/python/pulumi_github/get_codespaces_organization_secrets.py +++ b/sdk/python/pulumi_github/get_codespaces_organization_secrets.py @@ -60,6 +60,15 @@ def __await__(self): def get_codespaces_organization_secrets(opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetCodespacesOrganizationSecretsResult: """ Use this data source to retrieve the list of codespaces secrets of the organization. + + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example = github.get_codespaces_organization_secrets() + ``` """ __args__ = dict() opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts) @@ -74,5 +83,14 @@ def get_codespaces_organization_secrets(opts: Optional[pulumi.InvokeOptions] = N def get_codespaces_organization_secrets_output(opts: Optional[pulumi.InvokeOptions] = None) -> pulumi.Output[GetCodespacesOrganizationSecretsResult]: """ Use this data source to retrieve the list of codespaces secrets of the organization. + + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example = github.get_codespaces_organization_secrets() + ``` """ ... diff --git a/sdk/python/pulumi_github/get_codespaces_public_key.py b/sdk/python/pulumi_github/get_codespaces_public_key.py index 360d2bfa..b6a963bb 100644 --- a/sdk/python/pulumi_github/get_codespaces_public_key.py +++ b/sdk/python/pulumi_github/get_codespaces_public_key.py @@ -83,6 +83,15 @@ def get_codespaces_public_key(repository: Optional[str] = None, Use this data source to retrieve information about a GitHub Codespaces public key. This data source is required to be used with other GitHub secrets interactions. Note that the provider `token` must have admin rights to a repository to retrieve it's Codespaces public key. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example = github.get_codespaces_public_key(repository="example_repo") + ``` + :param str repository: Name of the repository to get public key from. """ @@ -105,6 +114,15 @@ def get_codespaces_public_key_output(repository: Optional[pulumi.Input[str]] = N Use this data source to retrieve information about a GitHub Codespaces public key. This data source is required to be used with other GitHub secrets interactions. Note that the provider `token` must have admin rights to a repository to retrieve it's Codespaces public key. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example = github.get_codespaces_public_key(repository="example_repo") + ``` + :param str repository: Name of the repository to get public key from. """ diff --git a/sdk/python/pulumi_github/get_codespaces_secrets.py b/sdk/python/pulumi_github/get_codespaces_secrets.py index f783ee4b..1c3f8cdf 100644 --- a/sdk/python/pulumi_github/get_codespaces_secrets.py +++ b/sdk/python/pulumi_github/get_codespaces_secrets.py @@ -84,6 +84,16 @@ def get_codespaces_secrets(full_name: Optional[str] = None, """ Use this data source to retrieve the list of codespaces secrets for a GitHub repository. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example = github.get_codespaces_secrets(name="example_repository") + example2 = github.get_codespaces_secrets(full_name="org/example_repository") + ``` + :param str full_name: Full name of the repository (in `org/name` format). :param str name: The name of the repository. @@ -108,6 +118,16 @@ def get_codespaces_secrets_output(full_name: Optional[pulumi.Input[Optional[str] """ Use this data source to retrieve the list of codespaces secrets for a GitHub repository. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example = github.get_codespaces_secrets(name="example_repository") + example2 = github.get_codespaces_secrets(full_name="org/example_repository") + ``` + :param str full_name: Full name of the repository (in `org/name` format). :param str name: The name of the repository. diff --git a/sdk/python/pulumi_github/get_codespaces_user_public_key.py b/sdk/python/pulumi_github/get_codespaces_user_public_key.py index 26144317..81b396f4 100644 --- a/sdk/python/pulumi_github/get_codespaces_user_public_key.py +++ b/sdk/python/pulumi_github/get_codespaces_user_public_key.py @@ -72,6 +72,15 @@ def get_codespaces_user_public_key(opts: Optional[pulumi.InvokeOptions] = None) """ Use this data source to retrieve information about a GitHub Codespaces User public key. This data source is required to be used with other GitHub secrets interactions. Note that the provider `token` must have admin rights to an user to retrieve it's Codespaces public key. + + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example = github.get_codespaces_user_public_key() + ``` """ __args__ = dict() opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts) @@ -88,5 +97,14 @@ def get_codespaces_user_public_key_output(opts: Optional[pulumi.InvokeOptions] = """ Use this data source to retrieve information about a GitHub Codespaces User public key. This data source is required to be used with other GitHub secrets interactions. Note that the provider `token` must have admin rights to an user to retrieve it's Codespaces public key. + + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example = github.get_codespaces_user_public_key() + ``` """ ... diff --git a/sdk/python/pulumi_github/get_codespaces_user_secrets.py b/sdk/python/pulumi_github/get_codespaces_user_secrets.py index f0e1e8ec..c2317999 100644 --- a/sdk/python/pulumi_github/get_codespaces_user_secrets.py +++ b/sdk/python/pulumi_github/get_codespaces_user_secrets.py @@ -60,6 +60,15 @@ def __await__(self): def get_codespaces_user_secrets(opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetCodespacesUserSecretsResult: """ Use this data source to retrieve the list of codespaces secrets of the user. + + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example = github.get_codespaces_user_secrets() + ``` """ __args__ = dict() opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts) @@ -74,5 +83,14 @@ def get_codespaces_user_secrets(opts: Optional[pulumi.InvokeOptions] = None) -> def get_codespaces_user_secrets_output(opts: Optional[pulumi.InvokeOptions] = None) -> pulumi.Output[GetCodespacesUserSecretsResult]: """ Use this data source to retrieve the list of codespaces secrets of the user. + + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example = github.get_codespaces_user_secrets() + ``` """ ... diff --git a/sdk/python/pulumi_github/get_collaborators.py b/sdk/python/pulumi_github/get_collaborators.py index c4e80e45..dbf49cba 100644 --- a/sdk/python/pulumi_github/get_collaborators.py +++ b/sdk/python/pulumi_github/get_collaborators.py @@ -91,6 +91,16 @@ def get_collaborators(affiliation: Optional[str] = None, """ Use this data source to retrieve the collaborators for a given repository. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + test = github.get_collaborators(owner="example_owner", + repository="example_repository") + ``` + :param str affiliation: Filter collaborators returned by their affiliation. Can be one of: `outside`, `direct`, `all`. Defaults to `all`. :param str owner: The organization that owns the repository. @@ -119,6 +129,16 @@ def get_collaborators_output(affiliation: Optional[pulumi.Input[Optional[str]]] """ Use this data source to retrieve the collaborators for a given repository. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + test = github.get_collaborators(owner="example_owner", + repository="example_repository") + ``` + :param str affiliation: Filter collaborators returned by their affiliation. Can be one of: `outside`, `direct`, `all`. Defaults to `all`. :param str owner: The organization that owns the repository. diff --git a/sdk/python/pulumi_github/get_dependabot_organization_public_key.py b/sdk/python/pulumi_github/get_dependabot_organization_public_key.py index 4fba6339..100bfffb 100644 --- a/sdk/python/pulumi_github/get_dependabot_organization_public_key.py +++ b/sdk/python/pulumi_github/get_dependabot_organization_public_key.py @@ -72,6 +72,15 @@ def get_dependabot_organization_public_key(opts: Optional[pulumi.InvokeOptions] """ Use this data source to retrieve information about a GitHub Dependabot Organization public key. This data source is required to be used with other GitHub secrets interactions. Note that the provider `token` must have admin rights to an organization to retrieve it's Dependabot public key. + + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example = github.get_dependabot_organization_public_key() + ``` """ __args__ = dict() opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts) @@ -88,5 +97,14 @@ def get_dependabot_organization_public_key_output(opts: Optional[pulumi.InvokeOp """ Use this data source to retrieve information about a GitHub Dependabot Organization public key. This data source is required to be used with other GitHub secrets interactions. Note that the provider `token` must have admin rights to an organization to retrieve it's Dependabot public key. + + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example = github.get_dependabot_organization_public_key() + ``` """ ... diff --git a/sdk/python/pulumi_github/get_dependabot_organization_secrets.py b/sdk/python/pulumi_github/get_dependabot_organization_secrets.py index c5157798..9c6cda91 100644 --- a/sdk/python/pulumi_github/get_dependabot_organization_secrets.py +++ b/sdk/python/pulumi_github/get_dependabot_organization_secrets.py @@ -60,6 +60,15 @@ def __await__(self): def get_dependabot_organization_secrets(opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetDependabotOrganizationSecretsResult: """ Use this data source to retrieve the list of dependabot secrets of the organization. + + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example = github.get_dependabot_organization_secrets() + ``` """ __args__ = dict() opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts) @@ -74,5 +83,14 @@ def get_dependabot_organization_secrets(opts: Optional[pulumi.InvokeOptions] = N def get_dependabot_organization_secrets_output(opts: Optional[pulumi.InvokeOptions] = None) -> pulumi.Output[GetDependabotOrganizationSecretsResult]: """ Use this data source to retrieve the list of dependabot secrets of the organization. + + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example = github.get_dependabot_organization_secrets() + ``` """ ... diff --git a/sdk/python/pulumi_github/get_dependabot_secrets.py b/sdk/python/pulumi_github/get_dependabot_secrets.py index e6d0dc29..fe1a60e0 100644 --- a/sdk/python/pulumi_github/get_dependabot_secrets.py +++ b/sdk/python/pulumi_github/get_dependabot_secrets.py @@ -84,6 +84,15 @@ def get_dependabot_secrets(full_name: Optional[str] = None, """ Use this data source to retrieve the list of dependabot secrets for a GitHub repository. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example = github.get_dependabot_secrets(name="example") + ``` + :param str full_name: Full name of the repository (in `org/name` format). :param str name: The name of the repository. @@ -108,6 +117,15 @@ def get_dependabot_secrets_output(full_name: Optional[pulumi.Input[Optional[str] """ Use this data source to retrieve the list of dependabot secrets for a GitHub repository. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example = github.get_dependabot_secrets(name="example") + ``` + :param str full_name: Full name of the repository (in `org/name` format). :param str name: The name of the repository. diff --git a/sdk/python/pulumi_github/get_enterprise.py b/sdk/python/pulumi_github/get_enterprise.py index 26886bdb..01047483 100644 --- a/sdk/python/pulumi_github/get_enterprise.py +++ b/sdk/python/pulumi_github/get_enterprise.py @@ -109,6 +109,15 @@ def get_enterprise(slug: Optional[str] = None, """ Use this data source to retrieve basic information about a GitHub enterprise. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example = github.get_enterprise(slug="example-co") + ``` + :param str slug: The URL slug identifying the enterprise. """ @@ -132,6 +141,15 @@ def get_enterprise_output(slug: Optional[pulumi.Input[str]] = None, """ Use this data source to retrieve basic information about a GitHub enterprise. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example = github.get_enterprise(slug="example-co") + ``` + :param str slug: The URL slug identifying the enterprise. """ diff --git a/sdk/python/pulumi_github/get_external_groups.py b/sdk/python/pulumi_github/get_external_groups.py index ec37a508..c51a6a8c 100644 --- a/sdk/python/pulumi_github/get_external_groups.py +++ b/sdk/python/pulumi_github/get_external_groups.py @@ -60,6 +60,17 @@ def __await__(self): def get_external_groups(opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetExternalGroupsResult: """ Use this data source to retrieve external groups belonging to an organization. + + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example_external_groups = github.get_external_groups() + local_groups = example_external_groups + pulumi.export("groups", local_groups) + ``` """ __args__ = dict() opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts) @@ -74,5 +85,16 @@ def get_external_groups(opts: Optional[pulumi.InvokeOptions] = None) -> Awaitabl def get_external_groups_output(opts: Optional[pulumi.InvokeOptions] = None) -> pulumi.Output[GetExternalGroupsResult]: """ Use this data source to retrieve external groups belonging to an organization. + + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example_external_groups = github.get_external_groups() + local_groups = example_external_groups + pulumi.export("groups", local_groups) + ``` """ ... diff --git a/sdk/python/pulumi_github/get_github_app.py b/sdk/python/pulumi_github/get_github_app.py index ab890e92..1f94c8b0 100644 --- a/sdk/python/pulumi_github/get_github_app.py +++ b/sdk/python/pulumi_github/get_github_app.py @@ -94,6 +94,15 @@ def get_github_app(slug: Optional[str] = None, """ Use this data source to retrieve information about an app. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + foobar = github.get_github_app(slug="foobar") + ``` + :param str slug: The URL-friendly name of your GitHub App. """ @@ -116,6 +125,15 @@ def get_github_app_output(slug: Optional[pulumi.Input[str]] = None, """ Use this data source to retrieve information about an app. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + foobar = github.get_github_app(slug="foobar") + ``` + :param str slug: The URL-friendly name of your GitHub App. """ diff --git a/sdk/python/pulumi_github/get_ip_ranges.py b/sdk/python/pulumi_github/get_ip_ranges.py index 3bb4cbbd..8b6d1109 100644 --- a/sdk/python/pulumi_github/get_ip_ranges.py +++ b/sdk/python/pulumi_github/get_ip_ranges.py @@ -335,6 +335,15 @@ def __await__(self): def get_ip_ranges(opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetIpRangesResult: """ Use this data source to retrieve information about GitHub's IP addresses. + + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + test = github.get_ip_ranges() + ``` """ __args__ = dict() opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts) @@ -372,5 +381,14 @@ def get_ip_ranges(opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetIp def get_ip_ranges_output(opts: Optional[pulumi.InvokeOptions] = None) -> pulumi.Output[GetIpRangesResult]: """ Use this data source to retrieve information about GitHub's IP addresses. + + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + test = github.get_ip_ranges() + ``` """ ... diff --git a/sdk/python/pulumi_github/get_membership.py b/sdk/python/pulumi_github/get_membership.py index eea88c5b..87494b6a 100644 --- a/sdk/python/pulumi_github/get_membership.py +++ b/sdk/python/pulumi_github/get_membership.py @@ -110,6 +110,15 @@ def get_membership(organization: Optional[str] = None, If the user's membership in the organization is pending their acceptance of an invite, the role they would have once they accept will be returned. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + membership_for_some_user = github.get_membership(username="SomeUser") + ``` + :param str organization: The organization to check for the above username. :param str username: The username to lookup in the organization. @@ -139,6 +148,15 @@ def get_membership_output(organization: Optional[pulumi.Input[Optional[str]]] = If the user's membership in the organization is pending their acceptance of an invite, the role they would have once they accept will be returned. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + membership_for_some_user = github.get_membership(username="SomeUser") + ``` + :param str organization: The organization to check for the above username. :param str username: The username to lookup in the organization. diff --git a/sdk/python/pulumi_github/get_organization.py b/sdk/python/pulumi_github/get_organization.py index d792191d..6e9b0df3 100644 --- a/sdk/python/pulumi_github/get_organization.py +++ b/sdk/python/pulumi_github/get_organization.py @@ -376,6 +376,15 @@ def get_organization(name: Optional[str] = None, """ Use this data source to retrieve basic information about a GitHub Organization. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example = github.get_organization(name="github") + ``` + :param str name: The organization's public profile name """ @@ -421,6 +430,15 @@ def get_organization_output(name: Optional[pulumi.Input[str]] = None, """ Use this data source to retrieve basic information about a GitHub Organization. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example = github.get_organization(name="github") + ``` + :param str name: The organization's public profile name """ diff --git a/sdk/python/pulumi_github/get_organization_custom_role.py b/sdk/python/pulumi_github/get_organization_custom_role.py index 24e90fcf..a9910060 100644 --- a/sdk/python/pulumi_github/get_organization_custom_role.py +++ b/sdk/python/pulumi_github/get_organization_custom_role.py @@ -96,6 +96,15 @@ def get_organization_custom_role(name: Optional[str] = None, > Note: Custom roles are currently only available in GitHub Enterprise Cloud. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example = github.get_organization_custom_role(name="example") + ``` + :param str name: The name of the custom role. """ @@ -120,6 +129,15 @@ def get_organization_custom_role_output(name: Optional[pulumi.Input[str]] = None > Note: Custom roles are currently only available in GitHub Enterprise Cloud. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example = github.get_organization_custom_role(name="example") + ``` + :param str name: The name of the custom role. """ diff --git a/sdk/python/pulumi_github/get_organization_external_identities.py b/sdk/python/pulumi_github/get_organization_external_identities.py index 2c63280b..bb173d94 100644 --- a/sdk/python/pulumi_github/get_organization_external_identities.py +++ b/sdk/python/pulumi_github/get_organization_external_identities.py @@ -61,6 +61,15 @@ def get_organization_external_identities(opts: Optional[pulumi.InvokeOptions] = """ Use this data source to retrieve each organization member's SAML or SCIM user attributes. + + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + all = github.get_organization_external_identities() + ``` """ __args__ = dict() opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts) @@ -76,5 +85,14 @@ def get_organization_external_identities_output(opts: Optional[pulumi.InvokeOpti """ Use this data source to retrieve each organization member's SAML or SCIM user attributes. + + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + all = github.get_organization_external_identities() + ``` """ ... diff --git a/sdk/python/pulumi_github/get_organization_ip_allow_list.py b/sdk/python/pulumi_github/get_organization_ip_allow_list.py index 3dad8a82..8ce7cd58 100644 --- a/sdk/python/pulumi_github/get_organization_ip_allow_list.py +++ b/sdk/python/pulumi_github/get_organization_ip_allow_list.py @@ -63,6 +63,15 @@ def get_organization_ip_allow_list(opts: Optional[pulumi.InvokeOptions] = None) Use this data source to retrieve information about the IP allow list of an organization. The allow list for IP addresses will block access to private resources via the web, API, and Git from any IP addresses that are not on the allow list. + + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + all = github.get_organization_ip_allow_list() + ``` """ __args__ = dict() opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts) @@ -79,5 +88,14 @@ def get_organization_ip_allow_list_output(opts: Optional[pulumi.InvokeOptions] = Use this data source to retrieve information about the IP allow list of an organization. The allow list for IP addresses will block access to private resources via the web, API, and Git from any IP addresses that are not on the allow list. + + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + all = github.get_organization_ip_allow_list() + ``` """ ... diff --git a/sdk/python/pulumi_github/get_organization_team_sync_groups.py b/sdk/python/pulumi_github/get_organization_team_sync_groups.py index c83540f2..28cb6e67 100644 --- a/sdk/python/pulumi_github/get_organization_team_sync_groups.py +++ b/sdk/python/pulumi_github/get_organization_team_sync_groups.py @@ -60,6 +60,15 @@ def __await__(self): def get_organization_team_sync_groups(opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetOrganizationTeamSyncGroupsResult: """ Use this data source to retrieve the identity provider (IdP) groups for an organization. + + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + test = github.get_organization_team_sync_groups() + ``` """ __args__ = dict() opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts) @@ -74,5 +83,14 @@ def get_organization_team_sync_groups(opts: Optional[pulumi.InvokeOptions] = Non def get_organization_team_sync_groups_output(opts: Optional[pulumi.InvokeOptions] = None) -> pulumi.Output[GetOrganizationTeamSyncGroupsResult]: """ Use this data source to retrieve the identity provider (IdP) groups for an organization. + + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + test = github.get_organization_team_sync_groups() + ``` """ ... diff --git a/sdk/python/pulumi_github/get_organization_teams.py b/sdk/python/pulumi_github/get_organization_teams.py index aef1a790..95c5d683 100644 --- a/sdk/python/pulumi_github/get_organization_teams.py +++ b/sdk/python/pulumi_github/get_organization_teams.py @@ -100,6 +100,26 @@ def get_organization_teams(results_per_page: Optional[int] = None, """ Use this data source to retrieve information about all GitHub teams in an organization. + ## Example Usage + + To retrieve *all* teams of the organization: + + ```python + import pulumi + import pulumi_github as github + + all = github.get_organization_teams() + ``` + + To retrieve only the team's at the root of the organization: + + ```python + import pulumi + import pulumi_github as github + + root_teams = github.get_organization_teams(root_teams_only=True) + ``` + :param int results_per_page: (Optional) Set the number of results per graphql query. Reducing this number can alleviate timeout errors. Accepts a value between 0 - 100. Defaults to `100`. :param bool root_teams_only: (Optional) Only return teams that are at the organization's root, i.e. no nested teams. Defaults to `false`. @@ -128,6 +148,26 @@ def get_organization_teams_output(results_per_page: Optional[pulumi.Input[Option """ Use this data source to retrieve information about all GitHub teams in an organization. + ## Example Usage + + To retrieve *all* teams of the organization: + + ```python + import pulumi + import pulumi_github as github + + all = github.get_organization_teams() + ``` + + To retrieve only the team's at the root of the organization: + + ```python + import pulumi + import pulumi_github as github + + root_teams = github.get_organization_teams(root_teams_only=True) + ``` + :param int results_per_page: (Optional) Set the number of results per graphql query. Reducing this number can alleviate timeout errors. Accepts a value between 0 - 100. Defaults to `100`. :param bool root_teams_only: (Optional) Only return teams that are at the organization's root, i.e. no nested teams. Defaults to `false`. diff --git a/sdk/python/pulumi_github/get_organization_webhooks.py b/sdk/python/pulumi_github/get_organization_webhooks.py index 437c5eca..f982c10e 100644 --- a/sdk/python/pulumi_github/get_organization_webhooks.py +++ b/sdk/python/pulumi_github/get_organization_webhooks.py @@ -61,6 +61,17 @@ def __await__(self): def get_organization_webhooks(opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetOrganizationWebhooksResult: """ Use this data source to retrieve all webhooks of the organization. + + ## Example Usage + + To retrieve *all* webhooks of the organization: + + ```python + import pulumi + import pulumi_github as github + + all = github.get_organization_webhooks() + ``` """ __args__ = dict() opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts) @@ -75,5 +86,16 @@ def get_organization_webhooks(opts: Optional[pulumi.InvokeOptions] = None) -> Aw def get_organization_webhooks_output(opts: Optional[pulumi.InvokeOptions] = None) -> pulumi.Output[GetOrganizationWebhooksResult]: """ Use this data source to retrieve all webhooks of the organization. + + ## Example Usage + + To retrieve *all* webhooks of the organization: + + ```python + import pulumi + import pulumi_github as github + + all = github.get_organization_webhooks() + ``` """ ... diff --git a/sdk/python/pulumi_github/get_ref.py b/sdk/python/pulumi_github/get_ref.py index 34f593b7..2bc3f550 100644 --- a/sdk/python/pulumi_github/get_ref.py +++ b/sdk/python/pulumi_github/get_ref.py @@ -102,6 +102,17 @@ def get_ref(owner: Optional[str] = None, """ Use this data source to retrieve information about a repository ref. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + development = github.get_ref(owner="example", + ref="heads/development", + repository="example") + ``` + :param str owner: Owner of the repository. :param str ref: The repository ref to look up. Must be formatted `heads/` for branches, and `tags/` for tags. @@ -131,6 +142,17 @@ def get_ref_output(owner: Optional[pulumi.Input[Optional[str]]] = None, """ Use this data source to retrieve information about a repository ref. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + development = github.get_ref(owner="example", + ref="heads/development", + repository="example") + ``` + :param str owner: Owner of the repository. :param str ref: The repository ref to look up. Must be formatted `heads/` for branches, and `tags/` for tags. diff --git a/sdk/python/pulumi_github/get_repositories.py b/sdk/python/pulumi_github/get_repositories.py index f8832785..4268cace 100644 --- a/sdk/python/pulumi_github/get_repositories.py +++ b/sdk/python/pulumi_github/get_repositories.py @@ -121,6 +121,16 @@ def get_repositories(include_repo_id: Optional[bool] = None, Use this data source to retrieve a list of GitHub repositories using a search query. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example = github.get_repositories(include_repo_id=True, + query="org:hashicorp language:Go") + ``` + :param bool include_repo_id: Returns a list of found repository IDs :param str query: Search query. See [documentation for the search syntax](https://help.github.com/articles/understanding-the-search-syntax/). @@ -158,6 +168,16 @@ def get_repositories_output(include_repo_id: Optional[pulumi.Input[Optional[bool Use this data source to retrieve a list of GitHub repositories using a search query. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example = github.get_repositories(include_repo_id=True, + query="org:hashicorp language:Go") + ``` + :param bool include_repo_id: Returns a list of found repository IDs :param str query: Search query. See [documentation for the search syntax](https://help.github.com/articles/understanding-the-search-syntax/). diff --git a/sdk/python/pulumi_github/get_repository.py b/sdk/python/pulumi_github/get_repository.py index 776acca4..c5c8bb00 100644 --- a/sdk/python/pulumi_github/get_repository.py +++ b/sdk/python/pulumi_github/get_repository.py @@ -455,6 +455,15 @@ def get_repository(description: Optional[str] = None, """ Use this data source to retrieve information about a GitHub repository. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example = github.get_repository(full_name="hashicorp/terraform") + ``` + :param str description: A description of the repository. :param str full_name: Full name of the repository (in `org/name` format). @@ -516,6 +525,15 @@ def get_repository_output(description: Optional[pulumi.Input[Optional[str]]] = N """ Use this data source to retrieve information about a GitHub repository. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example = github.get_repository(full_name="hashicorp/terraform") + ``` + :param str description: A description of the repository. :param str full_name: Full name of the repository (in `org/name` format). diff --git a/sdk/python/pulumi_github/get_repository_autolink_references.py b/sdk/python/pulumi_github/get_repository_autolink_references.py index f196f0bc..f79ca327 100644 --- a/sdk/python/pulumi_github/get_repository_autolink_references.py +++ b/sdk/python/pulumi_github/get_repository_autolink_references.py @@ -71,6 +71,15 @@ def get_repository_autolink_references(repository: Optional[str] = None, """ Use this data source to retrieve autolink references for a repository. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example = github.get_repository_autolink_references(repository="example-repository") + ``` + :param str repository: Name of the repository to retrieve the autolink references from. """ @@ -91,6 +100,15 @@ def get_repository_autolink_references_output(repository: Optional[pulumi.Input[ """ Use this data source to retrieve autolink references for a repository. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example = github.get_repository_autolink_references(repository="example-repository") + ``` + :param str repository: Name of the repository to retrieve the autolink references from. """ diff --git a/sdk/python/pulumi_github/get_repository_branches.py b/sdk/python/pulumi_github/get_repository_branches.py index 2cc7e385..a5ac44a4 100644 --- a/sdk/python/pulumi_github/get_repository_branches.py +++ b/sdk/python/pulumi_github/get_repository_branches.py @@ -91,6 +91,15 @@ def get_repository_branches(only_non_protected_branches: Optional[bool] = None, """ Use this data source to retrieve information about branches in a repository. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example = github.get_repository_branches(repository="example-repository") + ``` + :param bool only_non_protected_branches: . If true, the `branches` attributes will be populated only with non protected branches. Default: `false`. :param bool only_protected_branches: . If true, the `branches` attributes will be populated only with protected branches. Default: `false`. @@ -119,6 +128,15 @@ def get_repository_branches_output(only_non_protected_branches: Optional[pulumi. """ Use this data source to retrieve information about branches in a repository. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example = github.get_repository_branches(repository="example-repository") + ``` + :param bool only_non_protected_branches: . If true, the `branches` attributes will be populated only with non protected branches. Default: `false`. :param bool only_protected_branches: . If true, the `branches` attributes will be populated only with protected branches. Default: `false`. diff --git a/sdk/python/pulumi_github/get_repository_deploy_keys.py b/sdk/python/pulumi_github/get_repository_deploy_keys.py index d410a1e9..9c86146f 100644 --- a/sdk/python/pulumi_github/get_repository_deploy_keys.py +++ b/sdk/python/pulumi_github/get_repository_deploy_keys.py @@ -71,6 +71,15 @@ def get_repository_deploy_keys(repository: Optional[str] = None, """ Use this data source to retrieve all deploy keys of a repository. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example = github.get_repository_deploy_keys(repository="example-repository") + ``` + :param str repository: Name of the repository to retrieve the branches from. """ @@ -91,6 +100,15 @@ def get_repository_deploy_keys_output(repository: Optional[pulumi.Input[str]] = """ Use this data source to retrieve all deploy keys of a repository. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example = github.get_repository_deploy_keys(repository="example-repository") + ``` + :param str repository: Name of the repository to retrieve the branches from. """ diff --git a/sdk/python/pulumi_github/get_repository_deployment_branch_policies.py b/sdk/python/pulumi_github/get_repository_deployment_branch_policies.py index ab5332ed..4fb9a2ab 100644 --- a/sdk/python/pulumi_github/get_repository_deployment_branch_policies.py +++ b/sdk/python/pulumi_github/get_repository_deployment_branch_policies.py @@ -81,6 +81,16 @@ def get_repository_deployment_branch_policies(environment_name: Optional[str] = """ Use this data source to retrieve deployment branch policies for a repository / environment. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example = github.get_repository_deployment_branch_policies(environment_name="env_name", + repository="example-repository") + ``` + :param str environment_name: Name of the environment to retrieve the deployment branch policies from. :param str repository: Name of the repository to retrieve the deployment branch policies from. @@ -105,6 +115,16 @@ def get_repository_deployment_branch_policies_output(environment_name: Optional[ """ Use this data source to retrieve deployment branch policies for a repository / environment. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example = github.get_repository_deployment_branch_policies(environment_name="env_name", + repository="example-repository") + ``` + :param str environment_name: Name of the environment to retrieve the deployment branch policies from. :param str repository: Name of the repository to retrieve the deployment branch policies from. diff --git a/sdk/python/pulumi_github/get_repository_environments.py b/sdk/python/pulumi_github/get_repository_environments.py index 1c733480..40ee6341 100644 --- a/sdk/python/pulumi_github/get_repository_environments.py +++ b/sdk/python/pulumi_github/get_repository_environments.py @@ -71,6 +71,15 @@ def get_repository_environments(repository: Optional[str] = None, """ Use this data source to retrieve information about environments for a repository. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example = github.get_repository_environments(repository="example-repository") + ``` + :param str repository: Name of the repository to retrieve the environments from. """ @@ -91,6 +100,15 @@ def get_repository_environments_output(repository: Optional[pulumi.Input[str]] = """ Use this data source to retrieve information about environments for a repository. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example = github.get_repository_environments(repository="example-repository") + ``` + :param str repository: Name of the repository to retrieve the environments from. """ diff --git a/sdk/python/pulumi_github/get_repository_file.py b/sdk/python/pulumi_github/get_repository_file.py index 6d62a25f..431848b6 100644 --- a/sdk/python/pulumi_github/get_repository_file.py +++ b/sdk/python/pulumi_github/get_repository_file.py @@ -163,6 +163,17 @@ def get_repository_file(branch: Optional[str] = None, This data source allows you to read files within a GitHub repository. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + foo = github.get_repository_file(repository=github_repository["foo"]["name"], + branch="main", + file=".gitignore") + ``` + :param str branch: Git branch. Defaults to the repository's default branch. :param str file: The path of the file to read. @@ -198,6 +209,17 @@ def get_repository_file_output(branch: Optional[pulumi.Input[Optional[str]]] = N This data source allows you to read files within a GitHub repository. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + foo = github.get_repository_file(repository=github_repository["foo"]["name"], + branch="main", + file=".gitignore") + ``` + :param str branch: Git branch. Defaults to the repository's default branch. :param str file: The path of the file to read. diff --git a/sdk/python/pulumi_github/get_repository_milestone.py b/sdk/python/pulumi_github/get_repository_milestone.py index 6bec858c..dc54af49 100644 --- a/sdk/python/pulumi_github/get_repository_milestone.py +++ b/sdk/python/pulumi_github/get_repository_milestone.py @@ -126,6 +126,17 @@ def get_repository_milestone(number: Optional[int] = None, """ Use this data source to retrieve information about a specific GitHub milestone in a repository. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example = github.get_repository_milestone(number=1, + owner="example-owner", + repository="example-repository") + ``` + :param int number: The number of the milestone. :param str owner: Owner of the repository. @@ -157,6 +168,17 @@ def get_repository_milestone_output(number: Optional[pulumi.Input[int]] = None, """ Use this data source to retrieve information about a specific GitHub milestone in a repository. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example = github.get_repository_milestone(number=1, + owner="example-owner", + repository="example-repository") + ``` + :param int number: The number of the milestone. :param str owner: Owner of the repository. diff --git a/sdk/python/pulumi_github/get_repository_pull_request.py b/sdk/python/pulumi_github/get_repository_pull_request.py index 2e6c7744..8c61b714 100644 --- a/sdk/python/pulumi_github/get_repository_pull_request.py +++ b/sdk/python/pulumi_github/get_repository_pull_request.py @@ -255,6 +255,16 @@ def get_repository_pull_request(base_repository: Optional[str] = None, """ Use this data source to retrieve information about a specific GitHub Pull Request in a repository. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example = github.get_repository_pull_request(base_repository="example_repository", + number=1) + ``` + :param str base_repository: Name of the base repository to retrieve the Pull Request from. :param int number: The number of the Pull Request within the repository. @@ -297,6 +307,16 @@ def get_repository_pull_request_output(base_repository: Optional[pulumi.Input[st """ Use this data source to retrieve information about a specific GitHub Pull Request in a repository. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example = github.get_repository_pull_request(base_repository="example_repository", + number=1) + ``` + :param str base_repository: Name of the base repository to retrieve the Pull Request from. :param int number: The number of the Pull Request within the repository. diff --git a/sdk/python/pulumi_github/get_repository_pull_requests.py b/sdk/python/pulumi_github/get_repository_pull_requests.py index 27039814..089f359a 100644 --- a/sdk/python/pulumi_github/get_repository_pull_requests.py +++ b/sdk/python/pulumi_github/get_repository_pull_requests.py @@ -140,6 +140,19 @@ def get_repository_pull_requests(base_ref: Optional[str] = None, """ Use this data source to retrieve information about multiple GitHub Pull Requests in a repository. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example = github.get_repository_pull_requests(base_ref="main", + base_repository="example-repository", + sort_by="updated", + sort_direction="desc", + state="open") + ``` + :param str base_ref: If set, filters Pull Requests by base branch name. :param str base_repository: Name of the base repository to retrieve the Pull Requests from. @@ -184,6 +197,19 @@ def get_repository_pull_requests_output(base_ref: Optional[pulumi.Input[Optional """ Use this data source to retrieve information about multiple GitHub Pull Requests in a repository. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example = github.get_repository_pull_requests(base_ref="main", + base_repository="example-repository", + sort_by="updated", + sort_direction="desc", + state="open") + ``` + :param str base_ref: If set, filters Pull Requests by base branch name. :param str base_repository: Name of the base repository to retrieve the Pull Requests from. diff --git a/sdk/python/pulumi_github/get_repository_teams.py b/sdk/python/pulumi_github/get_repository_teams.py index 567552a7..2f133c38 100644 --- a/sdk/python/pulumi_github/get_repository_teams.py +++ b/sdk/python/pulumi_github/get_repository_teams.py @@ -84,6 +84,15 @@ def get_repository_teams(full_name: Optional[str] = None, """ Use this data source to retrieve the list of teams which have access to a GitHub repository. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example = github.get_repository_teams(name="example") + ``` + :param str full_name: Full name of the repository (in `org/name` format). :param str name: The name of the repository. @@ -108,6 +117,15 @@ def get_repository_teams_output(full_name: Optional[pulumi.Input[Optional[str]]] """ Use this data source to retrieve the list of teams which have access to a GitHub repository. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example = github.get_repository_teams(name="example") + ``` + :param str full_name: Full name of the repository (in `org/name` format). :param str name: The name of the repository. diff --git a/sdk/python/pulumi_github/get_repository_webhooks.py b/sdk/python/pulumi_github/get_repository_webhooks.py index 25e42852..51ae1f0a 100644 --- a/sdk/python/pulumi_github/get_repository_webhooks.py +++ b/sdk/python/pulumi_github/get_repository_webhooks.py @@ -71,6 +71,17 @@ def get_repository_webhooks(repository: Optional[str] = None, opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetRepositoryWebhooksResult: """ Use this data source to retrieve webhooks for a given repository. + + ## Example Usage + + To retrieve webhooks of a repository: + + ```python + import pulumi + import pulumi_github as github + + repo = github.get_repository_webhooks(repository="foo") + ``` """ __args__ = dict() __args__['repository'] = repository @@ -88,5 +99,16 @@ def get_repository_webhooks_output(repository: Optional[pulumi.Input[str]] = Non opts: Optional[pulumi.InvokeOptions] = None) -> pulumi.Output[GetRepositoryWebhooksResult]: """ Use this data source to retrieve webhooks for a given repository. + + ## Example Usage + + To retrieve webhooks of a repository: + + ```python + import pulumi + import pulumi_github as github + + repo = github.get_repository_webhooks(repository="foo") + ``` """ ... diff --git a/sdk/python/pulumi_github/get_rest_api.py b/sdk/python/pulumi_github/get_rest_api.py index 8ccfa4f6..b7785b22 100644 --- a/sdk/python/pulumi_github/get_rest_api.py +++ b/sdk/python/pulumi_github/get_rest_api.py @@ -106,6 +106,15 @@ def get_rest_api(endpoint: Optional[str] = None, """ Use this data source to retrieve information about a GitHub resource through REST API. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example = github.get_rest_api(endpoint="repos/example_repo/git/refs/heads/main") + ``` + :param str endpoint: REST API endpoint to send the GET request to. """ @@ -129,6 +138,15 @@ def get_rest_api_output(endpoint: Optional[pulumi.Input[str]] = None, """ Use this data source to retrieve information about a GitHub resource through REST API. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example = github.get_rest_api(endpoint="repos/example_repo/git/refs/heads/main") + ``` + :param str endpoint: REST API endpoint to send the GET request to. """ diff --git a/sdk/python/pulumi_github/get_ssh_keys.py b/sdk/python/pulumi_github/get_ssh_keys.py index 954543b3..fa30b84f 100644 --- a/sdk/python/pulumi_github/get_ssh_keys.py +++ b/sdk/python/pulumi_github/get_ssh_keys.py @@ -59,6 +59,15 @@ def __await__(self): def get_ssh_keys(opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetSshKeysResult: """ Use this data source to retrieve information about GitHub's SSH keys. + + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + test = github.get_ssh_keys() + ``` """ __args__ = dict() opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts) @@ -73,5 +82,14 @@ def get_ssh_keys(opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetSsh def get_ssh_keys_output(opts: Optional[pulumi.InvokeOptions] = None) -> pulumi.Output[GetSshKeysResult]: """ Use this data source to retrieve information about GitHub's SSH keys. + + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + test = github.get_ssh_keys() + ``` """ ... diff --git a/sdk/python/pulumi_github/get_team.py b/sdk/python/pulumi_github/get_team.py index 6f5a128e..8ca5f591 100644 --- a/sdk/python/pulumi_github/get_team.py +++ b/sdk/python/pulumi_github/get_team.py @@ -185,6 +185,15 @@ def get_team(membership_type: Optional[str] = None, """ Use this data source to retrieve information about a GitHub team. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example = github.get_team(slug="example") + ``` + :param str membership_type: Type of membershp to be requested to fill the list of members. Can be either "all" or "immediate". Default: "all" :param int results_per_page: Set the number of results per graphql query. Reducing this number can alleviate timeout errors. Accepts a value between 0 - 100. Defaults to `100`. @@ -224,6 +233,15 @@ def get_team_output(membership_type: Optional[pulumi.Input[Optional[str]]] = Non """ Use this data source to retrieve information about a GitHub team. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example = github.get_team(slug="example") + ``` + :param str membership_type: Type of membershp to be requested to fill the list of members. Can be either "all" or "immediate". Default: "all" :param int results_per_page: Set the number of results per graphql query. Reducing this number can alleviate timeout errors. Accepts a value between 0 - 100. Defaults to `100`. diff --git a/sdk/python/pulumi_github/get_tree.py b/sdk/python/pulumi_github/get_tree.py index cb896ea8..bfafceae 100644 --- a/sdk/python/pulumi_github/get_tree.py +++ b/sdk/python/pulumi_github/get_tree.py @@ -91,6 +91,21 @@ def get_tree(recursive: Optional[bool] = None, """ Use this data source to retrieve information about a single tree. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + this_repository = github.get_repository(name="example") + this_branch = github.get_branch(branch=this_repository.default_branch, + repository=this_repository.name) + this_tree = github.get_tree(recursive=False, + repository=this_repository.name, + tree_sha=this_branch.sha) + pulumi.export("entries", this_tree.entries) + ``` + :param bool recursive: Setting this parameter to `true` returns the objects or subtrees referenced by the tree specified in `tree_sha`. :param str repository: The name of the repository. @@ -119,6 +134,21 @@ def get_tree_output(recursive: Optional[pulumi.Input[Optional[bool]]] = None, """ Use this data source to retrieve information about a single tree. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + this_repository = github.get_repository(name="example") + this_branch = github.get_branch(branch=this_repository.default_branch, + repository=this_repository.name) + this_tree = github.get_tree(recursive=False, + repository=this_repository.name, + tree_sha=this_branch.sha) + pulumi.export("entries", this_tree.entries) + ``` + :param bool recursive: Setting this parameter to `true` returns the objects or subtrees referenced by the tree specified in `tree_sha`. :param str repository: The name of the repository. diff --git a/sdk/python/pulumi_github/get_user.py b/sdk/python/pulumi_github/get_user.py index 921a347a..20da50cf 100644 --- a/sdk/python/pulumi_github/get_user.py +++ b/sdk/python/pulumi_github/get_user.py @@ -298,6 +298,17 @@ def get_user(username: Optional[str] = None, """ Use this data source to retrieve information about a GitHub user. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example = github.get_user(username="example") + current = github.get_user(username="") + pulumi.export("currentGithubLogin", current.login) + ``` + :param str username: The username. Use an empty string `""` to retrieve information about the currently authenticated user. """ @@ -337,6 +348,17 @@ def get_user_output(username: Optional[pulumi.Input[str]] = None, """ Use this data source to retrieve information about a GitHub user. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example = github.get_user(username="example") + current = github.get_user(username="") + pulumi.export("currentGithubLogin", current.login) + ``` + :param str username: The username. Use an empty string `""` to retrieve information about the currently authenticated user. """ diff --git a/sdk/python/pulumi_github/get_user_external_identity.py b/sdk/python/pulumi_github/get_user_external_identity.py index 3e791dcd..21d14d69 100644 --- a/sdk/python/pulumi_github/get_user_external_identity.py +++ b/sdk/python/pulumi_github/get_user_external_identity.py @@ -100,6 +100,15 @@ def get_user_external_identity(username: Optional[str] = None, Use this data source to retrieve a specific organization member's SAML or SCIM user attributes. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example_user = github.get_user_external_identity(username="example-user") + ``` + :param str username: The username of the member to fetch external identity for. """ @@ -123,6 +132,15 @@ def get_user_external_identity_output(username: Optional[pulumi.Input[str]] = No Use this data source to retrieve a specific organization member's SAML or SCIM user attributes. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example_user = github.get_user_external_identity(username="example-user") + ``` + :param str username: The username of the member to fetch external identity for. """ diff --git a/sdk/python/pulumi_github/get_users.py b/sdk/python/pulumi_github/get_users.py index a82301bc..caf004dc 100644 --- a/sdk/python/pulumi_github/get_users.py +++ b/sdk/python/pulumi_github/get_users.py @@ -106,6 +106,21 @@ def get_users(usernames: Optional[Sequence[str]] = None, """ Use this data source to retrieve information about multiple GitHub users at once. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example = github.get_users(usernames=[ + "example1", + "example2", + "example3", + ]) + pulumi.export("validUsers", example.logins) + pulumi.export("invalidUsers", example.unknown_logins) + ``` + :param Sequence[str] usernames: List of usernames. """ @@ -129,6 +144,21 @@ def get_users_output(usernames: Optional[pulumi.Input[Sequence[str]]] = None, """ Use this data source to retrieve information about multiple GitHub users at once. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example = github.get_users(usernames=[ + "example1", + "example2", + "example3", + ]) + pulumi.export("validUsers", example.logins) + pulumi.export("invalidUsers", example.unknown_logins) + ``` + :param Sequence[str] usernames: List of usernames. """ diff --git a/sdk/python/pulumi_github/issue.py b/sdk/python/pulumi_github/issue.py index 975857a7..6ab19979 100644 --- a/sdk/python/pulumi_github/issue.py +++ b/sdk/python/pulumi_github/issue.py @@ -337,6 +337,50 @@ def __init__(__self__, This resource allows you to create and manage issue within your GitHub repository. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + # Create a simple issue + test_repository = github.Repository("testRepository", + auto_init=True, + has_issues=True) + test_issue = github.Issue("testIssue", + repository=test_repository.name, + title="My issue title", + body="The body of my issue") + ``` + ### With Milestone And Project Assignment + + ```python + import pulumi + import pulumi_github as github + + # Create an issue with milestone and project assignment + test_repository = github.Repository("testRepository", + auto_init=True, + has_issues=True) + test_repository_milestone = github.RepositoryMilestone("testRepositoryMilestone", + owner=test_repository.full_name.apply(lambda full_name: full_name.split("/")).apply(lambda split: split[0]), + repository=test_repository.name, + title="v1.0.0", + description="General Availability", + due_date="2022-11-22", + state="open") + test_issue = github.Issue("testIssue", + repository=test_repository.name, + title="My issue", + body="My issue body", + labels=[ + "bug", + "documentation", + ], + assignees=["bob-github"], + milestone_number=test_repository_milestone.number) + ``` + ## Import GitHub Issues can be imported using an ID made up of `repository:number`, e.g. @@ -366,6 +410,50 @@ def __init__(__self__, This resource allows you to create and manage issue within your GitHub repository. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + # Create a simple issue + test_repository = github.Repository("testRepository", + auto_init=True, + has_issues=True) + test_issue = github.Issue("testIssue", + repository=test_repository.name, + title="My issue title", + body="The body of my issue") + ``` + ### With Milestone And Project Assignment + + ```python + import pulumi + import pulumi_github as github + + # Create an issue with milestone and project assignment + test_repository = github.Repository("testRepository", + auto_init=True, + has_issues=True) + test_repository_milestone = github.RepositoryMilestone("testRepositoryMilestone", + owner=test_repository.full_name.apply(lambda full_name: full_name.split("/")).apply(lambda split: split[0]), + repository=test_repository.name, + title="v1.0.0", + description="General Availability", + due_date="2022-11-22", + state="open") + test_issue = github.Issue("testIssue", + repository=test_repository.name, + title="My issue", + body="My issue body", + labels=[ + "bug", + "documentation", + ], + assignees=["bob-github"], + milestone_number=test_repository_milestone.number) + ``` + ## Import GitHub Issues can be imported using an ID made up of `repository:number`, e.g. diff --git a/sdk/python/pulumi_github/issue_label.py b/sdk/python/pulumi_github/issue_label.py index cd339913..a6dc0a60 100644 --- a/sdk/python/pulumi_github/issue_label.py +++ b/sdk/python/pulumi_github/issue_label.py @@ -234,6 +234,18 @@ def __init__(__self__, repository: Optional[pulumi.Input[str]] = None, __props__=None): """ + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + # Create a new, red colored label + test_repo = github.IssueLabel("testRepo", + color="FF0000", + repository="test-repo") + ``` + ## Import GitHub Issue Labels can be imported using an ID made up of `repository:name`, e.g. @@ -256,6 +268,18 @@ def __init__(__self__, args: IssueLabelArgs, opts: Optional[pulumi.ResourceOptions] = None): """ + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + # Create a new, red colored label + test_repo = github.IssueLabel("testRepo", + color="FF0000", + repository="test-repo") + ``` + ## Import GitHub Issue Labels can be imported using an ID made up of `repository:name`, e.g. diff --git a/sdk/python/pulumi_github/membership.py b/sdk/python/pulumi_github/membership.py index ac2dab07..1d0400b8 100644 --- a/sdk/python/pulumi_github/membership.py +++ b/sdk/python/pulumi_github/membership.py @@ -204,6 +204,18 @@ def __init__(__self__, an invitation will be sent to the user to become part of the organization. When destroyed, either the invitation will be cancelled or the user will be removed. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + # Add a user to the organization + membership_for_some_user = github.Membership("membershipForSomeUser", + role="member", + username="SomeUser") + ``` + ## Import GitHub Membership can be imported using an ID made up of `organization:username`, e.g. @@ -235,6 +247,18 @@ def __init__(__self__, an invitation will be sent to the user to become part of the organization. When destroyed, either the invitation will be cancelled or the user will be removed. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + # Add a user to the organization + membership_for_some_user = github.Membership("membershipForSomeUser", + role="member", + username="SomeUser") + ``` + ## Import GitHub Membership can be imported using an ID made up of `organization:username`, e.g. diff --git a/sdk/python/pulumi_github/organization_block.py b/sdk/python/pulumi_github/organization_block.py index 4bd8c809..260f2c81 100644 --- a/sdk/python/pulumi_github/organization_block.py +++ b/sdk/python/pulumi_github/organization_block.py @@ -106,6 +106,15 @@ def __init__(__self__, """ This resource allows you to create and manage blocks for GitHub organizations. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example = github.OrganizationBlock("example", username="paultyng") + ``` + :param str resource_name: The name of the resource. :param pulumi.ResourceOptions opts: Options for the resource. :param pulumi.Input[str] username: The name of the user to block. @@ -119,6 +128,15 @@ def __init__(__self__, """ This resource allows you to create and manage blocks for GitHub organizations. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example = github.OrganizationBlock("example", username="paultyng") + ``` + :param str resource_name: The name of the resource. :param OrganizationBlockArgs args: The arguments to use to populate this resource's properties. :param pulumi.ResourceOptions opts: Options for the resource. diff --git a/sdk/python/pulumi_github/organization_custom_role.py b/sdk/python/pulumi_github/organization_custom_role.py index b9b5b1cc..b68cfd2b 100644 --- a/sdk/python/pulumi_github/organization_custom_role.py +++ b/sdk/python/pulumi_github/organization_custom_role.py @@ -210,6 +210,38 @@ def __init__(__self__, > Note: Custom roles are currently only available in GitHub Enterprise Cloud. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example = github.OrganizationCustomRole("example", + base_role="read", + description="Example custom role that uses the read role as its base", + permissions=[ + "add_assignee", + "add_label", + "bypass_branch_protection", + "close_issue", + "close_pull_request", + "mark_as_duplicate", + "create_tag", + "delete_issue", + "delete_tag", + "manage_deploy_keys", + "push_protected_branch", + "read_code_scanning", + "reopen_issue", + "reopen_pull_request", + "request_pr_review", + "resolve_dependabot_alerts", + "resolve_secret_scanning_alerts", + "view_secret_scanning_alerts", + "write_code_scanning", + ]) + ``` + ## Import Custom roles can be imported using the `id` of the role. The `id` of the custom role can be found using the [list custom roles in an organization](https://docs.github.com/en/enterprise-cloud@latest/rest/orgs/custom-roles#list-custom-repository-roles-in-an-organization) API. @@ -236,6 +268,38 @@ def __init__(__self__, > Note: Custom roles are currently only available in GitHub Enterprise Cloud. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example = github.OrganizationCustomRole("example", + base_role="read", + description="Example custom role that uses the read role as its base", + permissions=[ + "add_assignee", + "add_label", + "bypass_branch_protection", + "close_issue", + "close_pull_request", + "mark_as_duplicate", + "create_tag", + "delete_issue", + "delete_tag", + "manage_deploy_keys", + "push_protected_branch", + "read_code_scanning", + "reopen_issue", + "reopen_pull_request", + "request_pr_review", + "resolve_dependabot_alerts", + "resolve_secret_scanning_alerts", + "view_secret_scanning_alerts", + "write_code_scanning", + ]) + ``` + ## Import Custom roles can be imported using the `id` of the role. The `id` of the custom role can be found using the [list custom roles in an organization](https://docs.github.com/en/enterprise-cloud@latest/rest/orgs/custom-roles#list-custom-repository-roles-in-an-organization) API. diff --git a/sdk/python/pulumi_github/organization_project.py b/sdk/python/pulumi_github/organization_project.py index b0f3c4e9..bb57e4b7 100644 --- a/sdk/python/pulumi_github/organization_project.py +++ b/sdk/python/pulumi_github/organization_project.py @@ -160,6 +160,15 @@ def __init__(__self__, """ This resource allows you to create and manage projects for GitHub organization. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + project = github.OrganizationProject("project", body="This is a organization project.") + ``` + :param str resource_name: The name of the resource. :param pulumi.ResourceOptions opts: Options for the resource. :param pulumi.Input[str] body: The body of the project. @@ -174,6 +183,15 @@ def __init__(__self__, """ This resource allows you to create and manage projects for GitHub organization. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + project = github.OrganizationProject("project", body="This is a organization project.") + ``` + :param str resource_name: The name of the resource. :param OrganizationProjectArgs args: The arguments to use to populate this resource's properties. :param pulumi.ResourceOptions opts: Options for the resource. diff --git a/sdk/python/pulumi_github/organization_security_manager.py b/sdk/python/pulumi_github/organization_security_manager.py index 71c88c2b..057d29b8 100644 --- a/sdk/python/pulumi_github/organization_security_manager.py +++ b/sdk/python/pulumi_github/organization_security_manager.py @@ -94,6 +94,16 @@ def __init__(__self__, team_slug: Optional[pulumi.Input[str]] = None, __props__=None): """ + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + some_team_team = github.Team("someTeamTeam", description="Some cool team") + some_team_organization_security_manager = github.OrganizationSecurityManager("someTeamOrganizationSecurityManager", team_slug=some_team_team.slug) + ``` + ## Import GitHub Security Manager Teams can be imported using the GitHub team ID e.g. @@ -113,6 +123,16 @@ def __init__(__self__, args: OrganizationSecurityManagerArgs, opts: Optional[pulumi.ResourceOptions] = None): """ + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + some_team_team = github.Team("someTeamTeam", description="Some cool team") + some_team_organization_security_manager = github.OrganizationSecurityManager("someTeamOrganizationSecurityManager", team_slug=some_team_team.slug) + ``` + ## Import GitHub Security Manager Teams can be imported using the GitHub team ID e.g. diff --git a/sdk/python/pulumi_github/organization_settings.py b/sdk/python/pulumi_github/organization_settings.py index 29c08e2c..692c1cb9 100644 --- a/sdk/python/pulumi_github/organization_settings.py +++ b/sdk/python/pulumi_github/organization_settings.py @@ -1097,6 +1097,40 @@ def __init__(__self__, """ This resource allows you to create and manage settings for a GitHub Organization. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + test = github.OrganizationSettings("test", + advanced_security_enabled_for_new_repositories=False, + billing_email="test@example.com", + blog="https://example.com", + company="Test Company", + default_repository_permission="read", + dependabot_alerts_enabled_for_new_repositories=False, + dependabot_security_updates_enabled_for_new_repositories=False, + dependency_graph_enabled_for_new_repositories=False, + description="Test Description", + email="test@example.com", + has_organization_projects=True, + has_repository_projects=True, + location="Test Location", + members_can_create_internal_repositories=True, + members_can_create_pages=True, + members_can_create_private_pages=True, + members_can_create_private_repositories=True, + members_can_create_public_pages=True, + members_can_create_public_repositories=True, + members_can_create_repositories=True, + members_can_fork_private_repositories=True, + secret_scanning_enabled_for_new_repositories=False, + secret_scanning_push_protection_enabled_for_new_repositories=False, + twitter_username="Test", + web_commit_signoff_required=True) + ``` + ## Import Organization settings can be imported using the `id` of the organization. The `id` of the organization can be found using the [get an organization](https://docs.github.com/en/rest/orgs/orgs#get-an-organization) API. @@ -1143,6 +1177,40 @@ def __init__(__self__, """ This resource allows you to create and manage settings for a GitHub Organization. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + test = github.OrganizationSettings("test", + advanced_security_enabled_for_new_repositories=False, + billing_email="test@example.com", + blog="https://example.com", + company="Test Company", + default_repository_permission="read", + dependabot_alerts_enabled_for_new_repositories=False, + dependabot_security_updates_enabled_for_new_repositories=False, + dependency_graph_enabled_for_new_repositories=False, + description="Test Description", + email="test@example.com", + has_organization_projects=True, + has_repository_projects=True, + location="Test Location", + members_can_create_internal_repositories=True, + members_can_create_pages=True, + members_can_create_private_pages=True, + members_can_create_private_repositories=True, + members_can_create_public_pages=True, + members_can_create_public_repositories=True, + members_can_create_repositories=True, + members_can_fork_private_repositories=True, + secret_scanning_enabled_for_new_repositories=False, + secret_scanning_push_protection_enabled_for_new_repositories=False, + twitter_username="Test", + web_commit_signoff_required=True) + ``` + ## Import Organization settings can be imported using the `id` of the organization. The `id` of the organization can be found using the [get an organization](https://docs.github.com/en/rest/orgs/orgs#get-an-organization) API. diff --git a/sdk/python/pulumi_github/organization_webhook.py b/sdk/python/pulumi_github/organization_webhook.py index 85812f2c..2247eb78 100644 --- a/sdk/python/pulumi_github/organization_webhook.py +++ b/sdk/python/pulumi_github/organization_webhook.py @@ -200,6 +200,22 @@ def __init__(__self__, """ This resource allows you to create and manage webhooks for GitHub organization. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + foo = github.OrganizationWebhook("foo", + active=False, + configuration=github.OrganizationWebhookConfigurationArgs( + content_type="form", + insecure_ssl=False, + url="https://google.de/", + ), + events=["issues"]) + ``` + ## Import Organization webhooks can be imported using the `id` of the webhook. The `id` of the webhook can be found in the URL of the webhook. For example, `"https://github.com/organizations/foo-org/settings/hooks/123456789"`. @@ -224,6 +240,22 @@ def __init__(__self__, """ This resource allows you to create and manage webhooks for GitHub organization. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + foo = github.OrganizationWebhook("foo", + active=False, + configuration=github.OrganizationWebhookConfigurationArgs( + content_type="form", + insecure_ssl=False, + url="https://google.de/", + ), + events=["issues"]) + ``` + ## Import Organization webhooks can be imported using the `id` of the webhook. The `id` of the webhook can be found in the URL of the webhook. For example, `"https://github.com/organizations/foo-org/settings/hooks/123456789"`. diff --git a/sdk/python/pulumi_github/project_card.py b/sdk/python/pulumi_github/project_card.py index 3af6fd03..a912f2ce 100644 --- a/sdk/python/pulumi_github/project_card.py +++ b/sdk/python/pulumi_github/project_card.py @@ -261,6 +261,41 @@ def __init__(__self__, """ This resource allows you to create and manage cards for GitHub projects. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + project = github.OrganizationProject("project", body="This is an organization project.") + column = github.ProjectColumn("column", project_id=project.id) + card = github.ProjectCard("card", + column_id=column.column_id, + note="## Unaccepted 👇") + ``` + ### Adding An Issue To A Project + + ```python + import pulumi + import pulumi_github as github + + test_repository = github.Repository("testRepository", + has_projects=True, + has_issues=True) + test_issue = github.Issue("testIssue", + repository=test_repository.id, + title="Test issue title", + body="Test issue body") + test_repository_project = github.RepositoryProject("testRepositoryProject", + repository=test_repository.name, + body="this is a test project") + test_project_column = github.ProjectColumn("testProjectColumn", project_id=test_repository_project.id) + test_project_card = github.ProjectCard("testProjectCard", + column_id=test_project_column.column_id, + content_id=test_issue.issue_id, + content_type="Issue") + ``` + ## Import A GitHub Project Card can be imported using its [Card ID](https://developer.github.com/v3/projects/cards/#get-a-project-card): @@ -288,6 +323,41 @@ def __init__(__self__, """ This resource allows you to create and manage cards for GitHub projects. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + project = github.OrganizationProject("project", body="This is an organization project.") + column = github.ProjectColumn("column", project_id=project.id) + card = github.ProjectCard("card", + column_id=column.column_id, + note="## Unaccepted 👇") + ``` + ### Adding An Issue To A Project + + ```python + import pulumi + import pulumi_github as github + + test_repository = github.Repository("testRepository", + has_projects=True, + has_issues=True) + test_issue = github.Issue("testIssue", + repository=test_repository.id, + title="Test issue title", + body="Test issue body") + test_repository_project = github.RepositoryProject("testRepositoryProject", + repository=test_repository.name, + body="this is a test project") + test_project_column = github.ProjectColumn("testProjectColumn", project_id=test_repository_project.id) + test_project_card = github.ProjectCard("testProjectCard", + column_id=test_project_column.column_id, + content_id=test_issue.issue_id, + content_type="Issue") + ``` + ## Import A GitHub Project Card can be imported using its [Card ID](https://developer.github.com/v3/projects/cards/#get-a-project-card): diff --git a/sdk/python/pulumi_github/project_column.py b/sdk/python/pulumi_github/project_column.py index ab9e89f7..381ab216 100644 --- a/sdk/python/pulumi_github/project_column.py +++ b/sdk/python/pulumi_github/project_column.py @@ -167,6 +167,16 @@ def __init__(__self__, """ This resource allows you to create and manage columns for GitHub projects. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + project = github.OrganizationProject("project", body="This is an organization project.") + column = github.ProjectColumn("column", project_id=project.id) + ``` + :param str resource_name: The name of the resource. :param pulumi.ResourceOptions opts: Options for the resource. :param pulumi.Input[str] name: The name of the column. @@ -181,6 +191,16 @@ def __init__(__self__, """ This resource allows you to create and manage columns for GitHub projects. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + project = github.OrganizationProject("project", body="This is an organization project.") + column = github.ProjectColumn("column", project_id=project.id) + ``` + :param str resource_name: The name of the resource. :param ProjectColumnArgs args: The arguments to use to populate this resource's properties. :param pulumi.ResourceOptions opts: Options for the resource. diff --git a/sdk/python/pulumi_github/release.py b/sdk/python/pulumi_github/release.py index d375d788..02d0233e 100644 --- a/sdk/python/pulumi_github/release.py +++ b/sdk/python/pulumi_github/release.py @@ -420,6 +420,38 @@ def __init__(__self__, This resource allows you to create and manage a release in a specific GitHub repository. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + repo = github.Repository("repo", + description="GitHub repo managed by Terraform", + private=False) + example = github.Release("example", + repository=repo.name, + tag_name="v1.0.0") + ``` + ### On Non-Default Branch + + ```python + import pulumi + import pulumi_github as github + + example_repository = github.Repository("exampleRepository", auto_init=True) + example_branch = github.Branch("exampleBranch", + repository=example_repository.name, + branch="branch_name", + source_branch=example_repository.default_branch) + example_release = github.Release("exampleRelease", + repository=example_repository.name, + tag_name="v1.0.0", + target_commitish=example_branch.branch, + draft=False, + prerelease=False) + ``` + ## Import This resource can be imported using the `name` of the repository, combined with the `id` of the release, and a `:` character for separating components, e.g. @@ -450,6 +482,38 @@ def __init__(__self__, This resource allows you to create and manage a release in a specific GitHub repository. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + repo = github.Repository("repo", + description="GitHub repo managed by Terraform", + private=False) + example = github.Release("example", + repository=repo.name, + tag_name="v1.0.0") + ``` + ### On Non-Default Branch + + ```python + import pulumi + import pulumi_github as github + + example_repository = github.Repository("exampleRepository", auto_init=True) + example_branch = github.Branch("exampleBranch", + repository=example_repository.name, + branch="branch_name", + source_branch=example_repository.default_branch) + example_release = github.Release("exampleRelease", + repository=example_repository.name, + tag_name="v1.0.0", + target_commitish=example_branch.branch, + draft=False, + prerelease=False) + ``` + ## Import This resource can be imported using the `name` of the repository, combined with the `id` of the release, and a `:` character for separating components, e.g. diff --git a/sdk/python/pulumi_github/repository.py b/sdk/python/pulumi_github/repository.py index 7e4a5b85..f45187a7 100644 --- a/sdk/python/pulumi_github/repository.py +++ b/sdk/python/pulumi_github/repository.py @@ -1620,6 +1620,38 @@ def __init__(__self__, the `contents:write` permission or else the `allow_merge_commit`, `allow_rebase_merge`, and `allow_squash_merge` attributes will be ignored, causing confusing diffs. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example = github.Repository("example", + description="My awesome codebase", + template=github.RepositoryTemplateArgs( + include_all_branches=True, + owner="github", + repository="terraform-template-module", + ), + visibility="public") + ``` + ### With GitHub Pages Enabled + + ```python + import pulumi + import pulumi_github as github + + example = github.Repository("example", + description="My awesome web page", + pages=github.RepositoryPagesArgs( + source=github.RepositoryPagesSourceArgs( + branch="master", + path="/docs", + ), + ), + private=False) + ``` + ## Import Repositories can be imported using the `name`, e.g. @@ -1683,6 +1715,38 @@ def __init__(__self__, the `contents:write` permission or else the `allow_merge_commit`, `allow_rebase_merge`, and `allow_squash_merge` attributes will be ignored, causing confusing diffs. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example = github.Repository("example", + description="My awesome codebase", + template=github.RepositoryTemplateArgs( + include_all_branches=True, + owner="github", + repository="terraform-template-module", + ), + visibility="public") + ``` + ### With GitHub Pages Enabled + + ```python + import pulumi + import pulumi_github as github + + example = github.Repository("example", + description="My awesome web page", + pages=github.RepositoryPagesArgs( + source=github.RepositoryPagesSourceArgs( + branch="master", + path="/docs", + ), + ), + private=False) + ``` + ## Import Repositories can be imported using the `name`, e.g. diff --git a/sdk/python/pulumi_github/repository_autolink_reference.py b/sdk/python/pulumi_github/repository_autolink_reference.py index 28a93812..cb808fd9 100644 --- a/sdk/python/pulumi_github/repository_autolink_reference.py +++ b/sdk/python/pulumi_github/repository_autolink_reference.py @@ -235,6 +235,21 @@ def __init__(__self__, """ This resource allows you to create and manage an autolink reference for a single repository. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + repo = github.Repository("repo", + description="GitHub repo managed by Terraform", + private=False) + autolink = github.RepositoryAutolinkReference("autolink", + repository=repo.name, + key_prefix="TICKET-", + target_url_template="https://example.com/TICKET?query=") + ``` + ## Import ### Import by key prefix @@ -259,6 +274,21 @@ def __init__(__self__, """ This resource allows you to create and manage an autolink reference for a single repository. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + repo = github.Repository("repo", + description="GitHub repo managed by Terraform", + private=False) + autolink = github.RepositoryAutolinkReference("autolink", + repository=repo.name, + key_prefix="TICKET-", + target_url_template="https://example.com/TICKET?query=") + ``` + ## Import ### Import by key prefix diff --git a/sdk/python/pulumi_github/repository_collaborator.py b/sdk/python/pulumi_github/repository_collaborator.py index d08353fc..bf9bb794 100644 --- a/sdk/python/pulumi_github/repository_collaborator.py +++ b/sdk/python/pulumi_github/repository_collaborator.py @@ -259,6 +259,19 @@ def __init__(__self__, - [Adding outside collaborators to repositories in your organization](https://help.github.com/articles/adding-outside-collaborators-to-repositories-in-your-organization/) - [Converting an organization member to an outside collaborator](https://help.github.com/articles/converting-an-organization-member-to-an-outside-collaborator/) + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + # Add a collaborator to a repository + a_repo_collaborator = github.RepositoryCollaborator("aRepoCollaborator", + permission="admin", + repository="our-cool-repo", + username="SomeUser") + ``` + ## Import GitHub Repository Collaborators can be imported using an ID made up of `repository:username`, e.g. @@ -308,6 +321,19 @@ def __init__(__self__, - [Adding outside collaborators to repositories in your organization](https://help.github.com/articles/adding-outside-collaborators-to-repositories-in-your-organization/) - [Converting an organization member to an outside collaborator](https://help.github.com/articles/converting-an-organization-member-to-an-outside-collaborator/) + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + # Add a collaborator to a repository + a_repo_collaborator = github.RepositoryCollaborator("aRepoCollaborator", + permission="admin", + repository="our-cool-repo", + username="SomeUser") + ``` + ## Import GitHub Repository Collaborators can be imported using an ID made up of `repository:username`, e.g. diff --git a/sdk/python/pulumi_github/repository_collaborators.py b/sdk/python/pulumi_github/repository_collaborators.py index 2e87ec2f..e3facb83 100644 --- a/sdk/python/pulumi_github/repository_collaborators.py +++ b/sdk/python/pulumi_github/repository_collaborators.py @@ -213,6 +213,27 @@ def __init__(__self__, - [Adding outside collaborators to repositories in your organization](https://help.github.com/articles/adding-outside-collaborators-to-repositories-in-your-organization/) - [Converting an organization member to an outside collaborators](https://help.github.com/articles/converting-an-organization-member-to-an-outside-collaborator/) + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + # Add collaborators to a repository + some_team = github.Team("someTeam", description="Some cool team") + some_repo = github.Repository("someRepo") + some_repo_collaborators = github.RepositoryCollaborators("someRepoCollaborators", + repository=some_repo.name, + users=[github.RepositoryCollaboratorsUserArgs( + permission="admin", + username="SomeUser", + )], + teams=[github.RepositoryCollaboratorsTeamArgs( + permission="pull", + team_id=some_team.slug, + )]) + ``` + ## Import GitHub Repository Collaborators can be imported using the name `name`, e.g. @@ -259,6 +280,27 @@ def __init__(__self__, - [Adding outside collaborators to repositories in your organization](https://help.github.com/articles/adding-outside-collaborators-to-repositories-in-your-organization/) - [Converting an organization member to an outside collaborators](https://help.github.com/articles/converting-an-organization-member-to-an-outside-collaborator/) + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + # Add collaborators to a repository + some_team = github.Team("someTeam", description="Some cool team") + some_repo = github.Repository("someRepo") + some_repo_collaborators = github.RepositoryCollaborators("someRepoCollaborators", + repository=some_repo.name, + users=[github.RepositoryCollaboratorsUserArgs( + permission="admin", + username="SomeUser", + )], + teams=[github.RepositoryCollaboratorsTeamArgs( + permission="pull", + team_id=some_team.slug, + )]) + ``` + ## Import GitHub Repository Collaborators can be imported using the name `name`, e.g. diff --git a/sdk/python/pulumi_github/repository_deploy_key.py b/sdk/python/pulumi_github/repository_deploy_key.py index 2ebaa781..cee6ac1e 100644 --- a/sdk/python/pulumi_github/repository_deploy_key.py +++ b/sdk/python/pulumi_github/repository_deploy_key.py @@ -240,6 +240,20 @@ def __init__(__self__, Further documentation on GitHub repository deploy keys: - [About deploy keys](https://developer.github.com/guides/managing-deploy-keys/#deploy-keys) + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + # Add a deploy key + example_repository_deploy_key = github.RepositoryDeployKey("exampleRepositoryDeployKey", + key="ssh-rsa AAA...", + read_only=False, + repository="test-repo", + title="Repository test key") + ``` + ## Import Repository deploy keys can be imported using a colon-separated pair of repository name and GitHub's key id. The latter can be obtained by GitHub's SDKs and API. @@ -275,6 +289,20 @@ def __init__(__self__, Further documentation on GitHub repository deploy keys: - [About deploy keys](https://developer.github.com/guides/managing-deploy-keys/#deploy-keys) + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + # Add a deploy key + example_repository_deploy_key = github.RepositoryDeployKey("exampleRepositoryDeployKey", + key="ssh-rsa AAA...", + read_only=False, + repository="test-repo", + title="Repository test key") + ``` + ## Import Repository deploy keys can be imported using a colon-separated pair of repository name and GitHub's key id. The latter can be obtained by GitHub's SDKs and API. diff --git a/sdk/python/pulumi_github/repository_deployment_branch_policy.py b/sdk/python/pulumi_github/repository_deployment_branch_policy.py index 30b10c97..15d4f266 100644 --- a/sdk/python/pulumi_github/repository_deployment_branch_policy.py +++ b/sdk/python/pulumi_github/repository_deployment_branch_policy.py @@ -189,6 +189,25 @@ def __init__(__self__, """ This resource allows you to create and manage deployment branch policies. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + env = github.RepositoryEnvironment("env", + repository="my_repo", + environment="my_env", + deployment_branch_policy=github.RepositoryEnvironmentDeploymentBranchPolicyArgs( + protected_branches=False, + custom_branch_policies=True, + )) + foo = github.RepositoryDeploymentBranchPolicy("foo", + repository="my_repo", + environment_name="my_env", + opts=pulumi.ResourceOptions(depends_on=[env])) + ``` + ## Import ```sh @@ -210,6 +229,25 @@ def __init__(__self__, """ This resource allows you to create and manage deployment branch policies. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + env = github.RepositoryEnvironment("env", + repository="my_repo", + environment="my_env", + deployment_branch_policy=github.RepositoryEnvironmentDeploymentBranchPolicyArgs( + protected_branches=False, + custom_branch_policies=True, + )) + foo = github.RepositoryDeploymentBranchPolicy("foo", + repository="my_repo", + environment_name="my_env", + opts=pulumi.ResourceOptions(depends_on=[env])) + ``` + ## Import ```sh diff --git a/sdk/python/pulumi_github/repository_environment.py b/sdk/python/pulumi_github/repository_environment.py index 5870d6fd..587fe58d 100644 --- a/sdk/python/pulumi_github/repository_environment.py +++ b/sdk/python/pulumi_github/repository_environment.py @@ -251,6 +251,26 @@ def __init__(__self__, """ This resource allows you to create and manage environments for a GitHub repository. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + current = github.get_user(username="") + example_repository = github.Repository("exampleRepository", description="My awesome codebase") + example_repository_environment = github.RepositoryEnvironment("exampleRepositoryEnvironment", + environment="example", + repository=example_repository.name, + reviewers=[github.RepositoryEnvironmentReviewerArgs( + users=[current.id], + )], + deployment_branch_policy=github.RepositoryEnvironmentDeploymentBranchPolicyArgs( + protected_branches=True, + custom_branch_policies=False, + )) + ``` + ## Import GitHub Repository Environment can be imported using an ID made up of `name` of the repository combined with the `environment` name of the environment, separated by a `:` character, e.g. @@ -276,6 +296,26 @@ def __init__(__self__, """ This resource allows you to create and manage environments for a GitHub repository. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + current = github.get_user(username="") + example_repository = github.Repository("exampleRepository", description="My awesome codebase") + example_repository_environment = github.RepositoryEnvironment("exampleRepositoryEnvironment", + environment="example", + repository=example_repository.name, + reviewers=[github.RepositoryEnvironmentReviewerArgs( + users=[current.id], + )], + deployment_branch_policy=github.RepositoryEnvironmentDeploymentBranchPolicyArgs( + protected_branches=True, + custom_branch_policies=False, + )) + ``` + ## Import GitHub Repository Environment can be imported using an ID made up of `name` of the repository combined with the `environment` name of the environment, separated by a `:` character, e.g. diff --git a/sdk/python/pulumi_github/repository_environment_deployment_policy.py b/sdk/python/pulumi_github/repository_environment_deployment_policy.py index 1a4d48aa..508be63a 100644 --- a/sdk/python/pulumi_github/repository_environment_deployment_policy.py +++ b/sdk/python/pulumi_github/repository_environment_deployment_policy.py @@ -172,6 +172,31 @@ def __init__(__self__, """ This resource allows you to create and manage environment deployment branch policies for a GitHub repository. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + current = github.get_user(username="") + test_repository = github.Repository("testRepository") + test_repository_environment = github.RepositoryEnvironment("testRepositoryEnvironment", + repository=test_repository.name, + environment="environment/test", + wait_timer=10000, + reviewers=[github.RepositoryEnvironmentReviewerArgs( + users=[current.id], + )], + deployment_branch_policy=github.RepositoryEnvironmentDeploymentBranchPolicyArgs( + protected_branches=False, + custom_branch_policies=True, + )) + test_repository_environment_deployment_policy = github.RepositoryEnvironmentDeploymentPolicy("testRepositoryEnvironmentDeploymentPolicy", + repository=test_repository.name, + environment=test_repository_environment.environment, + branch_pattern="releases/*") + ``` + ## Import GitHub Repository Environment Deployment Policy can be imported using an ID made up of `name` of the repository combined with the `environment` name of the environment with the `Id` of the deployment policy, separated by a `:` character, e.g. @@ -195,6 +220,31 @@ def __init__(__self__, """ This resource allows you to create and manage environment deployment branch policies for a GitHub repository. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + current = github.get_user(username="") + test_repository = github.Repository("testRepository") + test_repository_environment = github.RepositoryEnvironment("testRepositoryEnvironment", + repository=test_repository.name, + environment="environment/test", + wait_timer=10000, + reviewers=[github.RepositoryEnvironmentReviewerArgs( + users=[current.id], + )], + deployment_branch_policy=github.RepositoryEnvironmentDeploymentBranchPolicyArgs( + protected_branches=False, + custom_branch_policies=True, + )) + test_repository_environment_deployment_policy = github.RepositoryEnvironmentDeploymentPolicy("testRepositoryEnvironmentDeploymentPolicy", + repository=test_repository.name, + environment=test_repository_environment.environment, + branch_pattern="releases/*") + ``` + ## Import GitHub Repository Environment Deployment Policy can be imported using an ID made up of `name` of the repository combined with the `environment` name of the environment with the `Id` of the deployment policy, separated by a `:` character, e.g. diff --git a/sdk/python/pulumi_github/repository_file.py b/sdk/python/pulumi_github/repository_file.py index 90ad556b..a8a01b14 100644 --- a/sdk/python/pulumi_github/repository_file.py +++ b/sdk/python/pulumi_github/repository_file.py @@ -430,6 +430,24 @@ def __init__(__self__, This resource allows you to create and manage files within a GitHub repository. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + foo_repository = github.Repository("fooRepository", auto_init=True) + foo_repository_file = github.RepositoryFile("fooRepositoryFile", + repository=foo_repository.name, + branch="main", + file=".gitignore", + content="**/*.tfstate", + commit_message="Managed by Terraform", + commit_author="Terraform User", + commit_email="terraform@example.com", + overwrite_on_create=True) + ``` + ## Import Repository files can be imported using a combination of the `repo` and `file`, e.g. @@ -465,6 +483,24 @@ def __init__(__self__, This resource allows you to create and manage files within a GitHub repository. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + foo_repository = github.Repository("fooRepository", auto_init=True) + foo_repository_file = github.RepositoryFile("fooRepositoryFile", + repository=foo_repository.name, + branch="main", + file=".gitignore", + content="**/*.tfstate", + commit_message="Managed by Terraform", + commit_author="Terraform User", + commit_email="terraform@example.com", + overwrite_on_create=True) + ``` + ## Import Repository files can be imported using a combination of the `repo` and `file`, e.g. diff --git a/sdk/python/pulumi_github/repository_milestone.py b/sdk/python/pulumi_github/repository_milestone.py index 5f329f4b..50c3e4dd 100644 --- a/sdk/python/pulumi_github/repository_milestone.py +++ b/sdk/python/pulumi_github/repository_milestone.py @@ -303,6 +303,19 @@ def __init__(__self__, This resource allows you to create and manage milestones for a GitHub Repository within an organization or user account. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + # Create a milestone for a repository + example = github.RepositoryMilestone("example", + owner="example-owner", + repository="example-repository", + title="v1.1.0") + ``` + ## Import A GitHub Repository Milestone can be imported using an ID made up of `owner/repository/number`, e.g. @@ -331,6 +344,19 @@ def __init__(__self__, This resource allows you to create and manage milestones for a GitHub Repository within an organization or user account. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + # Create a milestone for a repository + example = github.RepositoryMilestone("example", + owner="example-owner", + repository="example-repository", + title="v1.1.0") + ``` + ## Import A GitHub Repository Milestone can be imported using an ID made up of `owner/repository/number`, e.g. diff --git a/sdk/python/pulumi_github/repository_project.py b/sdk/python/pulumi_github/repository_project.py index 1147351e..38e66ecf 100644 --- a/sdk/python/pulumi_github/repository_project.py +++ b/sdk/python/pulumi_github/repository_project.py @@ -198,6 +198,20 @@ def __init__(__self__, """ This resource allows you to create and manage projects for GitHub repository. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example = github.Repository("example", + description="My awesome codebase", + has_projects=True) + project = github.RepositoryProject("project", + body="This is a repository project.", + repository=example.name) + ``` + :param str resource_name: The name of the resource. :param pulumi.ResourceOptions opts: Options for the resource. :param pulumi.Input[str] body: The body of the project. @@ -213,6 +227,20 @@ def __init__(__self__, """ This resource allows you to create and manage projects for GitHub repository. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example = github.Repository("example", + description="My awesome codebase", + has_projects=True) + project = github.RepositoryProject("project", + body="This is a repository project.", + repository=example.name) + ``` + :param str resource_name: The name of the resource. :param RepositoryProjectArgs args: The arguments to use to populate this resource's properties. :param pulumi.ResourceOptions opts: Options for the resource. diff --git a/sdk/python/pulumi_github/repository_pull_request.py b/sdk/python/pulumi_github/repository_pull_request.py index c2abfb91..0c590636 100644 --- a/sdk/python/pulumi_github/repository_pull_request.py +++ b/sdk/python/pulumi_github/repository_pull_request.py @@ -505,6 +505,20 @@ def __init__(__self__, """ This resource allows you to create and manage PullRequests for repositories within your GitHub organization or personal account. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example = github.RepositoryPullRequest("example", + base_ref="main", + base_repository="example-repository", + body="This will change everything", + head_ref="feature-branch", + title="My newest feature") + ``` + :param str resource_name: The name of the resource. :param pulumi.ResourceOptions opts: Options for the resource. :param pulumi.Input[str] base_ref: Name of the branch serving as the base of the Pull Request. @@ -524,6 +538,20 @@ def __init__(__self__, """ This resource allows you to create and manage PullRequests for repositories within your GitHub organization or personal account. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example = github.RepositoryPullRequest("example", + base_ref="main", + base_repository="example-repository", + body="This will change everything", + head_ref="feature-branch", + title="My newest feature") + ``` + :param str resource_name: The name of the resource. :param RepositoryPullRequestArgs args: The arguments to use to populate this resource's properties. :param pulumi.ResourceOptions opts: Options for the resource. diff --git a/sdk/python/pulumi_github/repository_ruleset.py b/sdk/python/pulumi_github/repository_ruleset.py index a9d499eb..adeb6df8 100644 --- a/sdk/python/pulumi_github/repository_ruleset.py +++ b/sdk/python/pulumi_github/repository_ruleset.py @@ -382,6 +382,40 @@ def __init__(__self__, This resource allows you to create and manage rulesets on the repository level. When applied, a new ruleset will be created. When destroyed, that ruleset will be removed. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example_repository = github.Repository("exampleRepository", description="Example repository") + example_repository_ruleset = github.RepositoryRuleset("exampleRepositoryRuleset", + repository=example_repository.name, + target="branch", + enforcement="active", + conditions=github.RepositoryRulesetConditionsArgs( + ref_name=github.RepositoryRulesetConditionsRefNameArgs( + includes=["~ALL"], + excludes=[], + ), + ), + bypass_actors=[github.RepositoryRulesetBypassActorArgs( + actor_id=13473, + actor_type="Integration", + bypass_mode="always", + )], + rules=github.RepositoryRulesetRulesArgs( + creation=True, + update=True, + deletion=True, + required_linear_history=True, + required_signatures=True, + required_deployments=github.RepositoryRulesetRulesRequiredDeploymentsArgs( + required_deployment_environments=["test"], + ), + )) + ``` + ## Import GitHub Repository Rulesets can be imported using the GitHub repository name and ruleset ID e.g. @@ -411,6 +445,40 @@ def __init__(__self__, This resource allows you to create and manage rulesets on the repository level. When applied, a new ruleset will be created. When destroyed, that ruleset will be removed. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example_repository = github.Repository("exampleRepository", description="Example repository") + example_repository_ruleset = github.RepositoryRuleset("exampleRepositoryRuleset", + repository=example_repository.name, + target="branch", + enforcement="active", + conditions=github.RepositoryRulesetConditionsArgs( + ref_name=github.RepositoryRulesetConditionsRefNameArgs( + includes=["~ALL"], + excludes=[], + ), + ), + bypass_actors=[github.RepositoryRulesetBypassActorArgs( + actor_id=13473, + actor_type="Integration", + bypass_mode="always", + )], + rules=github.RepositoryRulesetRulesArgs( + creation=True, + update=True, + deletion=True, + required_linear_history=True, + required_signatures=True, + required_deployments=github.RepositoryRulesetRulesRequiredDeploymentsArgs( + required_deployment_environments=["test"], + ), + )) + ``` + ## Import GitHub Repository Rulesets can be imported using the GitHub repository name and ruleset ID e.g. diff --git a/sdk/python/pulumi_github/repository_tag_protection.py b/sdk/python/pulumi_github/repository_tag_protection.py index 8820d926..495b1f20 100644 --- a/sdk/python/pulumi_github/repository_tag_protection.py +++ b/sdk/python/pulumi_github/repository_tag_protection.py @@ -150,6 +150,17 @@ def __init__(__self__, """ This resource allows you to create and manage a repository tag protection for repositories within your GitHub organization or personal account. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example = github.RepositoryTagProtection("example", + pattern="v*", + repository="example-repository") + ``` + ## Import Repository tag protections can be imported using the `name` of the repository, combined with the `id` of the tag protection, separated by a `/` character. The `id` of the tag protection can be found using the [GitHub API](https://docs.github.com/en/rest/repos/tags#list-tag-protection-states-for-a-repository). @@ -174,6 +185,17 @@ def __init__(__self__, """ This resource allows you to create and manage a repository tag protection for repositories within your GitHub organization or personal account. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example = github.RepositoryTagProtection("example", + pattern="v*", + repository="example-repository") + ``` + ## Import Repository tag protections can be imported using the `name` of the repository, combined with the `id` of the tag protection, separated by a `/` character. The `id` of the tag protection can be found using the [GitHub API](https://docs.github.com/en/rest/repos/tags#list-tag-protection-states-for-a-repository). diff --git a/sdk/python/pulumi_github/repository_topics.py b/sdk/python/pulumi_github/repository_topics.py index 856e00c2..b407ea52 100644 --- a/sdk/python/pulumi_github/repository_topics.py +++ b/sdk/python/pulumi_github/repository_topics.py @@ -128,6 +128,21 @@ def __init__(__self__, topics: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None, __props__=None): """ + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + test_repository = github.get_repository(name="test") + test_repository_topics = github.RepositoryTopics("testRepositoryTopics", + repository=github_repository["test"]["name"], + topics=[ + "topic-1", + "topic-2", + ]) + ``` + ## Import Repository topics can be imported using the `name` of the repository. @@ -148,6 +163,21 @@ def __init__(__self__, args: RepositoryTopicsArgs, opts: Optional[pulumi.ResourceOptions] = None): """ + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + test_repository = github.get_repository(name="test") + test_repository_topics = github.RepositoryTopics("testRepositoryTopics", + repository=github_repository["test"]["name"], + topics=[ + "topic-1", + "topic-2", + ]) + ``` + ## Import Repository topics can be imported using the `name` of the repository. diff --git a/sdk/python/pulumi_github/repository_webhook.py b/sdk/python/pulumi_github/repository_webhook.py index 21c80e67..91514955 100644 --- a/sdk/python/pulumi_github/repository_webhook.py +++ b/sdk/python/pulumi_github/repository_webhook.py @@ -239,6 +239,27 @@ def __init__(__self__, This resource allows you to create and manage webhooks for repositories within your GitHub organization or personal account. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + repo = github.Repository("repo", + description="Terraform acceptance tests", + homepage_url="http://example.com/", + visibility="public") + foo = github.RepositoryWebhook("foo", + repository=repo.name, + configuration=github.RepositoryWebhookConfigurationArgs( + url="https://google.de/", + content_type="form", + insecure_ssl=False, + ), + active=False, + events=["issues"]) + ``` + ## Import Repository webhooks can be imported using the `name` of the repository, combined with the `id` of the webhook, separated by a `/` character. The `id` of the webhook can be found in the URL of the webhook. For example`"https://github.com/foo-org/foo-repo/settings/hooks/14711452"`. @@ -267,6 +288,27 @@ def __init__(__self__, This resource allows you to create and manage webhooks for repositories within your GitHub organization or personal account. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + repo = github.Repository("repo", + description="Terraform acceptance tests", + homepage_url="http://example.com/", + visibility="public") + foo = github.RepositoryWebhook("foo", + repository=repo.name, + configuration=github.RepositoryWebhookConfigurationArgs( + url="https://google.de/", + content_type="form", + insecure_ssl=False, + ), + active=False, + events=["issues"]) + ``` + ## Import Repository webhooks can be imported using the `name` of the repository, combined with the `id` of the webhook, separated by a `/` character. The `id` of the webhook can be found in the URL of the webhook. For example`"https://github.com/foo-org/foo-repo/settings/hooks/14711452"`. diff --git a/sdk/python/pulumi_github/team.py b/sdk/python/pulumi_github/team.py index c84abee0..73b22f1f 100644 --- a/sdk/python/pulumi_github/team.py +++ b/sdk/python/pulumi_github/team.py @@ -449,6 +449,18 @@ def __init__(__self__, This resource allows you to add/remove teams from your organization. When applied, a new team will be created. When destroyed, that team will be removed. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + # Add a team to the organization + some_team = github.Team("someTeam", + description="Some cool team", + privacy="closed") + ``` + ## Import GitHub Teams can be imported using the GitHub team ID or name e.g. @@ -485,6 +497,18 @@ def __init__(__self__, This resource allows you to add/remove teams from your organization. When applied, a new team will be created. When destroyed, that team will be removed. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + # Add a team to the organization + some_team = github.Team("someTeam", + description="Some cool team", + privacy="closed") + ``` + ## Import GitHub Teams can be imported using the GitHub team ID or name e.g. diff --git a/sdk/python/pulumi_github/team_members.py b/sdk/python/pulumi_github/team_members.py index 9083c12e..b52b9555 100644 --- a/sdk/python/pulumi_github/team_members.py +++ b/sdk/python/pulumi_github/team_members.py @@ -134,6 +134,34 @@ def __init__(__self__, team_id: Optional[pulumi.Input[str]] = None, __props__=None): """ + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + # Add a user to the organization + membership_for_some_user = github.Membership("membershipForSomeUser", + username="SomeUser", + role="member") + membership_for_another_user = github.Membership("membershipForAnotherUser", + username="AnotherUser", + role="member") + some_team = github.Team("someTeam", description="Some cool team") + some_team_members = github.TeamMembers("someTeamMembers", + team_id=some_team.id, + members=[ + github.TeamMembersMemberArgs( + username="SomeUser", + role="maintainer", + ), + github.TeamMembersMemberArgs( + username="AnotherUser", + role="member", + ), + ]) + ``` + ## Import GitHub Team Membership can be imported using the team ID `teamid` or team name, e.g. @@ -158,6 +186,34 @@ def __init__(__self__, args: TeamMembersArgs, opts: Optional[pulumi.ResourceOptions] = None): """ + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + # Add a user to the organization + membership_for_some_user = github.Membership("membershipForSomeUser", + username="SomeUser", + role="member") + membership_for_another_user = github.Membership("membershipForAnotherUser", + username="AnotherUser", + role="member") + some_team = github.Team("someTeam", description="Some cool team") + some_team_members = github.TeamMembers("someTeamMembers", + team_id=some_team.id, + members=[ + github.TeamMembersMemberArgs( + username="SomeUser", + role="maintainer", + ), + github.TeamMembersMemberArgs( + username="AnotherUser", + role="member", + ), + ]) + ``` + ## Import GitHub Team Membership can be imported using the team ID `teamid` or team name, e.g. diff --git a/sdk/python/pulumi_github/team_membership.py b/sdk/python/pulumi_github/team_membership.py index 0b5604de..2de32aa8 100644 --- a/sdk/python/pulumi_github/team_membership.py +++ b/sdk/python/pulumi_github/team_membership.py @@ -198,6 +198,23 @@ def __init__(__self__, > **Note** Organization owners may not be set as "members" of a team; they may only be set as "maintainers". Attempting to set organization an owner to "member" of a may result in a `pulumi preview` diff that changes their status back to "maintainer". + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + # Add a user to the organization + membership_for_some_user = github.Membership("membershipForSomeUser", + username="SomeUser", + role="member") + some_team = github.Team("someTeam", description="Some cool team") + some_team_membership = github.TeamMembership("someTeamMembership", + team_id=some_team.id, + username="SomeUser", + role="member") + ``` + ## Import GitHub Team Membership can be imported using an ID made up of `teamid:username` or `teamname:username`, e.g. @@ -235,6 +252,23 @@ def __init__(__self__, > **Note** Organization owners may not be set as "members" of a team; they may only be set as "maintainers". Attempting to set organization an owner to "member" of a may result in a `pulumi preview` diff that changes their status back to "maintainer". + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + # Add a user to the organization + membership_for_some_user = github.Membership("membershipForSomeUser", + username="SomeUser", + role="member") + some_team = github.Team("someTeam", description="Some cool team") + some_team_membership = github.TeamMembership("someTeamMembership", + team_id=some_team.id, + username="SomeUser", + role="member") + ``` + ## Import GitHub Team Membership can be imported using an ID made up of `teamid:username` or `teamname:username`, e.g. diff --git a/sdk/python/pulumi_github/team_repository.py b/sdk/python/pulumi_github/team_repository.py index 8d699cfc..a25ffdcb 100644 --- a/sdk/python/pulumi_github/team_repository.py +++ b/sdk/python/pulumi_github/team_repository.py @@ -203,6 +203,21 @@ def __init__(__self__, This resource is non-authoritative, for managing ALL collaborators of a repo, use RepositoryCollaborators instead. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + # Add a repository to the team + some_team = github.Team("someTeam", description="Some cool team") + some_repo = github.Repository("someRepo") + some_team_repo = github.TeamRepository("someTeamRepo", + team_id=some_team.id, + repository=some_repo.name, + permission="pull") + ``` + ## Import GitHub Team Repository can be imported using an ID made up of `team_id:repository` or `team_name:repository`, e.g. @@ -245,6 +260,21 @@ def __init__(__self__, This resource is non-authoritative, for managing ALL collaborators of a repo, use RepositoryCollaborators instead. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + # Add a repository to the team + some_team = github.Team("someTeam", description="Some cool team") + some_repo = github.Repository("someRepo") + some_team_repo = github.TeamRepository("someTeamRepo", + team_id=some_team.id, + repository=some_repo.name, + permission="pull") + ``` + ## Import GitHub Team Repository can be imported using an ID made up of `team_id:repository` or `team_name:repository`, e.g. diff --git a/sdk/python/pulumi_github/team_settings.py b/sdk/python/pulumi_github/team_settings.py index f50c32bd..42f8ead1 100644 --- a/sdk/python/pulumi_github/team_settings.py +++ b/sdk/python/pulumi_github/team_settings.py @@ -185,6 +185,23 @@ def __init__(__self__, > **Note**: This resource relies on the v4 GraphQl GitHub API. If this API is not available, or the Stone Crop schema preview is not available, then this resource will not work as intended. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + # Add a repository to the team + some_team = github.Team("someTeam", description="Some cool team") + code_review_settings = github.TeamSettings("codeReviewSettings", + team_id=some_team.id, + review_request_delegation=github.TeamSettingsReviewRequestDelegationArgs( + algorithm="ROUND_ROBIN", + member_count=1, + notify=True, + )) + ``` + ## Import GitHub Teams can be imported using the GitHub team ID, or the team slug e.g. @@ -218,6 +235,23 @@ def __init__(__self__, > **Note**: This resource relies on the v4 GraphQl GitHub API. If this API is not available, or the Stone Crop schema preview is not available, then this resource will not work as intended. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + # Add a repository to the team + some_team = github.Team("someTeam", description="Some cool team") + code_review_settings = github.TeamSettings("codeReviewSettings", + team_id=some_team.id, + review_request_delegation=github.TeamSettingsReviewRequestDelegationArgs( + algorithm="ROUND_ROBIN", + member_count=1, + notify=True, + )) + ``` + ## Import GitHub Teams can be imported using the GitHub team ID, or the team slug e.g. diff --git a/sdk/python/pulumi_github/user_gpg_key.py b/sdk/python/pulumi_github/user_gpg_key.py index bbd79de3..f871306d 100644 --- a/sdk/python/pulumi_github/user_gpg_key.py +++ b/sdk/python/pulumi_github/user_gpg_key.py @@ -136,6 +136,18 @@ def __init__(__self__, This resource allows you to add/remove GPG keys from your user account. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example = github.UserGpgKey("example", armored_public_key=\"\"\"-----BEGIN PGP PUBLIC KEY BLOCK----- + ... + -----END PGP PUBLIC KEY BLOCK----- + \"\"\") + ``` + ## Import GPG keys are not importable due to the fact that [API](https://developer.github.com/v3/users/gpg_keys/#gpg-keys) does not return previously uploaded GPG key. @@ -156,6 +168,18 @@ def __init__(__self__, This resource allows you to add/remove GPG keys from your user account. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example = github.UserGpgKey("example", armored_public_key=\"\"\"-----BEGIN PGP PUBLIC KEY BLOCK----- + ... + -----END PGP PUBLIC KEY BLOCK----- + \"\"\") + ``` + ## Import GPG keys are not importable due to the fact that [API](https://developer.github.com/v3/users/gpg_keys/#gpg-keys) does not return previously uploaded GPG key. diff --git a/sdk/python/pulumi_github/user_ssh_key.py b/sdk/python/pulumi_github/user_ssh_key.py index 719a9db9..654419ec 100644 --- a/sdk/python/pulumi_github/user_ssh_key.py +++ b/sdk/python/pulumi_github/user_ssh_key.py @@ -164,6 +164,17 @@ def __init__(__self__, This resource allows you to add/remove SSH keys from your user account. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example = github.UserSshKey("example", + title="example title", + key=(lambda path: open(path).read())("~/.ssh/id_rsa.pub")) + ``` + ## Import SSH keys can be imported using their ID e.g. @@ -188,6 +199,17 @@ def __init__(__self__, This resource allows you to add/remove SSH keys from your user account. + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example = github.UserSshKey("example", + title="example title", + key=(lambda path: open(path).read())("~/.ssh/id_rsa.pub")) + ``` + ## Import SSH keys can be imported using their ID e.g.