Repository navigation
Description
Describe the need
A github_release_asset data source would enable users to natively fetch and/or read GitHub release assets in Terraform.
For example, imagine a owner/repo GitHub release with various *.json file assets. To read those *.json files' contents via a github_release_asset data source, I'm imagining something akin to the following (although, it would be useful to support additional/alternative arguments beyond just id too, and perhaps even the option to download the asset):
data "github_release" "latest" {
repository = "owner"
owner = "repo"
retrieve_by = "latest"
}
data "github_release_asset" "release_assets" {
count = length(data.github_release.latest.assets)
url = data.github_release.latest.assets[count.index].url
}
output "release_assets" {
value = data.github_release_asset.release_assets.*.body
}However, currently, without a github_release_asset data source, it's necessary to utilize suboptimal workarounds, such as the use of the http provider and some not-ideal mechanism (such as a var.github_token) for providing a GitHub token:
data "github_release" "latest" {
repository = "owner"
owner = "repo"
retrieve_by = "latest"
}
data "http" "release_assets" {
count = length(data.github_release.latest.assets)
url = data.github_release.latest.assets[count.index].url
request_headers = {
Accept = "application/octet-stream"
Authorization = "Bearer ${var.github_token}"
}
}
output "release_assets" {
value = data.http.release_assets.*.body
}Note that, in addition to requiring the use of an additional provider (i.e. the http provider), the use of the var.github_token creates a few complications:
- It's necessary to ensure it's not printed in plain text in logs, Terraform state, etc.
- If its value is generated dynamically via a GitHub app -- and if
planandapplyare divided across distinct phases run on different CI/CD compute infrastructure, each with their own distinctvar.github_token-generation -- then the token's value can change across each phase, resulting inError: Can't change variable when applying a saved planduring apply.
So, a github_release_asset data source would be very helpful!
SDK Version
No response
API Version
No response
Relevant log output
No response
Code of Conduct
- I agree to follow this project's Code of Conduct
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fields✅ Done
- StatusShow more project fieldsDone
Activity
feat: add github_release_asset data source
feat: add github_release_asset data source
mdb commentedon May 5, 2025
@nickfloyd I opened a PR (#2514) for this back in December. Is there anything I can do to help steward along that PR? Are you the best person to ping for reviews? Thanks!
feat: add github_release_asset data source
feat: add github_release_asset data source
feat: add github_release_asset data source
feat: add github_release_asset data source
feat: add github_release_asset data source
feat: add github_release_asset data source
feat: add github_release_asset data source
feat: add github_release_asset data source
feat: add github_release_asset data source
feat: add github_release_asset data source
feat: add github_release_asset data source
feat: add github_release_asset data source (#2514)
feat: add github_release_asset data source (integrations#2514)
felipebraga commentedon Feb 12, 2026
@stevehipwell the PR #2514 didn't work, it returns 406 when trying to download. I opened the #3186.
stevehipwell commentedon Feb 12, 2026
@felipebraga thanks for the heads up.
feat: add github_release_asset data source (integrations#2514)