CI: fix access-token scope for get-next-version-code.sh - #686
Merged
Mansimran Singh (Mansimran-Singh) merged 1 commit intoAug 19, 2026
Merged
Conversation
PR #685's access_token_scopes fix turned out to be a no-op — confirmed against google-github-actions/auth's docs: that setting only affects the action's own `access_token` *output*, which is only generated when `token_format: access_token` is set. Without it, get-next-version-code.sh's `gcloud auth print-access-token` call reads the ADC credentials file instead and mints its own token independent of that setting — and `gcloud auth print-access-token` has no --scopes flag to force it either, confirmed against the gcloud CLI reference. Fix: set token_format: access_token on the auth step so it actually generates a scoped access_token output, and thread that into the script via $ACCESS_TOKEN instead of shelling out to gcloud. Also made the script print the actual Play API error body on edit-creation failure instead of a generic message, so the next failure (if any) is diagnosable from the workflow log alone. Related to #626.
Mansimran Singh (Mansimran-Singh)
requested review from
Michael Gonzalez (MicGon7) and
dlucci-wt
as code owners
August 19, 2026 17:46
Mansimran Singh (Mansimran-Singh)
deleted the
feature/626/fix-gcloud-token-scope
branch
August 19, 2026 17:51
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 free
to 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.
Summary
access_token_scopesfix on thegoogle-github-actions/authstep was a no-op. Confirmed against the action's own docs:access_token_scopesonly affects the action'saccess_tokenoutput, which only exists whentoken_format: access_tokenis set. Without it,get-next-version-code.sh'sgcloud auth print-access-tokenreads the ADC credentials file directly and mints its own token, ignoring that setting entirely — andgcloud auth print-access-tokenhas no--scopesflag to override it (confirmed against the gcloud CLI reference), so the token stayed scoped to the genericcloud-platformdefault, which the Android Publisher API'sedits.insertrejects.token_format: access_tokenon the auth step so it actually produces a scopedaccess_tokenoutput, and pass that intoget-next-version-code.shvia$ACCESS_TOKENinstead of shelling out togcloud.Ticket
Related to #626
Type of Change
Testing
CI workflow/script change, no unit-testable logic. Verified the two candidate root causes (access_token_scopes requiring token_format, and print-access-token having no --scopes flag) against google-github-actions/auth's and gcloud's own documentation rather than guessing again after the last fix turned out to be inert. Real validation happens on the next merge to
main.Checklist
./gradlew testDebug)