Skip to content

Harden GitHub Actions workflows#146

Merged
flavorjones merged 6 commits intomasterfrom
harden-github-actions
Mar 20, 2026
Merged

Harden GitHub Actions workflows#146
flavorjones merged 6 commits intomasterfrom
harden-github-actions

Conversation

@flavorjones
Copy link
Member

Summary

  • Add GitHub Actions audit CI job (actionlint + zizmor) to lint workflows on every push/PR
  • Configure dependabot for github-actions (weekly, batched) and bundler ecosystems with cooldowns
  • Pin all actions to SHA hashes via pinact
  • Set permissions: {} at workflow level with scoped contents: read per job
  • Add persist-credentials: false to all checkout steps
  • Suppress unpinned-images findings for service containers (redis, postgres, mysql) -- digest pinning is nontrivial for service containers

Test plan

  • Verify CI passes with the new lint-actions job
  • Verify rubocop and test jobs still work with restricted permissions
  • Confirm dependabot creates batched PRs for action updates

🤖 Generated with Claude Code

flavorjones and others added 6 commits March 20, 2026 13:31
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Add persist-credentials: false to all checkout steps (artipacked)
- Set permissions: {} at workflow level with per-job contents: read (excessive-permissions)
- Add default-days to bundler cooldown (dependabot-cooldown)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…vice containers

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings March 20, 2026 17:34
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR hardens the repository’s GitHub Actions posture by reducing default token permissions, pinning action versions to SHAs, and adding CI workflow linting plus Dependabot automation for action updates.

Changes:

  • Add a new “GitHub Actions audit” job running actionlint and zizmor on every push/PR.
  • Restrict GITHUB_TOKEN permissions (permissions: {} at workflow level; scoped contents: read per job) and disable credential persistence on actions/checkout.
  • Add Dependabot configuration for github-actions (grouped) and bundler ecosystems.

Tip

If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
.github/workflows/build.yml Pins actions to SHAs, tightens token permissions, disables checkout credential persistence, adds workflow audit job, and adds zizmor suppressions for service containers.
.github/dependabot.yml Adds Dependabot update schedules/groups for GitHub Actions and Bundler dependencies.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@flavorjones flavorjones merged commit 650ebea into master Mar 20, 2026
34 checks passed
@flavorjones flavorjones deleted the harden-github-actions branch March 20, 2026 19:06
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.

2 participants