1. Packages
  2. Github Provider
  3. API Docs
  4. getReleaseAsset
GitHub v6.12.1 published on Thursday, Feb 12, 2026 by Pulumi
github logo
GitHub v6.12.1 published on Thursday, Feb 12, 2026 by Pulumi

    Use this data source to retrieve information about a GitHub release asset.

    Example Usage

    To retrieve a specific release asset from a repository based on its ID:

    import * as pulumi from "@pulumi/pulumi";
    import * as github from "@pulumi/github";
    
    const example = github.getReleaseAsset({
        repository: "example-repository",
        owner: "example-owner",
        assetId: 12345,
    });
    
    import pulumi
    import pulumi_github as github
    
    example = github.get_release_asset(repository="example-repository",
        owner="example-owner",
        asset_id=12345)
    
    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.LookupReleaseAsset(ctx, &github.LookupReleaseAssetArgs{
    			Repository: "example-repository",
    			Owner:      "example-owner",
    			AssetId:    12345,
    		}, 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.GetReleaseAsset.Invoke(new()
        {
            Repository = "example-repository",
            Owner = "example-owner",
            AssetId = 12345,
        });
    
    });
    
    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.GetReleaseAssetArgs;
    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.getReleaseAsset(GetReleaseAssetArgs.builder()
                .repository("example-repository")
                .owner("example-owner")
                .assetId(12345)
                .build());
    
        }
    }
    
    variables:
      example:
        fn::invoke:
          function: github:getReleaseAsset
          arguments:
            repository: example-repository
            owner: example-owner
            assetId: 12345
    

    To retrieve a specific release asset from a repository, and download the file into a file attribute on the data source:

    Example coming soon!
    
    Example coming soon!
    
    Example coming soon!
    
    Example coming soon!
    
    Example coming soon!
    
    variables:
      example:
        fn::invoke:
          function: github:getReleaseAsset
          arguments:
            repository: example-repository
            owner: example-owner
            assetId: 12345
            downloadFile: true
    

    To retrieve the first release asset associated with the latest release 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",
    });
    const exampleGetReleaseAsset = example.then(example => github.getReleaseAsset({
        repository: "example-repository",
        owner: "example-owner",
        assetId: example.assets?.[0]?.id,
    }));
    
    import pulumi
    import pulumi_github as github
    
    example = github.get_release(repository="example-repository",
        owner="example-owner",
        retrieve_by="latest")
    example_get_release_asset = github.get_release_asset(repository="example-repository",
        owner="example-owner",
        asset_id=example.assets[0].id)
    
    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 {
    		example, err := github.LookupRelease(ctx, &github.LookupReleaseArgs{
    			Repository: "example-repository",
    			Owner:      "example-owner",
    			RetrieveBy: "latest",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = github.LookupReleaseAsset(ctx, &github.LookupReleaseAssetArgs{
    			Repository: "example-repository",
    			Owner:      "example-owner",
    			AssetId:    example.Assets[0].Id,
    		}, 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",
        });
    
        var exampleGetReleaseAsset = Github.GetReleaseAsset.Invoke(new()
        {
            Repository = "example-repository",
            Owner = "example-owner",
            AssetId = example.Apply(getReleaseResult => getReleaseResult.Assets[0]?.Id),
        });
    
    });
    
    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 com.pulumi.github.inputs.GetReleaseAssetArgs;
    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());
    
            final var exampleGetReleaseAsset = GithubFunctions.getReleaseAsset(GetReleaseAssetArgs.builder()
                .repository("example-repository")
                .owner("example-owner")
                .assetId(example.assets()[0].id())
                .build());
    
        }
    }
    
    variables:
      example:
        fn::invoke:
          function: github:getRelease
          arguments:
            repository: example-repository
            owner: example-owner
            retrieveBy: latest
      exampleGetReleaseAsset:
        fn::invoke:
          function: github:getReleaseAsset
          arguments:
            repository: example-repository
            owner: example-owner
            assetId: ${example.assets[0].id}
    

    To retrieve all release assets associated with the the latest release 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",
    });
    const exampleGetReleaseAsset = .map(__index => (github.getReleaseAsset({
        repository: "example-repository",
        owner: "example-owner",
        assetId: _arg0_.assets[__index].id,
    })));
    
    import pulumi
    import pulumi_github as github
    
    example = github.get_release(repository="example-repository",
        owner="example-owner",
        retrieve_by="latest")
    example_get_release_asset = [github.get_release_asset(repository="example-repository",
        owner="example-owner",
        asset_id=example.assets[__index].id) for __index in len(example.assets).apply(lambda length: range(length))]
    
    Example coming soon!
    
    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",
        });
    
        var exampleGetReleaseAsset = ;
    
    });
    
    Example coming soon!
    
    Example coming soon!
    

    Using getReleaseAsset

    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 getReleaseAsset(args: GetReleaseAssetArgs, opts?: InvokeOptions): Promise<GetReleaseAssetResult>
    function getReleaseAssetOutput(args: GetReleaseAssetOutputArgs, opts?: InvokeOptions): Output<GetReleaseAssetResult>
    def get_release_asset(asset_id: Optional[int] = None,
                          download_file_contents: Optional[bool] = None,
                          owner: Optional[str] = None,
                          repository: Optional[str] = None,
                          opts: Optional[InvokeOptions] = None) -> GetReleaseAssetResult
    def get_release_asset_output(asset_id: Optional[pulumi.Input[int]] = None,
                          download_file_contents: Optional[pulumi.Input[bool]] = None,
                          owner: Optional[pulumi.Input[str]] = None,
                          repository: Optional[pulumi.Input[str]] = None,
                          opts: Optional[InvokeOptions] = None) -> Output[GetReleaseAssetResult]
    func LookupReleaseAsset(ctx *Context, args *LookupReleaseAssetArgs, opts ...InvokeOption) (*LookupReleaseAssetResult, error)
    func LookupReleaseAssetOutput(ctx *Context, args *LookupReleaseAssetOutputArgs, opts ...InvokeOption) LookupReleaseAssetResultOutput

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

    public static class GetReleaseAsset 
    {
        public static Task<GetReleaseAssetResult> InvokeAsync(GetReleaseAssetArgs args, InvokeOptions? opts = null)
        public static Output<GetReleaseAssetResult> Invoke(GetReleaseAssetInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetReleaseAssetResult> getReleaseAsset(GetReleaseAssetArgs args, InvokeOptions options)
    public static Output<GetReleaseAssetResult> getReleaseAsset(GetReleaseAssetArgs args, InvokeOptions options)
    
    fn::invoke:
      function: github:index/getReleaseAsset:getReleaseAsset
      arguments:
        # arguments dictionary

    The following arguments are supported:

    AssetId int
    ID of the release asset to retrieve
    Owner string
    Owner of the repository
    Repository string
    Name of the repository to retrieve the release from
    DownloadFileContents bool
    Whether to download the asset file content into the file_contents attribute (defaults to false)
    AssetId int
    ID of the release asset to retrieve
    Owner string
    Owner of the repository
    Repository string
    Name of the repository to retrieve the release from
    DownloadFileContents bool
    Whether to download the asset file content into the file_contents attribute (defaults to false)
    assetId Integer
    ID of the release asset to retrieve
    owner String
    Owner of the repository
    repository String
    Name of the repository to retrieve the release from
    downloadFileContents Boolean
    Whether to download the asset file content into the file_contents attribute (defaults to false)
    assetId number
    ID of the release asset to retrieve
    owner string
    Owner of the repository
    repository string
    Name of the repository to retrieve the release from
    downloadFileContents boolean
    Whether to download the asset file content into the file_contents attribute (defaults to false)
    asset_id int
    ID of the release asset to retrieve
    owner str
    Owner of the repository
    repository str
    Name of the repository to retrieve the release from
    download_file_contents bool
    Whether to download the asset file content into the file_contents attribute (defaults to false)
    assetId Number
    ID of the release asset to retrieve
    owner String
    Owner of the repository
    repository String
    Name of the repository to retrieve the release from
    downloadFileContents Boolean
    Whether to download the asset file content into the file_contents attribute (defaults to false)

    getReleaseAsset Result

    The following output properties are available:

    AssetId int
    BrowserDownloadUrl string
    Browser URL from which the release asset can be downloaded
    ContentType string
    MIME type of the asset
    CreatedAt string
    Date the asset was created
    FileContents string
    The base64-encoded release asset file contents (requires download_file_contents to be true)
    Id string
    The provider-assigned unique ID for this managed resource.
    Label string
    Label for the asset
    Name string
    The file name of the asset
    NodeId string
    Node ID of the asset
    Owner string
    Repository string
    Size int
    Asset size in bytes
    UpdatedAt string
    Date the asset was last updated
    Url string
    URL of the asset
    DownloadFileContents bool
    AssetId int
    BrowserDownloadUrl string
    Browser URL from which the release asset can be downloaded
    ContentType string
    MIME type of the asset
    CreatedAt string
    Date the asset was created
    FileContents string
    The base64-encoded release asset file contents (requires download_file_contents to be true)
    Id string
    The provider-assigned unique ID for this managed resource.
    Label string
    Label for the asset
    Name string
    The file name of the asset
    NodeId string
    Node ID of the asset
    Owner string
    Repository string
    Size int
    Asset size in bytes
    UpdatedAt string
    Date the asset was last updated
    Url string
    URL of the asset
    DownloadFileContents bool
    assetId Integer
    browserDownloadUrl String
    Browser URL from which the release asset can be downloaded
    contentType String
    MIME type of the asset
    createdAt String
    Date the asset was created
    fileContents String
    The base64-encoded release asset file contents (requires download_file_contents to be true)
    id String
    The provider-assigned unique ID for this managed resource.
    label String
    Label for the asset
    name String
    The file name of the asset
    nodeId String
    Node ID of the asset
    owner String
    repository String
    size Integer
    Asset size in bytes
    updatedAt String
    Date the asset was last updated
    url String
    URL of the asset
    downloadFileContents Boolean
    assetId number
    browserDownloadUrl string
    Browser URL from which the release asset can be downloaded
    contentType string
    MIME type of the asset
    createdAt string
    Date the asset was created
    fileContents string
    The base64-encoded release asset file contents (requires download_file_contents to be true)
    id string
    The provider-assigned unique ID for this managed resource.
    label string
    Label for the asset
    name string
    The file name of the asset
    nodeId string
    Node ID of the asset
    owner string
    repository string
    size number
    Asset size in bytes
    updatedAt string
    Date the asset was last updated
    url string
    URL of the asset
    downloadFileContents boolean
    asset_id int
    browser_download_url str
    Browser URL from which the release asset can be downloaded
    content_type str
    MIME type of the asset
    created_at str
    Date the asset was created
    file_contents str
    The base64-encoded release asset file contents (requires download_file_contents to be true)
    id str
    The provider-assigned unique ID for this managed resource.
    label str
    Label for the asset
    name str
    The file name of the asset
    node_id str
    Node ID of the asset
    owner str
    repository str
    size int
    Asset size in bytes
    updated_at str
    Date the asset was last updated
    url str
    URL of the asset
    download_file_contents bool
    assetId Number
    browserDownloadUrl String
    Browser URL from which the release asset can be downloaded
    contentType String
    MIME type of the asset
    createdAt String
    Date the asset was created
    fileContents String
    The base64-encoded release asset file contents (requires download_file_contents to be true)
    id String
    The provider-assigned unique ID for this managed resource.
    label String
    Label for the asset
    name String
    The file name of the asset
    nodeId String
    Node ID of the asset
    owner String
    repository String
    size Number
    Asset size in bytes
    updatedAt String
    Date the asset was last updated
    url String
    URL of the asset
    downloadFileContents Boolean

    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.12.1 published on Thursday, Feb 12, 2026 by Pulumi
      Meet Neo: Your AI Platform Teammate