Skip to content

ci: Harden workflows#58

Open
RandomByte wants to merge 2 commits into
mainfrom
ci/hardening
Open

ci: Harden workflows#58
RandomByte wants to merge 2 commits into
mainfrom
ci/hardening

Conversation

@RandomByte
Copy link
Copy Markdown
Member

  • 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.
  • Set persist-credentials: false on the two actions/checkout steps in ci.yml and reuse-compliance.yml. Both jobs already declare permissions: {}, so the persisted token has no scopes, but disabling persistence removes the token from the local git config entirely.

@RandomByte RandomByte requested a review from matz3 May 26, 2026 09:49
Comment thread .github/workflows/ci.yml Outdated
- uses: actions/checkout@v6
with:
fetch-depth: 0
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 the job does not have write permissions

Comment thread .github/workflows/reuse-compliance.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 the job does not have write permissions

- 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.
- Set `persist-credentials: false` on the two `actions/checkout`
  steps in `ci.yml` and `reuse-compliance.yml`. Both jobs already
  declare `permissions: {}`, so the persisted token has no scopes, but
  disabling persistence removes the token from the local git config
  entirely.
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