Skip to content

Commit f09019f

Browse files
committed
ci: Harden workflows
- Scope release-please write permissions to the pull-request job so the publish-package job runs with only id-token: write. - 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.
1 parent 7f637c6 commit f09019f

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

.github/workflows/dependabot-auto-merge.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ permissions:
1111
jobs:
1212
dependabot:
1313
runs-on: ubuntu-latest
14-
if: ${{ github.actor == 'dependabot[bot]' }}
14+
if: ${{ github.event.pull_request.user.login == 'dependabot[bot]' }}
1515
steps:
1616
- name: Dependabot metadata
1717
id: metadata

.github/workflows/release-please.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,14 @@ on:
55
branches:
66
- main
77

8-
permissions:
9-
contents: write
10-
pull-requests: write
8+
permissions: {}
119

1210
jobs:
1311
pull-request:
1412
runs-on: ubuntu-24.04
13+
permissions:
14+
contents: write
15+
pull-requests: write
1516
outputs:
1617
releases_created: ${{steps.release.outputs.releases_created}}
1718
paths_released: ${{steps.release.outputs.paths_released}}

0 commit comments

Comments
 (0)