Repository navigation
Limit CI token to read-only and fix the scan_ruby check - #56
Merged
Merged
Conversation
Set a top-level permissions block (contents: read) in ci.yml so every job runs with a read-only GITHUB_TOKEN. This resolves the five CodeQL "Workflow does not contain permissions" alerts. Update Brakeman to 8.1.1. bin/brakeman runs with --ensure-latest, so the scan_ruby job failed as soon as 8.1.1 was released.
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 changed
.github/workflows/ci.yml: added a top-levelpermissions: contents: readblock. All five jobs (scan_ruby, scan_js, lint, test, system-test) only check out code, use caches and upload artifacts, none of which needs more than read access. This resolves code scanning alerts Strip quoted text from email replies #1 to Agent management screen #5 ("Workflow does not contain permissions").Gemfile.lock: Brakeman 8.1.0 to 8.1.1.bin/brakemanruns with--ensure-latest, so scan_ruby exits with code 5 whenever a newer Brakeman exists. That is why scan_ruby failed on Potential fix for code scanning alert no. 1: Workflow does not contain permissions #55 and would fail on main too.Supersedes #55, which has the same workflow change but not the Brakeman update, so its scan_ruby check fails.
Checks
bin/rails test: 136 runs, 0 failuresbin/rubocop: no offensesbin/brakeman --no-pager: no warningsbin/bundler-audit: no vulnerabilities