Skip to content

Commit 2efa4b6

Browse files
committed
security: move workflow permissions to job level
1 parent 34c7712 commit 2efa4b6

3 files changed

Lines changed: 8 additions & 12 deletions

File tree

.github/workflows/release.yml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,12 @@ on:
44
push:
55
branches: [main]
66

7-
permissions:
8-
contents: write
9-
pull-requests: write
10-
id-token: write # for SBOM attestation
11-
attestations: write # for SBOM attestation
12-
137
jobs:
148
release-please:
159
runs-on: ubuntu-latest
10+
permissions:
11+
contents: write
12+
pull-requests: write
1613
outputs:
1714
release_created: ${{ steps.release.outputs.release_created }}
1815
tag_name: ${{ steps.release.outputs.tag_name }}

.github/workflows/run_tests.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,6 @@ on:
66
pull_request:
77
branches: [main, dev]
88

9-
permissions:
10-
contents: read
11-
security-events: write
12-
139
jobs:
1410
pre-commit:
1511
runs-on: ubuntu-latest
@@ -19,6 +15,8 @@ jobs:
1915
with:
2016
python-version: '3.13'
2117
- uses: pre-commit/action@v3.0.1
18+
env:
19+
SKIP: pytest
2220

2321
test:
2422
needs: pre-commit
@@ -38,6 +36,9 @@ jobs:
3836
test-docker:
3937
needs: pre-commit
4038
runs-on: ubuntu-latest
39+
permissions:
40+
contents: read
41+
security-events: write
4142
steps:
4243
- uses: actions/checkout@v4
4344
- uses: astral-sh/setup-uv@v5

.github/workflows/scorecard.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ on:
77
- cron: '0 6 * * 1' # Weekly on Monday at 6 AM (aligned with CodeQL)
88
workflow_dispatch: # Allow manual triggers
99

10-
permissions: read-all
11-
1210
jobs:
1311
analysis:
1412
name: Scorecard analysis

0 commit comments

Comments
 (0)