Skip to content

fix: Add explicit permissions to GitHub Actions workflows - #4175

Merged
xerial merged 1 commit into
mainfrom
fix/20260428_202627-workflow-permissions
Apr 29, 2026
Merged

fix: Add explicit permissions to GitHub Actions workflows#4175
xerial merged 1 commit into
mainfrom
fix/20260428_202627-workflow-permissions

Conversation

@xerial

@xerial xerial commented Apr 29, 2026

Copy link
Copy Markdown
Member

Summary

  • Adds least-privilege permissions blocks to all GitHub Actions workflows that were missing them, resolving the 25 open actions/missing-workflow-permissions alerts at https://github.com/wvlet/airframe/security/code-scanning
  • Most workflows get contents: read only
  • test.yml also gets checks: write (required by mikepenz/action-junit-report for check annotations)
  • release-note.yml gets contents: write (required by gh release create)
  • doc.yml stays read-only — the gh-pages push uses the GIT_DEPLOY_KEY SSH key, not GITHUB_TOKEN

Test plan

  • CI workflow runs and Publish Test Report annotations still appear on PRs
  • After merge, confirm the 25 open alerts on the Security tab are auto-closed
  • Next tag push: release-note.yml still successfully creates a release
  • Next tag push: release/snapshot publishing to Sonatype still works

Restrict the default GITHUB_TOKEN to least-privilege scopes for every
workflow, addressing the 25 open `actions/missing-workflow-permissions`
code-scanning alerts at https://github.com/wvlet/airframe/security.

Most workflows only need `contents: read`. Exceptions:
- `test.yml` adds `checks: write` for `mikepenz/action-junit-report`
  to publish check annotations.
- `release-note.yml` uses `contents: write` so `gh release create`
  can publish the release.

`doc.yml` keeps `contents: read` because the gh-pages push uses the
`GIT_DEPLOY_KEY` SSH key, not GITHUB_TOKEN.
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Note

Gemini is unable to generate a review for this pull request due to the file types involved not being currently supported.

@github-actions github-actions Bot added the bug label Apr 29, 2026
@xerial
xerial merged commit 876a832 into main Apr 29, 2026
24 checks passed
@xerial
xerial deleted the fix/20260428_202627-workflow-permissions branch April 29, 2026 03:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant