1. Packages
  2. Github Provider
  3. API Docs
  4. getRepositoryDeploymentBranchPolicies
GitHub v6.7.0 published on Friday, Feb 28, 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",
});
Copy
import pulumi
import pulumi_github as github

example = github.get_repository_deployment_branch_policies(repository="example-repository",
    environment_name="env_name")
Copy
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
	})
}
Copy
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",
    });

});
Copy
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());

    }
}
Copy
variables:
  example:
    fn::invoke:
      function: github:getRepositoryDeploymentBranchPolicies
      arguments:
        repository: example-repository
        environmentName: env_name
Copy

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>
Copy
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]
Copy
func GetRepositoryDeploymentBranchPolicies(ctx *Context, args *GetRepositoryDeploymentBranchPoliciesArgs, opts ...InvokeOption) (*GetRepositoryDeploymentBranchPoliciesResult, error)
func GetRepositoryDeploymentBranchPoliciesOutput(ctx *Context, args *GetRepositoryDeploymentBranchPoliciesOutputArgs, opts ...InvokeOption) GetRepositoryDeploymentBranchPoliciesResultOutput
Copy

> 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)
}
Copy
public static CompletableFuture<GetRepositoryDeploymentBranchPoliciesResult> getRepositoryDeploymentBranchPolicies(GetRepositoryDeploymentBranchPoliciesArgs args, InvokeOptions options)
public static Output<GetRepositoryDeploymentBranchPoliciesResult> getRepositoryDeploymentBranchPolicies(GetRepositoryDeploymentBranchPoliciesArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: github:index/getRepositoryDeploymentBranchPolicies:getRepositoryDeploymentBranchPolicies
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

EnvironmentName
This property is required.
Changes to this property will trigger replacement.
string
Name of the environment to retrieve the deployment branch policies from.
Repository
This property is required.
Changes to this property will trigger replacement.
string
Name of the repository to retrieve the deployment branch policies from.
EnvironmentName
This property is required.
Changes to this property will trigger replacement.
string
Name of the environment to retrieve the deployment branch policies from.
Repository
This property is required.
Changes to this property will trigger replacement.
string
Name of the repository to retrieve the deployment branch policies from.
environmentName
This property is required.
Changes to this property will trigger replacement.
String
Name of the environment to retrieve the deployment branch policies from.
repository
This property is required.
Changes to this property will trigger replacement.
String
Name of the repository to retrieve the deployment branch policies from.
environmentName
This property is required.
Changes to this property will trigger replacement.
string
Name of the environment to retrieve the deployment branch policies from.
repository
This property is required.
Changes to this property will trigger replacement.
string
Name of the repository to retrieve the deployment branch policies from.
environment_name
This property is required.
Changes to this property will trigger replacement.
str
Name of the environment to retrieve the deployment branch policies from.
repository
This property is required.
Changes to this property will trigger replacement.
str
Name of the repository to retrieve the deployment branch policies from.
environmentName
This property is required.
Changes to this property will trigger replacement.
String
Name of the environment to retrieve the deployment branch policies from.
repository
This property is required.
Changes to this property will trigger replacement.
String
Name of the repository to retrieve the deployment branch policies from.

getRepositoryDeploymentBranchPolicies Result

The following output properties are available:

DeploymentBranchPolicies List<GetRepositoryDeploymentBranchPoliciesDeploymentBranchPolicy>
The list of this repository / environment deployment policies. Each element of deployment_branch_policies has the following attributes:
EnvironmentName string
Id string
The provider-assigned unique ID for this managed resource.
Repository string
DeploymentBranchPolicies []GetRepositoryDeploymentBranchPoliciesDeploymentBranchPolicy
The list of this repository / environment deployment policies. Each element of deployment_branch_policies has the following attributes:
EnvironmentName string
Id string
The provider-assigned unique ID for this managed resource.
Repository string
deploymentBranchPolicies List<GetRepositoryDeploymentBranchPoliciesDeploymentBranchPolicy>
The list of this repository / environment deployment policies. Each element of deployment_branch_policies has the following attributes:
environmentName String
id String
The provider-assigned unique ID for this managed resource.
repository String
deploymentBranchPolicies GetRepositoryDeploymentBranchPoliciesDeploymentBranchPolicy[]
The list of this repository / environment deployment policies. Each element of deployment_branch_policies has the following attributes:
environmentName string
id string
The provider-assigned unique ID for this managed resource.
repository string
deployment_branch_policies Sequence[GetRepositoryDeploymentBranchPoliciesDeploymentBranchPolicy]
The list of this repository / environment deployment policies. Each element of deployment_branch_policies has the following attributes:
environment_name str
id str
The provider-assigned unique ID for this managed resource.
repository str
deploymentBranchPolicies List<Property Map>
The list of this repository / environment deployment policies. Each element of deployment_branch_policies has the following attributes:
environmentName String
id String
The provider-assigned unique ID for this managed resource.
repository String

Supporting Types

GetRepositoryDeploymentBranchPoliciesDeploymentBranchPolicy

Id This property is required. string
Id of the policy.
Name This property is required. string
The name pattern that branches must match in order to deploy to the environment.
Id This property is required. string
Id of the policy.
Name This property is required. string
The name pattern that branches must match in order to deploy to the environment.
id This property is required. String
Id of the policy.
name This property is required. String
The name pattern that branches must match in order to deploy to the environment.
id This property is required. string
Id of the policy.
name This property is required. string
The name pattern that branches must match in order to deploy to the environment.
id This property is required. str
Id of the policy.
name This property is required. str
The name pattern that branches must match in order to deploy to the environment.
id This property is required. String
Id of the policy.
name This property is required. String
The name pattern that branches must match in order to deploy to the environment.

Package Details

Repository
GitHub pulumi/pulumi-github
License
Apache-2.0
Notes
This Pulumi package is based on the github Terraform Provider.