Uh oh!
There was an error while loading. Please reload this page.
feat: Add the Digest field to ReleaseAsset - #3628
Merged
gmlewis merged 2 commits intoJul 19, 2025
Merged
Conversation
https://github.blog/changelog/2025-06-03-releases-now-expose-digests-for-release-assets/https://docs.github.com/en/rest/releases/releases?apiVersion=2022-11-28#get-a-release The `Get a Release` API returns digests of assets. To get digests, this commit adds the field `Digest` and the method `GetDigest` to `ReleaseAsset`.
suzuki-shunsuke
commented
Jul 19, 2025
ContributorAuthor
Test has passed. $ ./script/test.shtesting .ok github.com/google/go-github/v73/github 3.617s coverage: 99.1% of statements github.com/google/go-github/v73/test/fields coverage: 0.0% of statements? github.com/google/go-github/v73/test/integration [no test files]testing example github.com/google/go-github/v73/example/actionpermissions coverage: 0.0% of statements github.com/google/go-github/v73/example/appengine coverage: 0.0% of statements github.com/google/go-github/v73/example/basicauth coverage: 0.0% of statements github.com/google/go-github/v73/example/codespaces/newreposecretwithxcrypto coverage: 0.0% of statements github.com/google/go-github/v73/example/codespaces/newusersecretwithxcrypto coverage: 0.0% of statements github.com/google/go-github/v73/example/commitpr coverage: 0.0% of statements github.com/google/go-github/v73/example/listenvironments coverage: 0.0% of statements github.com/google/go-github/v73/example/migrations coverage: 0.0% of statements github.com/google/go-github/v73/example/newfilewithappauth coverage: 0.0% of statements github.com/google/go-github/v73/example/newrepo coverage: 0.0% of statements github.com/google/go-github/v73/example/newreposecretwithxcrypto coverage: 0.0% of statements github.com/google/go-github/v73/example/ratelimit coverage: 0.0% of statements github.com/google/go-github/v73/example/simple coverage: 0.0% of statements github.com/google/go-github/v73/example/tokenauth coverage: 0.0% of statements github.com/google/go-github/v73/example/topics coverage: 0.0% of statements github.com/google/go-github/v73/example/verifyartifact coverage: 0.0% of statementstesting scrapeok github.com/google/go-github/scrape 1.234s coverage: 59.4% of statements github.com/google/go-github/scrape/example/scrape coverage: 0.0% of statementstesting toolsok tools/metadata 1.280s coverage: 81.7% of statementstesting tools/sliceofpointersok tools/sliceofpointers 1.452s coverage: 94.7% of statements |
suzuki-shunsuke
commented
Jul 19, 2025
ContributorAuthor
I've confirmed the fix works as expected. package main
import (
"context""encoding/json""log""os""github.com/google/go-github/v73/github""golang.org/x/oauth2"
)
funcmain() {
iferr:=run(); err!=nil {
log.Fatal(err)
}
}
funcrun() error {
ctx:=context.Background()
httpClient:=oauth2.NewClient(ctx, oauth2.StaticTokenSource(
&oauth2.Token{AccessToken: os.Getenv("GITHUB_TOKEN")},
))
client:=github.NewClient(httpClient).Repositoriesrelease, _, err:=client.GetRelease(ctx, "aquaproj", "aqua", 233010212)
iferr!=nil {
returnerr
}
encoder:=json.NewEncoder(os.Stdout)
encoder.SetIndent("", " ")
iferr:=encoder.Encode(release); err!=nil {
returnerr
}
returnnil
}modulefoogo1.24.5require (
github.com/google/go-github/v73v73.0.0golang.org/x/oauth2v0.30.0
)
replacegithub.com/google/go-github/v73=>github.com/suzuki-shunsuke/go-github/v73v73.0.1-0.20250719051818-956a007e23farequiregithub.com/google/go-querystringv1.1.0// indirectGITHUB_TOKEN=$(gh auth token) go run main.go |
suzuki-shunsuke
marked this pull request as ready for review
July 19, 2025 05:38
alexandear
approved these changes
Jul 19, 2025
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@## master #3628 +/- ##
=======================================
Coverage 91.33% 91.33% =======================================
Files 184 184 Lines 16174 16174 =======================================
Hits 14773 14773 Misses 1227 1227 Partials 174 174 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Digest field to ReleaseAssetgmlewis
commented
Jul 19, 2025
Collaborator
Thank you, @suzuki-shunsuke and @alexandear! |
Uh oh!
There was an error while loading. Please reload this page.
jlaportebot added a commit
to jlaportebot/go-github
that referenced
this pull request
Jun 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Close#3627
https://github.blog/changelog/2025-06-03-releases-now-expose-digests-for-release-assets/
https://docs.github.com/en/rest/releases/releases?apiVersion=2022-11-28#get-a-release
The
Get a ReleaseAPI returns digests of assets.To get digests, this commit adds the field
Digestand the methodGetDigesttoReleaseAsset.