ci: harden workflow and Dependabot against supply-chain attacks
Merged
MA
13d ago+20+20+01234567890123456789-3-3-0123456789
Summary
Hardens the CI workflow and the Dependabot configuration against supply-chain attacks.
.github/workflows/ci.yml
permissions: contents: read— the defaultGITHUB_TOKENno longer inherits the repository's default (possibly write) scope.persist-credentials: falseon checkout — the token is not left in the runner's git config, where any later step (Composer scripts included) could read it.- Every action pinned to a full commit SHA, with the release in a trailing comment. Tags are mutable; SHAs are not. Dependabot updates the SHA and the comment together.
actions/checkout→ v7.0.1 (supersedes #3)shivammathur/setup-php→ 2.40.0ramsey/composer-install→ 4.0.0
concurrencycancels superseded runs on pull requests; pushes tomainalways run to completion.
.github/dependabot.yml
cooldown: default-days: 7for both ecosystems, so a freshly published (and possibly compromised, later yanked) release is not proposed immediately.- GitHub Actions updates grouped into a single monthly PR.
Test plan
- CI passes on PHP 8.2–8.5 with the pinned actions.
- Dependabot closes #3 as superseded once this is merged.
🤖 Generated with Claude Code
Summary by cubic
Hardens the CI workflow and Dependabot configuration against supply-chain attacks.
- Restricts the default
GITHUB_TOKENtocontents: readand checks out withpersist-credentials: falseso later steps can't read the token. - Pins every action to a full commit SHA with the release in a trailing comment; bumps
actions/checkoutto v7.0.1,shivammathur/setup-phpto 2.40.0, andramsey/composer-installto 4.0.0. - Adds a concurrency group so superseded pull-request runs are cancelled while pushes to
mainalways run to completion. - Adds a 7-day Dependabot cooldown for both ecosystems and groups GitHub Actions updates into a single monthly PR.