1. Packages
  2. Github Provider
  3. API Docs
  4. ActionsOrganizationSecretRepository
GitHub v6.8.0 published on Thursday, Oct 23, 2025 by Pulumi

github.ActionsOrganizationSecretRepository

Get Started
github logo
GitHub v6.8.0 published on Thursday, Oct 23, 2025 by Pulumi

    This resource help you to allow/unallow a repository to use an existing GitHub Actions secrets within your GitHub organization. You must have write access to an organization secret to use this resource.

    This resource is only applicable when visibility of the existing organization secret has been set to selected.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as github from "@pulumi/github";
    
    const repo = github.getRepository({
        fullName: "my-org/repo",
    });
    const orgSecretRepos = new github.ActionsOrganizationSecretRepository("org_secret_repos", {
        secretName: "EXAMPLE_SECRET_NAME",
        repositoryId: repoGithubRepository.repoId,
    });
    
    import pulumi
    import pulumi_github as github
    
    repo = github.get_repository(full_name="my-org/repo")
    org_secret_repos = github.ActionsOrganizationSecretRepository("org_secret_repos",
        secret_name="EXAMPLE_SECRET_NAME",
        repository_id=repo_github_repository["repoId"])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-github/sdk/v6/go/github"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := github.LookupRepository(ctx, &github.LookupRepositoryArgs{
    			FullName: pulumi.StringRef("my-org/repo"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = github.NewActionsOrganizationSecretRepository(ctx, "org_secret_repos", &github.ActionsOrganizationSecretRepositoryArgs{
    			SecretName:   pulumi.String("EXAMPLE_SECRET_NAME"),
    			RepositoryId: pulumi.Any(repoGithubRepository.RepoId),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    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.ActionsOrganizationSecretRepository("org_secret_repos", new()
        {
            SecretName = "EXAMPLE_SECRET_NAME",
            RepositoryId = repoGithubRepository.RepoId,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.github.GithubFunctions;
    import com.pulumi.github.inputs.GetRepositoryArgs;
    import com.pulumi.github.ActionsOrganizationSecretRepository;
    import com.pulumi.github.ActionsOrganizationSecretRepositoryArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            final var repo = GithubFunctions.getRepository(GetRepositoryArgs.builder()
                .fullName("my-org/repo")
                .build());
    
            var orgSecretRepos = new ActionsOrganizationSecretRepository("orgSecretRepos", ActionsOrganizationSecretRepositoryArgs.builder()
                .secretName("EXAMPLE_SECRET_NAME")
                .repositoryId(repoGithubRepository.repoId())
                .build());
    
        }
    }
    
    resources:
      orgSecretRepos:
        type: github:ActionsOrganizationSecretRepository
        name: org_secret_repos
        properties:
          secretName: EXAMPLE_SECRET_NAME
          repositoryId: ${repoGithubRepository.repoId}
    variables:
      repo:
        fn::invoke:
          function: github:getRepository
          arguments:
            fullName: my-org/repo
    

    Create ActionsOrganizationSecretRepository Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new ActionsOrganizationSecretRepository(name: string, args: ActionsOrganizationSecretRepositoryArgs, opts?: CustomResourceOptions);
    @overload
    def ActionsOrganizationSecretRepository(resource_name: str,
                                            args: ActionsOrganizationSecretRepositoryArgs,
                                            opts: Optional[ResourceOptions] = None)
    
    @overload
    def ActionsOrganizationSecretRepository(resource_name: str,
                                            opts: Optional[ResourceOptions] = None,
                                            repository_id: Optional[int] = None,
                                            secret_name: Optional[str] = None)
    func NewActionsOrganizationSecretRepository(ctx *Context, name string, args ActionsOrganizationSecretRepositoryArgs, opts ...ResourceOption) (*ActionsOrganizationSecretRepository, error)
    public ActionsOrganizationSecretRepository(string name, ActionsOrganizationSecretRepositoryArgs args, CustomResourceOptions? opts = null)
    public ActionsOrganizationSecretRepository(String name, ActionsOrganizationSecretRepositoryArgs args)
    public ActionsOrganizationSecretRepository(String name, ActionsOrganizationSecretRepositoryArgs args, CustomResourceOptions options)
    
    type: github:ActionsOrganizationSecretRepository
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args ActionsOrganizationSecretRepositoryArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args ActionsOrganizationSecretRepositoryArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args ActionsOrganizationSecretRepositoryArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ActionsOrganizationSecretRepositoryArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ActionsOrganizationSecretRepositoryArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var actionsOrganizationSecretRepositoryResource = new Github.ActionsOrganizationSecretRepository("actionsOrganizationSecretRepositoryResource", new()
    {
        RepositoryId = 0,
        SecretName = "string",
    });
    
    example, err := github.NewActionsOrganizationSecretRepository(ctx, "actionsOrganizationSecretRepositoryResource", &github.ActionsOrganizationSecretRepositoryArgs{
    	RepositoryId: pulumi.Int(0),
    	SecretName:   pulumi.String("string"),
    })
    
    var actionsOrganizationSecretRepositoryResource = new ActionsOrganizationSecretRepository("actionsOrganizationSecretRepositoryResource", ActionsOrganizationSecretRepositoryArgs.builder()
        .repositoryId(0)
        .secretName("string")
        .build());
    
    actions_organization_secret_repository_resource = github.ActionsOrganizationSecretRepository("actionsOrganizationSecretRepositoryResource",
        repository_id=0,
        secret_name="string")
    
    const actionsOrganizationSecretRepositoryResource = new github.ActionsOrganizationSecretRepository("actionsOrganizationSecretRepositoryResource", {
        repositoryId: 0,
        secretName: "string",
    });
    
    type: github:ActionsOrganizationSecretRepository
    properties:
        repositoryId: 0
        secretName: string
    

    ActionsOrganizationSecretRepository Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The ActionsOrganizationSecretRepository resource accepts the following input properties:

    RepositoryId int
    Repository id that can access the organization secret.
    SecretName string
    Name of the existing secret
    RepositoryId int
    Repository id that can access the organization secret.
    SecretName string
    Name of the existing secret
    repositoryId Integer
    Repository id that can access the organization secret.
    secretName String
    Name of the existing secret
    repositoryId number
    Repository id that can access the organization secret.
    secretName string
    Name of the existing secret
    repository_id int
    Repository id that can access the organization secret.
    secret_name str
    Name of the existing secret
    repositoryId Number
    Repository id that can access the organization secret.
    secretName String
    Name of the existing secret

    Outputs

    All input properties are implicitly available as output properties. Additionally, the ActionsOrganizationSecretRepository resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing ActionsOrganizationSecretRepository Resource

    Get an existing ActionsOrganizationSecretRepository resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: ActionsOrganizationSecretRepositoryState, opts?: CustomResourceOptions): ActionsOrganizationSecretRepository
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            repository_id: Optional[int] = None,
            secret_name: Optional[str] = None) -> ActionsOrganizationSecretRepository
    func GetActionsOrganizationSecretRepository(ctx *Context, name string, id IDInput, state *ActionsOrganizationSecretRepositoryState, opts ...ResourceOption) (*ActionsOrganizationSecretRepository, error)
    public static ActionsOrganizationSecretRepository Get(string name, Input<string> id, ActionsOrganizationSecretRepositoryState? state, CustomResourceOptions? opts = null)
    public static ActionsOrganizationSecretRepository get(String name, Output<String> id, ActionsOrganizationSecretRepositoryState state, CustomResourceOptions options)
    resources:  _:    type: github:ActionsOrganizationSecretRepository    get:      id: ${id}
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    RepositoryId int
    Repository id that can access the organization secret.
    SecretName string
    Name of the existing secret
    RepositoryId int
    Repository id that can access the organization secret.
    SecretName string
    Name of the existing secret
    repositoryId Integer
    Repository id that can access the organization secret.
    secretName String
    Name of the existing secret
    repositoryId number
    Repository id that can access the organization secret.
    secretName string
    Name of the existing secret
    repository_id int
    Repository id that can access the organization secret.
    secret_name str
    Name of the existing secret
    repositoryId Number
    Repository id that can access the organization secret.
    secretName String
    Name of the existing secret

    Import

    This resource can be imported using an ID made up of the secret name:

    $ pulumi import github:index/actionsOrganizationSecretRepository:ActionsOrganizationSecretRepository test_secret_repos test_secret_name:repo_id
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    GitHub pulumi/pulumi-github
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the github Terraform Provider.
    github logo
    GitHub v6.8.0 published on Thursday, Oct 23, 2025 by Pulumi
      Meet Neo: Your AI Platform Teammate