Skip to content

ci: scope the golang job token to the permissions it needs - #744

Merged
mwbrooks merged 2 commits into
mainfrom
mwbrooks-golang-token-scope
Nov 3, 2026
Merged

mwbrooks merged 2 commits into
mainfrom
mwbrooks-golang-token-scope

Conversation

@mwbrooks

@mwbrooks mwbrooks commented Nov 2, 2026

Copy link
Copy Markdown
Member

Summary

This pull request gives the golang job's app token only the permissions it needs, for maintainers who want the dependency workflows to follow least privilege. The token used to inherit every permission of the releaser app installation, which zizmor flags.

  • contents: write to push the version bump branch.
  • pull-requests: write to open the pull request with its labels and milestone.
  • workflows: write because the bump edits .github/workflows/tests.yml, and GitHub rejects a push that changes a workflow file without it.

Testing

  • After merging, trigger "Update dependencies" with workflow_dispatch and confirm the "Bump the Golang version" job passes. It exits early with "No changes to commit" while Go is current.

Notes

Requirements

The app token inherited every permission of the installation. It now
gets only contents, pull requests, and workflows, which the job needs
to push the version bump and open a pull request.
@mwbrooks mwbrooks added this to the Next Release milestone Nov 2, 2026
@mwbrooks mwbrooks added code health M-T: Test improvements and anything that improves code health semver:patch Use on pull requests to describe the release version increment labels Nov 2, 2026
@mwbrooks mwbrooks self-assigned this Nov 2, 2026
@mwbrooks
mwbrooks requested a review from zimeg November 2, 2026 21:35
@codecov

codecov Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.18%. Comparing base (91bb8a5) to head (c17a39f).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #744      +/-   ##
==========================================
- Coverage   78.20%   78.18%   -0.02%     
==========================================
  Files         240      240              
  Lines       18179    18179              
==========================================
- Hits        14216    14214       -2     
- Misses       3963     3965       +2     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@mwbrooks
mwbrooks marked this pull request as ready for review November 2, 2026 21:39
@mwbrooks
mwbrooks requested a review from a team as a code owner November 2, 2026 21:39
@zimeg zimeg added the build M-T: Changes to compilation and CI processes label Nov 3, 2026

@zimeg zimeg left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ LGTM @mwbrooks! Nice follow-up to #736, and matches exactly what the golang job's checkout/push/PR-open steps need.

@mwbrooks

mwbrooks commented Nov 3, 2026

Copy link
Copy Markdown
Member Author

Thanks @zimeg for the quick review! 🙇

@mwbrooks
mwbrooks merged commit 213a3d1 into main Nov 3, 2026
14 checks passed
@mwbrooks
mwbrooks deleted the mwbrooks-golang-token-scope branch November 3, 2026 17:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build M-T: Changes to compilation and CI processes code health M-T: Test improvements and anything that improves code health semver:patch Use on pull requests to describe the release version increment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants