getBranch

Use this data source to retrieve information about a repository branch.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as github from "@pulumi/github";
const development = github.getBranch({
repository: "example",
branch: "development",
});
import pulumi
import pulumi_github as github
development = github.get_branch(repository="example",
branch="development")
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Github = Pulumi.Github;
return await Deployment.RunAsync(() =>
{
var development = Github.GetBranch.Invoke(new()
{
Repository = "example",
Branch = "development",
});
});
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.LookupBranch(ctx, &github.LookupBranchArgs{
Repository: "example",
Branch: "development",
}, nil)
if err != nil {
return err
}
return nil
})
}
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.GetBranchArgs;
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 development = GithubFunctions.getBranch(GetBranchArgs.builder()
.repository("example")
.branch("development")
.build());
}
}
variables:
development:
fn::invoke:
function: github:getBranch
arguments:
repository: example
branch: development

Return

A collection of values returned by getBranch.

Parameters

argument

A collection of arguments for invoking getBranch.


suspend fun getBranch(branch: String, repository: String): GetBranchResult

Return

A collection of values returned by getBranch.

Parameters

branch

The repository branch to retrieve.

repository

The GitHub repository name.

See also


suspend fun getBranch(argument: suspend GetBranchPlainArgsBuilder.() -> Unit): GetBranchResult

Return

A collection of values returned by getBranch.

Parameters

argument

Builder for com.pulumi.github.kotlin.inputs.GetBranchPlainArgs.

See also