1. Packages
  2. Github Provider
  3. API Docs
  4. getRelease
GitHub v6.3.2 published on Friday, Oct 11, 2024 by Pulumi

github.getRelease

Explore with Pulumi AI

github logo
GitHub v6.3.2 published on Friday, Oct 11, 2024 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:

    import * as pulumi from "@pulumi/pulumi";
    import * as github from "@pulumi/github";
    
    const example = github.getRelease({
        repository: "example-repository",
        owner: "example-owner",
        retrieveBy: "latest",
    });
    
    import pulumi
    import pulumi_github as github
    
    example = github.get_release(repository="example-repository",
        owner="example-owner",
        retrieve_by="latest")
    
    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.LookupRelease(ctx, &github.LookupReleaseArgs{
    			Repository: "example-repository",
    			Owner:      "example-owner",
    			RetrieveBy: "latest",
    		}, 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.GetRelease.Invoke(new()
        {
            Repository = "example-repository",
            Owner = "example-owner",
            RetrieveBy = "latest",
        });
    
    });
    
    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()
                .repository("example-repository")
                .owner("example-owner")
                .retrieveBy("latest")
                .build());
    
        }
    }
    
    variables:
      example:
        fn::invoke:
          Function: github:getRelease
          Arguments:
            repository: example-repository
            owner: example-owner
            retrieveBy: latest
    

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

    Coming soon!
    
    Coming soon!
    
    Coming soon!
    
    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()
                .repository("example-repository")
                .owner("example-owner")
                .retrieveBy("id")
                .id(12345)
                .build());
    
        }
    }
    
    variables:
      example:
        fn::invoke:
          Function: github:getRelease
          Arguments:
            repository: example-repository
            owner: example-owner
            retrieveBy: id
            id: 12345
    

    Finally, to retrieve a release based on it’s tag:

    import * as pulumi from "@pulumi/pulumi";
    import * as github from "@pulumi/github";
    
    const example = github.getRelease({
        repository: "example-repository",
        owner: "example-owner",
        retrieveBy: "tag",
        releaseTag: "v1.0.0",
    });
    
    import pulumi
    import pulumi_github as github
    
    example = github.get_release(repository="example-repository",
        owner="example-owner",
        retrieve_by="tag",
        release_tag="v1.0.0")
    
    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.LookupRelease(ctx, &github.LookupReleaseArgs{
    			Repository: "example-repository",
    			Owner:      "example-owner",
    			RetrieveBy: "tag",
    			ReleaseTag: pulumi.StringRef("v1.0.0"),
    		}, 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.GetRelease.Invoke(new()
        {
            Repository = "example-repository",
            Owner = "example-owner",
            RetrieveBy = "tag",
            ReleaseTag = "v1.0.0",
        });
    
    });
    
    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()
                .repository("example-repository")
                .owner("example-owner")
                .retrieveBy("tag")
                .releaseTag("v1.0.0")
                .build());
    
        }
    }
    
    variables:
      example:
        fn::invoke:
          Function: github:getRelease
          Arguments:
            repository: example-repository
            owner: example-owner
            retrieveBy: tag
            releaseTag: v1.0.0
    

    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 LookupRelease(ctx *Context, args *LookupReleaseArgs, opts ...InvokeOption) (*LookupReleaseResult, error)
    func LookupReleaseOutput(ctx *Context, args *LookupReleaseOutputArgs, opts ...InvokeOption) LookupReleaseResultOutput

    > Note: This function is named LookupRelease 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)
    // Output-based functions aren't available in Java yet
    
    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
    Deprecated: Use assets_url resource instead

    Deprecated: use assets_url instead

    Assets List<GetReleaseAsset>
    Collection of assets for the release. Each asset conforms to the following schema:
    AssetsUrl string
    URL of any associated assets with the release
    Body string
    Contents of the description (body) of a release
    CreatedAt string
    Date the asset was created
    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
    The file name of the asset
    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
    URL of the asset
    ZipballUrl string
    Download URL of a specific release in zip format
    ReleaseId int
    ID of release
    ReleaseTag string
    Tag of release
    AssertsUrl string
    Deprecated: Use assets_url resource instead

    Deprecated: use assets_url instead

    Assets []GetReleaseAsset
    Collection of assets for the release. Each asset conforms to the following schema:
    AssetsUrl string
    URL of any associated assets with the release
    Body string
    Contents of the description (body) of a release
    CreatedAt string
    Date the asset was created
    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
    The file name of the asset
    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
    URL of the asset
    ZipballUrl string
    Download URL of a specific release in zip format
    ReleaseId int
    ID of release
    ReleaseTag string
    Tag of release
    assertsUrl String
    Deprecated: Use assets_url resource instead

    Deprecated: use assets_url instead

    assets List<GetReleaseAsset>
    Collection of assets for the release. Each asset conforms to the following schema:
    assetsUrl String
    URL of any associated assets with the release
    body String
    Contents of the description (body) of a release
    createdAt String
    Date the asset was created
    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
    The file name of the asset
    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
    URL of the asset
    zipballUrl String
    Download URL of a specific release in zip format
    releaseId Integer
    ID of release
    releaseTag String
    Tag of release
    assertsUrl string
    Deprecated: Use assets_url resource instead

    Deprecated: use assets_url instead

    assets GetReleaseAsset[]
    Collection of assets for the release. Each asset conforms to the following schema:
    assetsUrl string
    URL of any associated assets with the release
    body string
    Contents of the description (body) of a release
    createdAt string
    Date the asset was created
    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
    The file name of the asset
    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
    URL of the asset
    zipballUrl string
    Download URL of a specific release in zip format
    releaseId number
    ID of release
    releaseTag string
    Tag of release
    asserts_url str
    Deprecated: Use assets_url resource instead

    Deprecated: use assets_url instead

    assets Sequence[GetReleaseAsset]
    Collection of assets for the release. Each asset conforms to the following schema:
    assets_url str
    URL of any associated assets with the release
    body str
    Contents of the description (body) of a release
    created_at str
    Date the asset was created
    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
    The file name of the asset
    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
    URL of the asset
    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
    Deprecated: Use assets_url resource instead

    Deprecated: use assets_url instead

    assets List<Property Map>
    Collection of assets for the release. Each asset conforms to the following schema:
    assetsUrl String
    URL of any associated assets with the release
    body String
    Contents of the description (body) of a release
    createdAt String
    Date the asset was created
    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
    The file name of the asset
    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
    URL of the asset
    zipballUrl String
    Download URL of a specific release in zip format
    releaseId Number
    ID of release
    releaseTag String
    Tag of release

    Supporting Types

    GetReleaseAsset

    BrowserDownloadUrl string
    Browser download URL
    ContentType string
    MIME type of the asset
    CreatedAt string
    Date the asset was created
    Id int
    ID of the asset
    Label string
    Label for the asset
    Name string
    The file name of the asset
    NodeId string
    Node ID of the asset
    Size int
    Size in byte
    UpdatedAt string
    Date the asset was last updated
    Url string
    URL of the asset
    BrowserDownloadUrl string
    Browser download URL
    ContentType string
    MIME type of the asset
    CreatedAt string
    Date the asset was created
    Id int
    ID of the asset
    Label string
    Label for the asset
    Name string
    The file name of the asset
    NodeId string
    Node ID of the asset
    Size int
    Size in byte
    UpdatedAt string
    Date the asset was last updated
    Url string
    URL of the asset
    browserDownloadUrl String
    Browser download URL
    contentType String
    MIME type of the asset
    createdAt String
    Date the asset was created
    id Integer
    ID of the asset
    label String
    Label for the asset
    name String
    The file name of the asset
    nodeId String
    Node ID of the asset
    size Integer
    Size in byte
    updatedAt String
    Date the asset was last updated
    url String
    URL of the asset
    browserDownloadUrl string
    Browser download URL
    contentType string
    MIME type of the asset
    createdAt string
    Date the asset was created
    id number
    ID of the asset
    label string
    Label for the asset
    name string
    The file name of the asset
    nodeId string
    Node ID of the asset
    size number
    Size in byte
    updatedAt string
    Date the asset was last updated
    url string
    URL of the asset
    browser_download_url str
    Browser download URL
    content_type str
    MIME type of the asset
    created_at str
    Date the asset was created
    id int
    ID of the asset
    label str
    Label for the asset
    name str
    The file name of the asset
    node_id str
    Node ID of the asset
    size int
    Size in byte
    updated_at str
    Date the asset was last updated
    url str
    URL of the asset
    browserDownloadUrl String
    Browser download URL
    contentType String
    MIME type of the asset
    createdAt String
    Date the asset was created
    id Number
    ID of the asset
    label String
    Label for the asset
    name String
    The file name of the asset
    nodeId String
    Node ID of the asset
    size Number
    Size in byte
    updatedAt String
    Date the asset was last updated
    url String
    URL of the asset

    Package Details

    Repository
    GitHub pulumi/pulumi-github
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the github Terraform Provider.
    github logo
    GitHub v6.3.2 published on Friday, Oct 11, 2024 by Pulumi