GitHub v6.7.2 published on Wednesday, Apr 30, 2025 by Pulumi
github.getRepositoryDeploymentBranchPolicies
Explore with Pulumi AI
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.getRepositoryDeploymentBranchPolicies({
    repository: "example-repository",
    environmentName: "env_name",
});
import pulumi
import pulumi_github as github
example = github.get_repository_deployment_branch_policies(repository="example-repository",
    environment_name="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.GetRepositoryDeploymentBranchPolicies(ctx, &github.GetRepositoryDeploymentBranchPoliciesArgs{
			Repository:      "example-repository",
			EnvironmentName: "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.GetRepositoryDeploymentBranchPolicies.Invoke(new()
    {
        Repository = "example-repository",
        EnvironmentName = "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.GetRepositoryDeploymentBranchPoliciesArgs;
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.getRepositoryDeploymentBranchPolicies(GetRepositoryDeploymentBranchPoliciesArgs.builder()
            .repository("example-repository")
            .environmentName("env_name")
            .build());
    }
}
variables:
  example:
    fn::invoke:
      function: github:getRepositoryDeploymentBranchPolicies
      arguments:
        repository: example-repository
        environmentName: env_name
Using getRepositoryDeploymentBranchPolicies
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 getRepositoryDeploymentBranchPolicies(args: GetRepositoryDeploymentBranchPoliciesArgs, opts?: InvokeOptions): Promise<GetRepositoryDeploymentBranchPoliciesResult>
function getRepositoryDeploymentBranchPoliciesOutput(args: GetRepositoryDeploymentBranchPoliciesOutputArgs, opts?: InvokeOptions): Output<GetRepositoryDeploymentBranchPoliciesResult>def get_repository_deployment_branch_policies(environment_name: Optional[str] = None,
                                              repository: Optional[str] = None,
                                              opts: Optional[InvokeOptions] = None) -> GetRepositoryDeploymentBranchPoliciesResult
def get_repository_deployment_branch_policies_output(environment_name: Optional[pulumi.Input[str]] = None,
                                              repository: Optional[pulumi.Input[str]] = None,
                                              opts: Optional[InvokeOptions] = None) -> Output[GetRepositoryDeploymentBranchPoliciesResult]func GetRepositoryDeploymentBranchPolicies(ctx *Context, args *GetRepositoryDeploymentBranchPoliciesArgs, opts ...InvokeOption) (*GetRepositoryDeploymentBranchPoliciesResult, error)
func GetRepositoryDeploymentBranchPoliciesOutput(ctx *Context, args *GetRepositoryDeploymentBranchPoliciesOutputArgs, opts ...InvokeOption) GetRepositoryDeploymentBranchPoliciesResultOutput> Note: This function is named GetRepositoryDeploymentBranchPolicies in the Go SDK.
public static class GetRepositoryDeploymentBranchPolicies 
{
    public static Task<GetRepositoryDeploymentBranchPoliciesResult> InvokeAsync(GetRepositoryDeploymentBranchPoliciesArgs args, InvokeOptions? opts = null)
    public static Output<GetRepositoryDeploymentBranchPoliciesResult> Invoke(GetRepositoryDeploymentBranchPoliciesInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetRepositoryDeploymentBranchPoliciesResult> getRepositoryDeploymentBranchPolicies(GetRepositoryDeploymentBranchPoliciesArgs args, InvokeOptions options)
public static Output<GetRepositoryDeploymentBranchPoliciesResult> getRepositoryDeploymentBranchPolicies(GetRepositoryDeploymentBranchPoliciesArgs args, InvokeOptions options)
fn::invoke:
  function: github:index/getRepositoryDeploymentBranchPolicies:getRepositoryDeploymentBranchPolicies
  arguments:
    # arguments dictionaryThe following arguments are supported:
- EnvironmentName 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.
- EnvironmentName 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.
- environmentName 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.
- environmentName 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_name 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.
- environmentName 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.
getRepositoryDeploymentBranchPolicies Result
The following output properties are available:
- DeploymentBranch List<GetPolicies Repository Deployment Branch Policies Deployment Branch Policy> 
- The list of this repository / environment deployment policies. Each element of deployment_branch_policieshas the following attributes:
- EnvironmentName string
- Id string
- The provider-assigned unique ID for this managed resource.
- Repository string
- DeploymentBranch []GetPolicies Repository Deployment Branch Policies Deployment Branch Policy 
- The list of this repository / environment deployment policies. Each element of deployment_branch_policieshas the following attributes:
- EnvironmentName string
- Id string
- The provider-assigned unique ID for this managed resource.
- Repository string
- deploymentBranch List<GetPolicies Repository Deployment Branch Policies Deployment Branch Policy> 
- The list of this repository / environment deployment policies. Each element of deployment_branch_policieshas the following attributes:
- environmentName String
- id String
- The provider-assigned unique ID for this managed resource.
- repository String
- deploymentBranch GetPolicies Repository Deployment Branch Policies Deployment Branch Policy[] 
- The list of this repository / environment deployment policies. Each element of deployment_branch_policieshas the following attributes:
- environmentName string
- id string
- The provider-assigned unique ID for this managed resource.
- repository string
- deployment_branch_ Sequence[Getpolicies Repository Deployment Branch Policies Deployment Branch Policy] 
- The list of this repository / environment deployment policies. Each element of deployment_branch_policieshas the following attributes:
- environment_name str
- id str
- The provider-assigned unique ID for this managed resource.
- repository str
- deploymentBranch List<Property Map>Policies 
- The list of this repository / environment deployment policies. Each element of deployment_branch_policieshas the following attributes:
- environmentName String
- id String
- The provider-assigned unique ID for this managed resource.
- repository String
Supporting Types
GetRepositoryDeploymentBranchPoliciesDeploymentBranchPolicy       
Package Details
- Repository
- GitHub pulumi/pulumi-github
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the githubTerraform Provider.