1. Packages
  2. Github Provider
  3. API Docs
  4. getRepositoryEnvironmentDeploymentPolicies
GitHub v6.11.0 published on Wednesday, Jan 21, 2026 by Pulumi
github logo
GitHub v6.11.0 published on Wednesday, Jan 21, 2026 by Pulumi

    Use this data source to retrieve deployment branch policies for a repository environment.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as github from "@pulumi/github";
    
    const example = github.getRepositoryEnvironmentDeploymentPolicies({
        repository: "example-repository",
        environment: "env-name",
    });
    
    import pulumi
    import pulumi_github as github
    
    example = github.get_repository_environment_deployment_policies(repository="example-repository",
        environment="env-name")
    
    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.GetRepositoryEnvironmentDeploymentPolicies(ctx, &github.GetRepositoryEnvironmentDeploymentPoliciesArgs{
    			Repository:  "example-repository",
    			Environment: "env-name",
    		}, nil)
    		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 example = Github.GetRepositoryEnvironmentDeploymentPolicies.Invoke(new()
        {
            Repository = "example-repository",
            Environment = "env-name",
        });
    
    });
    
    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.GetRepositoryEnvironmentDeploymentPoliciesArgs;
    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 example = GithubFunctions.getRepositoryEnvironmentDeploymentPolicies(GetRepositoryEnvironmentDeploymentPoliciesArgs.builder()
                .repository("example-repository")
                .environment("env-name")
                .build());
    
        }
    }
    
    variables:
      example:
        fn::invoke:
          function: github:getRepositoryEnvironmentDeploymentPolicies
          arguments:
            repository: example-repository
            environment: env-name
    

    Using getRepositoryEnvironmentDeploymentPolicies

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getRepositoryEnvironmentDeploymentPolicies(args: GetRepositoryEnvironmentDeploymentPoliciesArgs, opts?: InvokeOptions): Promise<GetRepositoryEnvironmentDeploymentPoliciesResult>
    function getRepositoryEnvironmentDeploymentPoliciesOutput(args: GetRepositoryEnvironmentDeploymentPoliciesOutputArgs, opts?: InvokeOptions): Output<GetRepositoryEnvironmentDeploymentPoliciesResult>
    def get_repository_environment_deployment_policies(environment: Optional[str] = None,
                                                       repository: Optional[str] = None,
                                                       opts: Optional[InvokeOptions] = None) -> GetRepositoryEnvironmentDeploymentPoliciesResult
    def get_repository_environment_deployment_policies_output(environment: Optional[pulumi.Input[str]] = None,
                                                       repository: Optional[pulumi.Input[str]] = None,
                                                       opts: Optional[InvokeOptions] = None) -> Output[GetRepositoryEnvironmentDeploymentPoliciesResult]
    func GetRepositoryEnvironmentDeploymentPolicies(ctx *Context, args *GetRepositoryEnvironmentDeploymentPoliciesArgs, opts ...InvokeOption) (*GetRepositoryEnvironmentDeploymentPoliciesResult, error)
    func GetRepositoryEnvironmentDeploymentPoliciesOutput(ctx *Context, args *GetRepositoryEnvironmentDeploymentPoliciesOutputArgs, opts ...InvokeOption) GetRepositoryEnvironmentDeploymentPoliciesResultOutput

    > Note: This function is named GetRepositoryEnvironmentDeploymentPolicies in the Go SDK.

    public static class GetRepositoryEnvironmentDeploymentPolicies 
    {
        public static Task<GetRepositoryEnvironmentDeploymentPoliciesResult> InvokeAsync(GetRepositoryEnvironmentDeploymentPoliciesArgs args, InvokeOptions? opts = null)
        public static Output<GetRepositoryEnvironmentDeploymentPoliciesResult> Invoke(GetRepositoryEnvironmentDeploymentPoliciesInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetRepositoryEnvironmentDeploymentPoliciesResult> getRepositoryEnvironmentDeploymentPolicies(GetRepositoryEnvironmentDeploymentPoliciesArgs args, InvokeOptions options)
    public static Output<GetRepositoryEnvironmentDeploymentPoliciesResult> getRepositoryEnvironmentDeploymentPolicies(GetRepositoryEnvironmentDeploymentPoliciesArgs args, InvokeOptions options)
    
    fn::invoke:
      function: github:index/getRepositoryEnvironmentDeploymentPolicies:getRepositoryEnvironmentDeploymentPolicies
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Environment string
    Name of the environment to retrieve the deployment branch policies from.
    Repository string
    Name of the repository to retrieve the deployment branch policies from.
    Environment string
    Name of the environment to retrieve the deployment branch policies from.
    Repository string
    Name of the repository to retrieve the deployment branch policies from.
    environment String
    Name of the environment to retrieve the deployment branch policies from.
    repository String
    Name of the repository to retrieve the deployment branch policies from.
    environment string
    Name of the environment to retrieve the deployment branch policies from.
    repository string
    Name of the repository to retrieve the deployment branch policies from.
    environment str
    Name of the environment to retrieve the deployment branch policies from.
    repository str
    Name of the repository to retrieve the deployment branch policies from.
    environment String
    Name of the environment to retrieve the deployment branch policies from.
    repository String
    Name of the repository to retrieve the deployment branch policies from.

    getRepositoryEnvironmentDeploymentPolicies Result

    The following output properties are available:

    Environment string
    Id string
    The provider-assigned unique ID for this managed resource.
    Policies List<GetRepositoryEnvironmentDeploymentPoliciesPolicy>
    The list of deployment policies for the repository environment. Each element of policies has the following attributes:
    Repository string
    Environment string
    Id string
    The provider-assigned unique ID for this managed resource.
    Policies []GetRepositoryEnvironmentDeploymentPoliciesPolicy
    The list of deployment policies for the repository environment. Each element of policies has the following attributes:
    Repository string
    environment String
    id String
    The provider-assigned unique ID for this managed resource.
    policies List<GetRepositoryEnvironmentDeploymentPoliciesPolicy>
    The list of deployment policies for the repository environment. Each element of policies has the following attributes:
    repository String
    environment string
    id string
    The provider-assigned unique ID for this managed resource.
    policies GetRepositoryEnvironmentDeploymentPoliciesPolicy[]
    The list of deployment policies for the repository environment. Each element of policies has the following attributes:
    repository string
    environment str
    id str
    The provider-assigned unique ID for this managed resource.
    policies Sequence[GetRepositoryEnvironmentDeploymentPoliciesPolicy]
    The list of deployment policies for the repository environment. Each element of policies has the following attributes:
    repository str
    environment String
    id String
    The provider-assigned unique ID for this managed resource.
    policies List<Property Map>
    The list of deployment policies for the repository environment. Each element of policies has the following attributes:
    repository String

    Supporting Types

    GetRepositoryEnvironmentDeploymentPoliciesPolicy

    Pattern string
    The pattern that branch or tag names must match in order to deploy to the environment.
    Type string
    Type of the policy; this could be branch or tag.
    Pattern string
    The pattern that branch or tag names must match in order to deploy to the environment.
    Type string
    Type of the policy; this could be branch or tag.
    pattern String
    The pattern that branch or tag names must match in order to deploy to the environment.
    type String
    Type of the policy; this could be branch or tag.
    pattern string
    The pattern that branch or tag names must match in order to deploy to the environment.
    type string
    Type of the policy; this could be branch or tag.
    pattern str
    The pattern that branch or tag names must match in order to deploy to the environment.
    type str
    Type of the policy; this could be branch or tag.
    pattern String
    The pattern that branch or tag names must match in order to deploy to the environment.
    type String
    Type of the policy; this could be branch or tag.

    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.11.0 published on Wednesday, Jan 21, 2026 by Pulumi
      Meet Neo: Your AI Platform Teammate