getRef

suspend fun getRef(argument: GetRefPlainArgs): GetRefResult

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

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as github from "@pulumi/github";
const development = github.getRef({
owner: "example",
repository: "example",
ref: "heads/development",
});
import pulumi
import pulumi_github as github
development = github.get_ref(owner="example",
repository="example",
ref="heads/development")
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Github = Pulumi.Github;
return await Deployment.RunAsync(() =>
{
var development = Github.GetRef.Invoke(new()
{
Owner = "example",
Repository = "example",
Ref = "heads/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.GetRef(ctx, &github.GetRefArgs{
Owner: pulumi.StringRef("example"),
Repository: "example",
Ref: "heads/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.GetRefArgs;
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.getRef(GetRefArgs.builder()
.owner("example")
.repository("example")
.ref("heads/development")
.build());
}
}
variables:
development:
fn::invoke:
function: github:getRef
arguments:
owner: example
repository: example
ref: heads/development

Return

A collection of values returned by getRef.

Parameters

argument

A collection of arguments for invoking getRef.


suspend fun getRef(owner: String? = null, ref: String, repository: String): GetRefResult

Return

A collection of values returned by getRef.

Parameters

owner

Owner of the repository.

ref

The repository ref to look up. Must be formatted heads/<ref> for branches, and tags/<ref> for tags.

repository

The GitHub repository name.

See also


suspend fun getRef(argument: suspend GetRefPlainArgsBuilder.() -> Unit): GetRefResult

Return

A collection of values returned by getRef.

Parameters

argument

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

See also