-
Notifications
You must be signed in to change notification settings - Fork 763
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FEAT]: Support github_release_asset data source #2513
Labels
Comments
mdb
added
Status: Triage
This is being looked at and prioritized
Type: Feature
New feature or request
labels
Dec 13, 2024
mdb
added a commit
to mdb/terraform-provider-github
that referenced
this issue
Dec 14, 2024
This addresses issue integrations#2513 and adds support for a `github_release_asset` data source. Example of passing acceptance tests: ``` $ GITHUB_ORGANIZATION=mdb GITHUB_OWNER=mdb GITHUB_TEMPLATE_REPOSITORY=terraputs GITHUB_TEMPLATE_REPOSITORY_RELEASE_ASSET_ID=206493547 GITHUB_TEMPLATE_REPOSITORY_RELEASE_ASSET_NAME=checksums.txt TF_ACC=1 go test -v ./... -run ^TestAccGithubReleaseAssetDataSource ? github.com/integrations/terraform-provider-github/v6 [no test files] === RUN TestAccGithubReleaseAssetDataSource === RUN TestAccGithubReleaseAssetDataSource/queries_specified_asset_ID === RUN TestAccGithubReleaseAssetDataSource/queries_specified_asset_ID/with_an_anonymous_account provider_utils.go:51: GITHUB_TOKEN environment variable should be empty provider_utils.go:74: Skipping TestAccGithubReleaseAssetDataSource/queries_specified_asset_ID/with_an_anonymous_account which requires anonymous mode === RUN TestAccGithubReleaseAssetDataSource/queries_specified_asset_ID/with_an_individual_account === RUN TestAccGithubReleaseAssetDataSource/queries_specified_asset_ID/with_an_organization_account --- PASS: TestAccGithubReleaseAssetDataSource (5.20s) --- PASS: TestAccGithubReleaseAssetDataSource/queries_specified_asset_ID (5.20s) --- SKIP: TestAccGithubReleaseAssetDataSource/queries_specified_asset_ID/with_an_anonymous_account (0.00s) --- PASS: TestAccGithubReleaseAssetDataSource/queries_specified_asset_ID/with_an_individual_account (2.57s) --- PASS: TestAccGithubReleaseAssetDataSource/queries_specified_asset_ID/with_an_organization_account (2.62s) PASS ok github.com/integrations/terraform-provider-github/v6/github 5.688s ``` Signed-off-by: Mike Ball <[email protected]>
4 tasks
mdb
added a commit
to mdb/terraform-provider-github
that referenced
this issue
Dec 17, 2024
This addresses issue integrations#2513 and adds support for a `github_release_asset` data source. Example of passing acceptance tests: ``` GITHUB_ORGANIZATION=mterwill \ GITHUB_OWNER=mterwill \ TF_ACC=1 \ go test -v ./... -run ^TestAccGithubReleaseAssetDataSource ? github.com/integrations/terraform-provider-github/v6 [no test files] === RUN TestAccGithubReleaseAssetDataSource === RUN TestAccGithubReleaseAssetDataSource/queries_specified_asset_ID === RUN TestAccGithubReleaseAssetDataSource/queries_specified_asset_ID/with_an_anonymous_account provider_utils.go:51: GITHUB_TOKEN environment variable should be empty provider_utils.go:74: Skipping TestAccGithubReleaseAssetDataSource/queries_specified_asset_ID/with_an_anonymous_account which requires anonymous mode === RUN TestAccGithubReleaseAssetDataSource/queries_specified_asset_ID/with_an_individual_account === RUN TestAccGithubReleaseAssetDataSource/queries_specified_asset_ID/with_an_organization_account --- PASS: TestAccGithubReleaseAssetDataSource (11.65s) --- PASS: TestAccGithubReleaseAssetDataSource/queries_specified_asset_ID (11.65s) --- SKIP: TestAccGithubReleaseAssetDataSource/queries_specified_asset_ID/with_an_anonymous_account (0.00s) --- PASS: TestAccGithubReleaseAssetDataSource/queries_specified_asset_ID/with_an_individual_account (8.90s) --- PASS: TestAccGithubReleaseAssetDataSource/queries_specified_asset_ID/with_an_organization_account (2.75s) PASS ok github.com/integrations/terraform-provider-github/v6/github 12.434s ``` Signed-off-by: Mike Ball <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
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 agithub_release_asset
data source, I'm imagining something akin to the following (although, it would be useful to support additional/alternative arguments beyond justid
too, and perhaps even the option to download the asset):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 avar.github_token
) for providing a GitHub token:Note that, in addition to requiring the use of an additional provider (i.e. the
http
provider), the use of thevar.github_token
creates a few complications:plan
andapply
are 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 plan
during 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
The text was updated successfully, but these errors were encountered: