Skip to content

Commit 9398ba6

Browse files
committed
fix(.github/workflows): scope dependabot-auto-merge token permissions to job level
Move the contents/pull-requests write scopes from the top-level permissions block down to the job that actually uses them, and restrict the workflow's default token to read-all. Matches the pattern used by the other Linuxfabrik workflows and clears the OpenSSF Scorecard Token-Permissions finding for this workflow.
1 parent db2a1dd commit 9398ba6

2 files changed

Lines changed: 17 additions & 12 deletions

File tree

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,26 @@
1-
name: "Linuxfabrik: Dependabot auto-merge"
1+
name: 'Linuxfabrik: Dependabot auto-merge'
22

33
on:
4-
pull_request:
4+
pull_request: {}
55

6-
permissions:
7-
contents: write
8-
pull-requests: write
6+
permissions: 'read-all'
97

108
jobs:
119
auto-merge:
12-
runs-on: ubuntu-latest
13-
if: github.actor == 'dependabot[bot]'
10+
runs-on: 'ubuntu-latest'
11+
if: 'github.actor == ''dependabot[bot]'''
12+
permissions:
13+
contents: 'write'
14+
pull-requests: 'write'
1415
steps:
1516

16-
- uses: dependabot/fetch-metadata@25dd0e34f4fe68f24cc83900b1fe3fe149efef98 # v3.1.0
17-
id: meta
17+
- uses: 'dependabot/fetch-metadata@25dd0e34f4fe68f24cc83900b1fe3fe149efef98' # v3.1.0
18+
id: 'meta'
1819

1920
- if: >-
2021
steps.meta.outputs.update-type == 'version-update:semver-patch'
2122
|| steps.meta.outputs.update-type == 'version-update:semver-minor'
22-
run: gh pr merge --auto --squash "$PR_URL"
23+
run: 'gh pr merge --auto --squash "$PR_URL"'
2324
env:
24-
PR_URL: ${{ github.event.pull_request.html_url }}
25-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
25+
PR_URL: '${{ github.event.pull_request.html_url }}'
26+
GH_TOKEN: '${{ secrets.GITHUB_TOKEN }}'

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
88

99
## [Unreleased]
1010

11+
### Security
12+
13+
* **ci**: Scope `GITHUB_TOKEN` permissions in the dependabot-auto-merge workflow to the job level, with top-level now `read-all`. Matches the pattern used by the other Linuxfabrik workflows and addresses the OpenSSF Scorecard `Token-Permissions` finding.
14+
1115
### Breaking Changes
1216

1317
Build, CI/CD:

0 commit comments

Comments
 (0)