GitHub

Pulumi Official
Package maintained by Pulumi
v4.11.0 published on Wednesday, Apr 6, 2022 by Pulumi

getRef

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

Example Usage

using Pulumi;
using Github = Pulumi.Github;

class MyStack : Stack
{
    public MyStack()
    {
        var development = Output.Create(Github.GetRef.InvokeAsync(new Github.GetRefArgs
        {
            Ref = "heads/development",
            Repository = "example",
        }));
    }

}
package main

import (
	"github.com/pulumi/pulumi-github/sdk/v4/go/github"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := github.GetRef(ctx, &GetRefArgs{
			Ref:        "heads/development",
			Repository: "example",
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}

Coming soon!

import pulumi
import pulumi_github as github

development = github.get_ref(ref="heads/development",
    repository="example")
import * as pulumi from "@pulumi/pulumi";
import * as github from "@pulumi/github";

const development = pulumi.output(github.getRef({
    ref: "heads/development",
    repository: "example",
}));

Coming soon!

Using getRef

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 getRef(args: GetRefArgs, opts?: InvokeOptions): Promise<GetRefResult>
function getRefOutput(args: GetRefOutputArgs, opts?: InvokeOptions): Output<GetRefResult>
def get_ref(branch: Optional[str] = None,
            repository: Optional[str] = None,
            opts: Optional[InvokeOptions] = None) -> GetRefResult
def get_ref_output(branch: Optional[pulumi.Input[str]] = None,
            repository: Optional[pulumi.Input[str]] = None,
            opts: Optional[InvokeOptions] = None) -> Output[GetRefResult]
func GetRef(ctx *Context, args *GetRefArgs, opts ...InvokeOption) (*GetRefResult, error)
func GetRefOutput(ctx *Context, args *GetRefOutputArgs, opts ...InvokeOption) GetRefResultOutput

> Note: This function is named GetRef in the Go SDK.

public static class GetRef 
{
    public static Task<GetRefResult> InvokeAsync(GetRefArgs args, InvokeOptions? opts = null)
    public static Output<GetRefResult> Invoke(GetRefInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetRefResult> getRef(GetRefArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
Fn::Invoke:
  Function: github:index/getRef:getRef
  Arguments:
    # Arguments dictionary

The following arguments are supported:

Branch string
Repository string

The GitHub repository name.

Branch string
Repository string

The GitHub repository name.

branch String
repository String

The GitHub repository name.

branch string
repository string

The GitHub repository name.

branch str
repository str

The GitHub repository name.

branch String
repository String

The GitHub repository name.

getRef Result

The following output properties are available:

Branch string
Etag string

An etag representing the ref.

Id string

The provider-assigned unique ID for this managed resource.

Ref string
Repository string
Sha string

A string storing the reference's HEAD commit's SHA1.

Branch string
Etag string

An etag representing the ref.

Id string

The provider-assigned unique ID for this managed resource.

Ref string
Repository string
Sha string

A string storing the reference's HEAD commit's SHA1.

branch String
etag String

An etag representing the ref.

id String

The provider-assigned unique ID for this managed resource.

ref String
repository String
sha String

A string storing the reference's HEAD commit's SHA1.

branch string
etag string

An etag representing the ref.

id string

The provider-assigned unique ID for this managed resource.

ref string
repository string
sha string

A string storing the reference's HEAD commit's SHA1.

branch str
etag str

An etag representing the ref.

id str

The provider-assigned unique ID for this managed resource.

ref str
repository str
sha str

A string storing the reference's HEAD commit's SHA1.

branch String
etag String

An etag representing the ref.

id String

The provider-assigned unique ID for this managed resource.

ref String
repository String
sha String

A string storing the reference's HEAD commit's SHA1.

Package Details

Repository
https://github.com/pulumi/pulumi-github
License
Apache-2.0
Notes

This Pulumi package is based on the github Terraform Provider.