Harden GitHub actions#424
Conversation
Runs actionlint and zizmor on workflow files. Placed after the rubocop lint job since it is a linting concern. 🤖 Assisted by Claude
Batches all github-actions updates into a single weekly PR. Adds cooldown windows to both ecosystems so updates soak before landing; github-actions matches the 7-day pinact --min-age. 🤖 Assisted by Claude
Ran `pinact run --min-age 7` to pin all actions to commit SHAs with version comments. Matches the 7-day cooldown in dependabot.yml. 🤖 Assisted by Claude
Resolves zizmor medium findings:
- excessive-permissions: deny-all permissions: {} at workflow level,
scope contents: read per job
- artipacked: persist-credentials: false on checkout in test/lint jobs
(neither pushes to git)
🤖 Assisted by Claude
actionlint/shellcheck flags the unquoted ${RUBYGEMS_VERSION:-}, but the
unquoted expansion is intentional: when the version is unset the arg
must vanish so `gem update --system` picks the latest. Quoting would
pass an empty version string instead. Suppress with a reason.
🤖 Assisted by Claude
0370953 to
2779341
Compare
There was a problem hiding this comment.
Pull request overview
This PR hardens the repository’s GitHub Actions setup by pinning actions to SHAs, tightening workflow permissions, and adding automated linting/auditing to prevent future regressions.
Changes:
- Tightens workflow triggers/permissions and disables credential persistence on checkouts.
- Pins referenced actions to commit SHAs and documents versions inline.
- Adds a
lint-actionsjob (actionlint + zizmor) and introduces a Dependabot configuration for Bundler and GitHub Actions.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
.github/workflows/ruby.yml |
Restricts triggers, locks down permissions, pins actions by SHA, and adds a new CI job to lint/audit workflows. |
.github/dependabot.yml |
Adds weekly Dependabot updates for Bundler and GitHub Actions with cooldown settings. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
| contents: read | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5 # v2.7.0 |
There was a problem hiding this comment.
any reason to keep it on 2.7 rather than updating to v6?
There was a problem hiding this comment.
No reason other than trying to keep it consistent with the previous @v2 tag used everywhere else. Dependabot will update it when it runs and then we should be all up-to-date with a separate PR that updates the versions.
Using zizmor, pinact, and actionlint to harden the github actions configuration.
pinactand a minimum age of 7 days)gem update --systemcommandlint-actionsCI job runningzizmorandactionlintto prevent regresssionsdependabotconfig for bundler and actions (weekly, 7-day cooldown)cc @jasnow @connorshea @simi