Skip to content

ci: declare contents: read on seven CI workflows#4433

Open
arpitjain099 wants to merge 1 commit into
GoogleCloudPlatform:mainfrom
arpitjain099:ci/add-permissions
Open

ci: declare contents: read on seven CI workflows#4433
arpitjain099 wants to merge 1 commit into
GoogleCloudPlatform:mainfrom
arpitjain099:ci/add-permissions

Conversation

@arpitjain099
Copy link
Copy Markdown

Seven read-only CI workflows currently run with no permissions: declared. All do checkout + maven / native-image / sonar / linkage-check / upload-artifact. None push, comment, or call write APIs.

GITHUB_TOKEN usages:

  • NativeTests: passed to actions/setup-java as a github-token (read for releases lookups)
  • compatibilityCheck: passed to softprops/turnstyle to wait for sibling workflow status (read)
  • sonar: passed for PR-metadata lookup (read)

contents: read is the right minimum for all seven.

Two workflows are intentionally not in this PR because they need very different scopes:

  • codeql-analysis.yml — needs security-events: write for SARIF upload
  • renovate.yml — needs contents: write + pull-requests: write for branch push + PR creation

Those deserve their own focused PRs.

All seven workflows checkout the repo and run maven / native-image / sonar /
linkage-check / upload-artifact. None push, comment, or call GitHub write
APIs. The GITHUB_TOKEN usages in NativeTests, compatibilityCheck (turnstyle),
and sonar are all read-side (turnstyle waits for sibling workflow status,
sonar reads PR metadata).

codeql-analysis.yml (needs security-events: write) and renovate.yml (needs
contents+pull-requests: write) are intentionally left out - they need
different scopes and warrant separate review.

Signed-off-by: Arpit Jain <arpitjain099@gmail.com>
@arpitjain099 arpitjain099 requested a review from a team as a code owner May 13, 2026 08:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant