Skip to content

ci: Harden workflows#1397

Open
RandomByte wants to merge 1 commit into
mainfrom
ci/hardening
Open

ci: Harden workflows#1397
RandomByte wants to merge 1 commit into
mainfrom
ci/hardening

Conversation

@RandomByte
Copy link
Copy Markdown
Member

  • Scope release-please contents/pull-requests write permissions to the
    release-please job; publish jobs only need id-token: write
  • Disable persist-credentials on checkouts that don't push to git
  • Move repository.name interpolation into env var to avoid template
    injection in run blocks
  • Replace spoofable github.actor check in dependabot-auto-merge with
    github.event.pull_request.user.login. Note: spoofing the dependabot
    actor alone is not sufficient to trigger the auto-merge step. The
    dependabot/fetch-metadata action only emits outputs for genuine
    dependabot PRs, so the merge step's check on
    steps.metadata.outputs.update-type would no-op on a spoofed run. The
    change closes the gap defensively.

@RandomByte RandomByte requested a review from matz3 May 26, 2026 09:41
Comment thread .github/workflows/release-please.yml Outdated
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Not needed as job does not have write permissions anyways, right?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Correct, updated 👍

- Scope release-please contents/pull-requests write permissions to the
  release-please job; publish jobs only need id-token: write
- Disable persist-credentials on checkouts that don't push to git
- Move repository.name interpolation into env var to avoid template
  injection in run blocks
- Replace spoofable github.actor check in dependabot-auto-merge with
  github.event.pull_request.user.login. Note: spoofing the dependabot
  actor alone is not sufficient to trigger the auto-merge step. The
  dependabot/fetch-metadata action only emits outputs for genuine
  dependabot PRs, so the merge step's check on
  steps.metadata.outputs.update-type would no-op on a spoofed run. The
  change closes the gap defensively.
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