Add minimum token permissions for all GitHub workflow files #2
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.
This PR adds minimum token permissions to GitHub workflow files to improve the repository's OSSF Scorecard rating as requested in the issue.
Changes Made
Updated 2 workflow files to include the missing
contents: read
permission:.github/workflows/ci-java.yml
- Addedcontents: read
while preserving existingpull-requests: write
permission (needed for Gradle PR comments).github/workflows/close-stale.yaml
- Addedcontents: read
while preserving existingissues: write
andpull-requests: write
permissions (needed for stale bot functionality)Files Already Compliant
The following 16 workflow files were already correctly configured and required no changes:
ci-collector.yml
,ci-nodejs.yml
,ci-python.yml
,ci-shellcheck.yml
,ci-terraform.yml
) ✅codeql.yml
,fossa.yml
) ✅layer-publish.yml
,publish-layer-collector.yml
) ✅contents: write
permissions ✅permissions: read-all
were left unchanged as instructed (ossf-scorecard.yml
,check-links.yaml
) ✅Implementation Notes
permissions: contents: read
instead ofpermissions: read-all
All 18 GitHub workflow files now have minimum token permissions configured according to OSSF Scorecard requirements.
Fixes #1.
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.