Skip to content

ci: harden workflow and Dependabot against supply-chain attacks - #4

Merged
mattmilesi merged 1 commit into
mainfrom
ci/harden-workflows
Oct 15, 2026
Merged

mattmilesi merged 1 commit into
mainfrom
ci/harden-workflows

Conversation

@mattmilesi

@mattmilesi mattmilesi commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Hardens the CI workflow and the Dependabot configuration against supply-chain attacks.

.github/workflows/ci.yml

  • permissions: contents: read — the default GITHUB_TOKEN no longer inherits the repository's default (possibly write) scope.
  • persist-credentials: false on 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.
  • concurrency cancels superseded runs on pull requests; pushes to main always run to completion.

.github/dependabot.yml

  • cooldown: default-days: 7 for 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

🤖 Generated with Claude Code


Summary by cubic

Hardens the CI workflow and Dependabot configuration against supply-chain attacks.

  • Restricts the default GITHUB_TOKEN to contents: read and checks out with persist-credentials: false so later steps can't read the token.
  • Pins every action to a full commit SHA with the release in a trailing comment; bumps actions/checkout to v7.0.1, shivammathur/setup-php to 2.40.0, and ramsey/composer-install to 4.0.0.
  • Adds a concurrency group so superseded pull-request runs are cancelled while pushes to main always run to completion.
  • Adds a 7-day Dependabot cooldown for both ecosystems and groups GitHub Actions updates into a single monthly PR.

Written for commit 1e4c012. Summary will update on new commits.

View guided diff Turn on auto-fix

- Restrict the default GITHUB_TOKEN to contents: read.
- Check out with persist-credentials: false so the token is not left
  in the runner's git config for later steps (Composer scripts
  included).
- Pin every action to a full commit SHA with the release as a
  comment; Dependabot keeps both in sync. Bumps actions/checkout to
  v7.0.1.
- Cancel superseded runs on pull requests.
- Dependabot: wait 7 days before proposing a new release (cooldown)
  and group GitHub Actions updates into a single PR.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

No issues found across 2 files

Tip: Get a Slack DM when cubic finishes reviewing your PRs. Connect Slack

View guided diff | Turn on auto-fix | Re-trigger cubic

@mattmilesi
mattmilesi merged commit e2f6110 into main Oct 15, 2026
5 checks passed
@mattmilesi
mattmilesi deleted the ci/harden-workflows branch October 15, 2026 08:44
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.

1 participant