Skip to content

ci: declare job permissions and pin actions to full SHAs (M04, M06) - #160

Merged
RGood merged 1 commit into
mainfrom
m04-m06/declare-permissions-pin-actions
Nov 12, 2026
Merged

RGood merged 1 commit into
mainfrom
m04-m06/declare-permissions-pin-actions

Conversation

@RGood

@RGood RGood commented Nov 11, 2026

Copy link
Copy Markdown
Collaborator

Summary

Applies mitigations M04 (declare job permissions) and M06 (pin actions) from the Reddit GitHub Actions hardening plan.

  • Add top-level permissions: contents: read to ci.yaml. The test job only builds and tests, so it needs nothing more.
  • Set persist-credentials: false on checkout. The job never pushes.
  • Pin actions/checkout and actions/setup-node to full commit SHAs, with version comments (same commit the current tag points to).
  • Add a github-actions ecosystem to Dependabot so the pins are updated automatically.

Testing

Check the CI run on this PR: the "GITHUB_TOKEN Permissions" section of the job log should show only Contents: read and Metadata: read, and the job should pass.

Notes

  • Not Copybara-managed (no Copybara commits in recent history).
  • Repo settings (token default read, no Actions PR approval, execution policy) are already applied. "Require full SHA pins" (M14) will be enabled only after this merges, so unpinned actions don't break CI.

@RGood
RGood requested a review from ben-harris-5 November 11, 2026 20:28
@RGood RGood closed this Nov 12, 2026
@RGood RGood reopened this Nov 12, 2026
@RGood
RGood merged commit bb10340 into main Nov 12, 2026
1 check passed
@RGood
RGood deleted the m04-m06/declare-permissions-pin-actions branch November 12, 2026 16:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants