GitHub v6.3.2 published on Friday, Oct 11, 2024 by Pulumi
github.getRepositoryBranches
Explore with Pulumi AI
Use this data source to retrieve information about branches in a repository.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as github from "@pulumi/github";
const example = github.getRepositoryBranches({
repository: "example-repository",
});
import pulumi
import pulumi_github as github
example = github.get_repository_branches(repository="example-repository")
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.GetRepositoryBranches(ctx, &github.GetRepositoryBranchesArgs{
Repository: "example-repository",
}, 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.GetRepositoryBranches.Invoke(new()
{
Repository = "example-repository",
});
});
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.GetRepositoryBranchesArgs;
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.getRepositoryBranches(GetRepositoryBranchesArgs.builder()
.repository("example-repository")
.build());
}
}
variables:
example:
fn::invoke:
Function: github:getRepositoryBranches
Arguments:
repository: example-repository
Using getRepositoryBranches
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 getRepositoryBranches(args: GetRepositoryBranchesArgs, opts?: InvokeOptions): Promise<GetRepositoryBranchesResult>
function getRepositoryBranchesOutput(args: GetRepositoryBranchesOutputArgs, opts?: InvokeOptions): Output<GetRepositoryBranchesResult>
def get_repository_branches(only_non_protected_branches: Optional[bool] = None,
only_protected_branches: Optional[bool] = None,
repository: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetRepositoryBranchesResult
def get_repository_branches_output(only_non_protected_branches: Optional[pulumi.Input[bool]] = None,
only_protected_branches: Optional[pulumi.Input[bool]] = None,
repository: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetRepositoryBranchesResult]
func GetRepositoryBranches(ctx *Context, args *GetRepositoryBranchesArgs, opts ...InvokeOption) (*GetRepositoryBranchesResult, error)
func GetRepositoryBranchesOutput(ctx *Context, args *GetRepositoryBranchesOutputArgs, opts ...InvokeOption) GetRepositoryBranchesResultOutput
> Note: This function is named GetRepositoryBranches
in the Go SDK.
public static class GetRepositoryBranches
{
public static Task<GetRepositoryBranchesResult> InvokeAsync(GetRepositoryBranchesArgs args, InvokeOptions? opts = null)
public static Output<GetRepositoryBranchesResult> Invoke(GetRepositoryBranchesInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetRepositoryBranchesResult> getRepositoryBranches(GetRepositoryBranchesArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
function: github:index/getRepositoryBranches:getRepositoryBranches
arguments:
# arguments dictionary
The following arguments are supported:
- Repository string
- Name of the repository to retrieve the branches from.
- Only
Non boolProtected Branches - . If true, the
branches
attributes will be populated only with non protected branches. Default:false
. - Only
Protected boolBranches - . If true, the
branches
attributes will be populated only with protected branches. Default:false
.
- Repository string
- Name of the repository to retrieve the branches from.
- Only
Non boolProtected Branches - . If true, the
branches
attributes will be populated only with non protected branches. Default:false
. - Only
Protected boolBranches - . If true, the
branches
attributes will be populated only with protected branches. Default:false
.
- repository String
- Name of the repository to retrieve the branches from.
- only
Non BooleanProtected Branches - . If true, the
branches
attributes will be populated only with non protected branches. Default:false
. - only
Protected BooleanBranches - . If true, the
branches
attributes will be populated only with protected branches. Default:false
.
- repository string
- Name of the repository to retrieve the branches from.
- only
Non booleanProtected Branches - . If true, the
branches
attributes will be populated only with non protected branches. Default:false
. - only
Protected booleanBranches - . If true, the
branches
attributes will be populated only with protected branches. Default:false
.
- repository str
- Name of the repository to retrieve the branches from.
- only_
non_ boolprotected_ branches - . If true, the
branches
attributes will be populated only with non protected branches. Default:false
. - only_
protected_ boolbranches - . If true, the
branches
attributes will be populated only with protected branches. Default:false
.
- repository String
- Name of the repository to retrieve the branches from.
- only
Non BooleanProtected Branches - . If true, the
branches
attributes will be populated only with non protected branches. Default:false
. - only
Protected BooleanBranches - . If true, the
branches
attributes will be populated only with protected branches. Default:false
.
getRepositoryBranches Result
The following output properties are available:
- Branches
List<Get
Repository Branches Branch> - The list of this repository's branches. Each element of
branches
has the following attributes: - Id string
- The provider-assigned unique ID for this managed resource.
- Repository string
- Only
Non boolProtected Branches - Only
Protected boolBranches
- Branches
[]Get
Repository Branches Branch - The list of this repository's branches. Each element of
branches
has the following attributes: - Id string
- The provider-assigned unique ID for this managed resource.
- Repository string
- Only
Non boolProtected Branches - Only
Protected boolBranches
- branches
List<Get
Repository Branches Branch> - The list of this repository's branches. Each element of
branches
has the following attributes: - id String
- The provider-assigned unique ID for this managed resource.
- repository String
- only
Non BooleanProtected Branches - only
Protected BooleanBranches
- branches
Get
Repository Branches Branch[] - The list of this repository's branches. Each element of
branches
has the following attributes: - id string
- The provider-assigned unique ID for this managed resource.
- repository string
- only
Non booleanProtected Branches - only
Protected booleanBranches
- branches
Sequence[Get
Repository Branches Branch] - The list of this repository's branches. Each element of
branches
has the following attributes: - id str
- The provider-assigned unique ID for this managed resource.
- repository str
- only_
non_ boolprotected_ branches - only_
protected_ boolbranches
- branches List<Property Map>
- The list of this repository's branches. Each element of
branches
has the following attributes: - id String
- The provider-assigned unique ID for this managed resource.
- repository String
- only
Non BooleanProtected Branches - only
Protected BooleanBranches
Supporting Types
GetRepositoryBranchesBranch
- name String
- Name of the branch.
- protected_ Boolean
- Whether the branch is protected.
Package Details
- Repository
- GitHub pulumi/pulumi-github
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
github
Terraform Provider.