getRelease

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")
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 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
})
}
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:

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")
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 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
})
}
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

Return

A collection of values returned by getRelease.

Parameters

argument

A collection of arguments for invoking getRelease.


suspend fun getRelease(owner: String, releaseId: Int? = null, releaseTag: String? = null, repository: String, retrieveBy: String): GetReleaseResult

Return

A collection of values returned by getRelease.

Parameters

owner

Owner of the repository.

releaseId

ID of the release to retrieve. Must be specified when retrieve_by = id.

releaseTag

Tag of the release to retrieve. Must be specified when retrieve_by = tag.

repository

Name of the repository to retrieve the release from.

retrieveBy

Describes how to fetch the release. Valid values are id, tag, latest.

See also


suspend fun getRelease(argument: suspend GetReleasePlainArgsBuilder.() -> Unit): GetReleaseResult

Return

A collection of values returned by getRelease.

Parameters

argument

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

See also