Use this data source to retrieve information about a GitHub release in a specific repository.
To retrieve the latest release that is present in a repository:
data "github_release" "example" {
repository = "example-repository"
owner = "example-owner"
retrieve_by = "latest"
}
To retrieve a specific release from a repository based on it's ID:
data "github_release" "example" {
repository = "example-repository"
owner = "example-owner"
retrieve_by = "id"
id = 12345
}
Finally, to retrieve a release based on it's tag:
data "github_release" "example" {
repository = "example-repository"
owner = "example-owner"
retrieve_by = "tag"
release_tag = "v1.0.0"
}
repository
- (Required) Name of the repository to retrieve the release from.
owner
- (Required) Owner of the repository.
retrieve_by
- (Required) Describes how to fetch the release. Valid values are id
, tag
, latest
.
release_id
- (Optional) ID of the release to retrieve. Must be specified when retrieve_by
= id
.
release_tag
- (Optional) Tag of the release to retrieve. Must be specified when retrieve_by
= tag
.
release_tag
- Tag of releaserelease_id
- ID of releasetarget_commitish
- Commitish value that determines where the Git release is created fromname
- Name of releasebody
- Contents of the description (body) of a releasedraft
- (Boolean
) indicates whether the release is a draftprerelease
- (Boolean
) indicates whether the release is a prereleasecreated_at
- Date of release creationpublished_at
- Date of release publishingurl
- Base URL of the releasehtml_url
- URL directing to detailed information on the releaseassets_url
- URL of any associated assets with the releaseasserts_url
- Deprecated: Use assets_url
resource insteadupload_url
- URL that can be used to upload Assets to the releasezipball_url
- Download URL of a specific release in zip
formattarball_url
- Download URL of a specific release in tar.gz
formatassets
- Collection of assets for the release. Each asset conforms to the following schema:
id
- ID of the asseturl
- URL of the assetnode_id
- Node ID of the assetname
- The file name of the assetlabel
- Label for the assetcontent_type
- MIME type of the assetsize
- Size in bytecreated_at
- Date the asset was createdupdated_at
- Date the asset was last updatedbrowser_download_url
- Browser download URL