1. Packages
  2. Packages
  3. Github Provider
  4. API Docs
  5. getRelease
Viewing docs for GitHub v4.17.0 (Older version)
published on Monday, Mar 9, 2026 by Pulumi
github logo
Viewing docs for GitHub v4.17.0 (Older version)
published on Monday, Mar 9, 2026 by Pulumi

    Use this data source to retrieve information about a GitHub release in a specific repository.

    Example Usage

    To retrieve the latest release that is present in a repository

    using System.Collections.Generic;
    using Pulumi;
    using Github = Pulumi.Github;
    
    return await Deployment.RunAsync(() => 
    {
        var example = Github.GetRelease.Invoke(new()
        {
            Owner = "example-owner",
            Repository = "example-repository",
            RetrieveBy = "latest",
        });
    
    });
    
    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.GetRelease(ctx, &GetReleaseArgs{
    			Owner:      "example-owner",
    			Repository: "example-repository",
    			RetrieveBy: "latest",
    		}, 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.GetReleaseArgs;
    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.getRelease(GetReleaseArgs.builder()
                .owner("example-owner")
                .repository("example-repository")
                .retrieveBy("latest")
                .build());
    
        }
    }
    
    import * as pulumi from "@pulumi/pulumi";
    import * as github from "@pulumi/github";
    
    const example = pulumi.output(github.getRelease({
        owner: "example-owner",
        repository: "example-repository",
        retrieveBy: "latest",
    }));
    
    import pulumi
    import pulumi_github as github
    
    example = github.get_release(owner="example-owner",
        repository="example-repository",
        retrieve_by="latest")
    
    variables:
      example:
        Fn::Invoke:
          Function: github:getRelease
          Arguments:
            owner: example-owner
            repository: example-repository
            retrieveBy: latest
    

    To retrieve a specific release from a repository based on it's ID

    Example coming soon!

    Example coming soon!

    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.GetReleaseArgs;
    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.getRelease(GetReleaseArgs.builder()
                .id(12345)
                .owner("example-owner")
                .repository("example-repository")
                .retrieveBy("id")
                .build());
    
        }
    }
    
    import * as pulumi from "@pulumi/pulumi";
    import * as github from "@pulumi/github";
    
    const example = pulumi.output(github.getRelease({
        id: "12345",
        owner: "example-owner",
        repository: "example-repository",
        retrieveBy: "id",
    }));
    

    Example coming soon!

    variables:
      example:
        Fn::Invoke:
          Function: github:getRelease
          Arguments:
            id: 12345
            owner: example-owner
            repository: example-repository
            retrieveBy: id
    

    Finally, to retrieve a release based on it's tag

    using System.Collections.Generic;
    using Pulumi;
    using Github = Pulumi.Github;
    
    return await Deployment.RunAsync(() => 
    {
        var example = Github.GetRelease.Invoke(new()
        {
            Owner = "example-owner",
            ReleaseTag = "v1.0.0",
            Repository = "example-repository",
            RetrieveBy = "tag",
        });
    
    });
    
    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.GetRelease(ctx, &GetReleaseArgs{
    			Owner:      "example-owner",
    			ReleaseTag: pulumi.StringRef("v1.0.0"),
    			Repository: "example-repository",
    			RetrieveBy: "tag",
    		}, 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.GetReleaseArgs;
    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.getRelease(GetReleaseArgs.builder()
                .owner("example-owner")
                .releaseTag("v1.0.0")
                .repository("example-repository")
                .retrieveBy("tag")
                .build());
    
        }
    }
    
    import * as pulumi from "@pulumi/pulumi";
    import * as github from "@pulumi/github";
    
    const example = pulumi.output(github.getRelease({
        owner: "example-owner",
        releaseTag: "v1.0.0",
        repository: "example-repository",
        retrieveBy: "tag",
    }));
    
    import pulumi
    import pulumi_github as github
    
    example = github.get_release(owner="example-owner",
        release_tag="v1.0.0",
        repository="example-repository",
        retrieve_by="tag")
    
    variables:
      example:
        Fn::Invoke:
          Function: github:getRelease
          Arguments:
            owner: example-owner
            releaseTag: v1.0.0
            repository: example-repository
            retrieveBy: tag
    

    Using getRelease

    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 getRelease(args: GetReleaseArgs, opts?: InvokeOptions): Promise<GetReleaseResult>
    function getReleaseOutput(args: GetReleaseOutputArgs, opts?: InvokeOptions): Output<GetReleaseResult>
    def get_release(owner: Optional[str] = None,
                    release_id: Optional[int] = None,
                    release_tag: Optional[str] = None,
                    repository: Optional[str] = None,
                    retrieve_by: Optional[str] = None,
                    opts: Optional[InvokeOptions] = None) -> GetReleaseResult
    def get_release_output(owner: Optional[pulumi.Input[str]] = None,
                    release_id: Optional[pulumi.Input[int]] = None,
                    release_tag: Optional[pulumi.Input[str]] = None,
                    repository: Optional[pulumi.Input[str]] = None,
                    retrieve_by: Optional[pulumi.Input[str]] = None,
                    opts: Optional[InvokeOptions] = None) -> Output[GetReleaseResult]
    func GetRelease(ctx *Context, args *GetReleaseArgs, opts ...InvokeOption) (*GetReleaseResult, error)
    func GetReleaseOutput(ctx *Context, args *GetReleaseOutputArgs, opts ...InvokeOption) GetReleaseResultOutput

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

    public static class GetRelease 
    {
        public static Task<GetReleaseResult> InvokeAsync(GetReleaseArgs args, InvokeOptions? opts = null)
        public static Output<GetReleaseResult> Invoke(GetReleaseInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetReleaseResult> getRelease(GetReleaseArgs args, InvokeOptions options)
    public static Output<GetReleaseResult> getRelease(GetReleaseArgs args, InvokeOptions options)
    
    fn::invoke:
      function: github:index/getRelease:getRelease
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Owner string
    Owner of the repository.
    Repository string
    Name of the repository to retrieve the release from.
    RetrieveBy string
    Describes how to fetch the release. Valid values are id, tag, latest.
    ReleaseId int
    ID of the release to retrieve. Must be specified when retrieve_by = id.
    ReleaseTag string
    Tag of the release to retrieve. Must be specified when retrieve_by = tag.
    Owner string
    Owner of the repository.
    Repository string
    Name of the repository to retrieve the release from.
    RetrieveBy string
    Describes how to fetch the release. Valid values are id, tag, latest.
    ReleaseId int
    ID of the release to retrieve. Must be specified when retrieve_by = id.
    ReleaseTag string
    Tag of the release to retrieve. Must be specified when retrieve_by = tag.
    owner String
    Owner of the repository.
    repository String
    Name of the repository to retrieve the release from.
    retrieveBy String
    Describes how to fetch the release. Valid values are id, tag, latest.
    releaseId Integer
    ID of the release to retrieve. Must be specified when retrieve_by = id.
    releaseTag String
    Tag of the release to retrieve. Must be specified when retrieve_by = tag.
    owner string
    Owner of the repository.
    repository string
    Name of the repository to retrieve the release from.
    retrieveBy string
    Describes how to fetch the release. Valid values are id, tag, latest.
    releaseId number
    ID of the release to retrieve. Must be specified when retrieve_by = id.
    releaseTag string
    Tag of the release to retrieve. Must be specified when retrieve_by = tag.
    owner str
    Owner of the repository.
    repository str
    Name of the repository to retrieve the release from.
    retrieve_by str
    Describes how to fetch the release. Valid values are id, tag, latest.
    release_id int
    ID of the release to retrieve. Must be specified when retrieve_by = id.
    release_tag str
    Tag of the release to retrieve. Must be specified when retrieve_by = tag.
    owner String
    Owner of the repository.
    repository String
    Name of the repository to retrieve the release from.
    retrieveBy String
    Describes how to fetch the release. Valid values are id, tag, latest.
    releaseId Number
    ID of the release to retrieve. Must be specified when retrieve_by = id.
    releaseTag String
    Tag of the release to retrieve. Must be specified when retrieve_by = tag.

    getRelease Result

    The following output properties are available:

    AssertsUrl string
    URL of any associated assets with the release
    Body string
    Contents of the description (body) of a release
    CreatedAt string
    Date of release creation
    Draft bool
    (Boolean) indicates whether the release is a draft
    HtmlUrl string
    URL directing to detailed information on the release
    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    Name of release
    Owner string
    Prerelease bool
    (Boolean) indicates whether the release is a prerelease
    PublishedAt string
    Date of release publishing
    Repository string
    RetrieveBy string
    TarballUrl string
    Download URL of a specific release in tar.gz format
    TargetCommitish string
    Commitish value that determines where the Git release is created from
    UploadUrl string
    URL that can be used to upload Assets to the release
    Url string
    Base URL of the release
    ZipballUrl string
    Download URL of a specific release in zip format
    ReleaseId int
    ID of release
    ReleaseTag string
    Tag of release
    AssertsUrl string
    URL of any associated assets with the release
    Body string
    Contents of the description (body) of a release
    CreatedAt string
    Date of release creation
    Draft bool
    (Boolean) indicates whether the release is a draft
    HtmlUrl string
    URL directing to detailed information on the release
    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    Name of release
    Owner string
    Prerelease bool
    (Boolean) indicates whether the release is a prerelease
    PublishedAt string
    Date of release publishing
    Repository string
    RetrieveBy string
    TarballUrl string
    Download URL of a specific release in tar.gz format
    TargetCommitish string
    Commitish value that determines where the Git release is created from
    UploadUrl string
    URL that can be used to upload Assets to the release
    Url string
    Base URL of the release
    ZipballUrl string
    Download URL of a specific release in zip format
    ReleaseId int
    ID of release
    ReleaseTag string
    Tag of release
    assertsUrl String
    URL of any associated assets with the release
    body String
    Contents of the description (body) of a release
    createdAt String
    Date of release creation
    draft Boolean
    (Boolean) indicates whether the release is a draft
    htmlUrl String
    URL directing to detailed information on the release
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    Name of release
    owner String
    prerelease Boolean
    (Boolean) indicates whether the release is a prerelease
    publishedAt String
    Date of release publishing
    repository String
    retrieveBy String
    tarballUrl String
    Download URL of a specific release in tar.gz format
    targetCommitish String
    Commitish value that determines where the Git release is created from
    uploadUrl String
    URL that can be used to upload Assets to the release
    url String
    Base URL of the release
    zipballUrl String
    Download URL of a specific release in zip format
    releaseId Integer
    ID of release
    releaseTag String
    Tag of release
    assertsUrl string
    URL of any associated assets with the release
    body string
    Contents of the description (body) of a release
    createdAt string
    Date of release creation
    draft boolean
    (Boolean) indicates whether the release is a draft
    htmlUrl string
    URL directing to detailed information on the release
    id string
    The provider-assigned unique ID for this managed resource.
    name string
    Name of release
    owner string
    prerelease boolean
    (Boolean) indicates whether the release is a prerelease
    publishedAt string
    Date of release publishing
    repository string
    retrieveBy string
    tarballUrl string
    Download URL of a specific release in tar.gz format
    targetCommitish string
    Commitish value that determines where the Git release is created from
    uploadUrl string
    URL that can be used to upload Assets to the release
    url string
    Base URL of the release
    zipballUrl string
    Download URL of a specific release in zip format
    releaseId number
    ID of release
    releaseTag string
    Tag of release
    asserts_url str
    URL of any associated assets with the release
    body str
    Contents of the description (body) of a release
    created_at str
    Date of release creation
    draft bool
    (Boolean) indicates whether the release is a draft
    html_url str
    URL directing to detailed information on the release
    id str
    The provider-assigned unique ID for this managed resource.
    name str
    Name of release
    owner str
    prerelease bool
    (Boolean) indicates whether the release is a prerelease
    published_at str
    Date of release publishing
    repository str
    retrieve_by str
    tarball_url str
    Download URL of a specific release in tar.gz format
    target_commitish str
    Commitish value that determines where the Git release is created from
    upload_url str
    URL that can be used to upload Assets to the release
    url str
    Base URL of the release
    zipball_url str
    Download URL of a specific release in zip format
    release_id int
    ID of release
    release_tag str
    Tag of release
    assertsUrl String
    URL of any associated assets with the release
    body String
    Contents of the description (body) of a release
    createdAt String
    Date of release creation
    draft Boolean
    (Boolean) indicates whether the release is a draft
    htmlUrl String
    URL directing to detailed information on the release
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    Name of release
    owner String
    prerelease Boolean
    (Boolean) indicates whether the release is a prerelease
    publishedAt String
    Date of release publishing
    repository String
    retrieveBy String
    tarballUrl String
    Download URL of a specific release in tar.gz format
    targetCommitish String
    Commitish value that determines where the Git release is created from
    uploadUrl String
    URL that can be used to upload Assets to the release
    url String
    Base URL of the release
    zipballUrl String
    Download URL of a specific release in zip format
    releaseId Number
    ID of release
    releaseTag String
    Tag of release

    Package Details

    Repository
    GitHub pulumi/pulumi-github
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the github Terraform Provider.
    github logo
    Viewing docs for GitHub v4.17.0 (Older version)
    published on Monday, Mar 9, 2026 by Pulumi
      Try Pulumi Cloud free. Your team will thank you.