Grant workflow-scoped token to update-dependencies workflow#11
Merged
Merged
Conversation
The update-dependencies workflow runs typeflowsExport, which regenerates .github/workflows files. The default GITHUB_TOKEN cannot create or update workflow files, so peter-evans/create-pull-request needs a token with the `workflow` scope. Reuse the existing TOOLBOX_REPO_TOKEN for both checkout and the PR creation, and re-export the generated YAML. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0112sPKfNyutkzWEDWsjHXAZ
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.
What
Give the
update-dependenciesworkflow a token with theworkflowscope, and re-export the generated YAML.Why
The
update-dependenciesworkflow runs./gradlew ... typeflowsExport, which regenerates the files under.github/workflows. When those regenerated files differ,peter-evans/create-pull-requesttries to commit them — but the defaultGITHUB_TOKENis not permitted to create or update workflow files (refusing to allow a GitHub App to create or update workflow ... without workflows permission).Note there is no
workflowsentry for a job'spermissions:block in GitHub Actions (the 15 job-level scopes don't include it) — the "workflows permission" lives on the token. So the fix is to supply a token that carries theworkflowscope, rather than apermissions:change.Changes
In
UpdateGradleProjectDependencies.kt:TOOLBOX_REPO_TOKENorg secret (already used byBuild.kt) as thetokenfor both theCheckoutstep and thepeter-evans/create-pull-requeststep.typeflowsExport, regenerating.github/workflows/update-dependencies.ymland the.github/typeflows/update-dependencies/README.mdvisualisation.🤖 Generated with Claude Code
https://claude.ai/code/session_0112sPKfNyutkzWEDWsjHXAZ
Generated by Claude Code