History

Harden GitHub workflow permissions

- Restrict release workflow defaults to read-only access - Grant `id-token` only to the publish job - Document safe handling for `pull_request_target` in PR size checks

Julius Marminge committed 6 months agov0.0.24-nightly.20260513.277

Commit 556c4241 parent 7e20b232 files · +8 −2Browse files

Showing the changes to .github (2 of 2 files). Show all

Unified · Split

2 files
  1. .github/workflows/pr-size.yml +3 −0
  2. .github/workflows/release.yml +5 −2
.github/workflows/pr-size.yml+3−0
@@ -124,6 +124,9 @@ jobs: · 123 unmodified lines
124 group: pr-size-${{ github.event.pull_request.number }}124 group: pr-size-${{ github.event.pull_request.number }}
125 cancel-in-progress: true125 cancel-in-progress: true
126 steps:126 steps:
127 # This pull_request_target job may fetch untrusted PR commits only as passive
128 # git data. Do not add dependency installs, build/test scripts, or cache
129 # actions here; use pull_request plus workflow_run for that pattern instead.
127 - name: Checkout base repository130 - name: Checkout base repository
128 uses: actions/checkout@v4131 uses: actions/checkout@v4
129 with:132 with:
.github/workflows/release.yml+5−2
@@ -23,8 +23,8 @@ on: · 22 unmodified lines
23 type: string23 type: string
24 24
25permissions:25permissions:
26 contents: write26 contents: read
27 id-token: write27 id-token: none
28 28
29jobs:29jobs:
30 check_changes:30 check_changes:
@@ -420,6 +420,9 @@ jobs: · 389 unmodified lines
420 if: ${{ !failure() && !cancelled() && needs.preflight.result == 'success' && needs.build.result == 'success' }}420 if: ${{ !failure() && !cancelled() && needs.preflight.result == 'success' && needs.build.result == 'success' }}
421 runs-on: ubuntu-24.04 # blacksmith-8vcpu-ubuntu-2404421 runs-on: ubuntu-24.04 # blacksmith-8vcpu-ubuntu-2404
422 timeout-minutes: 10422 timeout-minutes: 10
423 permissions:
424 contents: read
425 id-token: write
423 steps:426 steps:
424 - name: Checkout427 - name: Checkout
425 uses: actions/checkout@v6428 uses: actions/checkout@v6