Skip to content

Commit caf81eb

Browse files
Merge pull request erlang#10999 from kikofernandez/kiko/fix-gh-actions-permissions
otp: fixes gh actions permissions OTP-20093
2 parents 7474fd0 + d9613a5 commit caf81eb

10 files changed

Lines changed: 28 additions & 35 deletions

.github/scorecard.yaml

Lines changed: 0 additions & 24 deletions
This file was deleted.

.github/workflows/github-actions-checker.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ on:
2929
push:
3030
pull_request:
3131

32+
permissions:
33+
contents: read
34+
3235
jobs:
3336
check-version-pinning:
3437
runs-on: 'ubuntu-latest'
@@ -43,4 +46,4 @@ jobs:
4346
4447
- uses: 'docker://ghcr.io/sethvargo/ratchet:latest@sha256:527e78e6d29a9ac306e843cf766afe0604a0b35633f16913d85dd522218e8ca1' # ratchet:docker://ghcr.io/sethvargo/ratchet:latest
4548
with:
46-
args: 'check ${{ steps.files.outputs.files }}'
49+
args: 'check ${{ steps.files.outputs.files }}'

.github/workflows/main.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ env:
5656
permissions:
5757
contents: read
5858
pull-requests: read
59-
security-events: write
6059

6160
jobs:
6261

@@ -530,6 +529,7 @@ jobs:
530529
if: ${{ needs.modified-vendor-files.outputs.vendor-files == 'true' && github.event_name == 'pull_request' && github.repository == 'erlang/otp'}}
531530
permissions:
532531
actions: read
532+
contents: read
533533
name: Vendor Vulnerability Scanning
534534
uses: ./.github/workflows/reusable-vendor-vulnerability-scanner.yml
535535
with:
@@ -704,6 +704,9 @@ jobs:
704704
name: Run static analysis
705705
runs-on: ubuntu-latest
706706
needs: pack
707+
permissions:
708+
contents: read
709+
security-events: write # needed for SARIF upload
707710
steps:
708711
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
709712
- uses: ./.github/actions/build-base-image

.github/workflows/openvex-sync.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@ jobs:
3535
run-scheduled-openvex-sync:
3636
runs-on: ubuntu-latest
3737
permissions:
38-
security-events: read
39-
actions: write
40-
contents: write
41-
pull-requests: write
38+
security-events: read # use inside the otp-compliance.es as API call
39+
actions: write # use inside the otp-compliance.es
40+
contents: write # use inside the otp-compliance.es
41+
pull-requests: write # use inside the otp-compliance.es
4242
steps:
4343
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
4444
with:

.github/workflows/ossf-compiler-flags-scanner.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ on:
3030

3131
permissions:
3232
contents: read
33-
security-events: write
3433

3534
jobs:
3635
schedule-scan:

.github/workflows/osv-scanner-scheduled.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ permissions:
3434
jobs:
3535
schedule-scan:
3636
runs-on: ubuntu-latest
37+
permissions:
38+
contents: read
3739
if: github.event_name == 'schedule' && github.repository == 'erlang/otp'
3840
# if: github.event_name != 'workflow_dispatch' # used for testing
3941
outputs:

.github/workflows/renovate-vendored-deps.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,14 @@ on:
2626
- '**/vendor.info'
2727

2828
permissions:
29-
contents: write # Required to push commits
30-
pull-requests: read
29+
contents: read
3130

3231
jobs:
3332
update-vendored-deps:
3433
runs-on: ubuntu-latest
34+
permissions:
35+
contents: write # Required to push commits
36+
pull-requests: write
3537
if: >
3638
github.event_name == 'pull_request' &&
3739
contains(github.event.pull_request.title, 'update dependency') &&

.github/workflows/reusable-vendor-vulnerability-scanner.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,10 @@ on:
8585
default: false
8686
type: boolean
8787

88+
permissions:
89+
contents: read # needed for checkout
90+
actions: read
91+
8892
env:
8993
VERSION: ${{ inputs.version }}
9094

.github/workflows/scorecard.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ on:
2929
branches:
3030
- master
3131

32-
permissions: read-all
32+
permissions:
33+
contents: read
34+
actions: read
3335

3436
jobs:
3537
analysis:
@@ -52,4 +54,3 @@ jobs:
5254
results_file: results.sarif
5355
results_format: sarif
5456
publish_results: true
55-
config_file: .github/scorecard.yaml

.github/workflows/security-practice-scheduled.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ on:
2626
schedule:
2727
- cron: 0 9 25 10 *
2828

29+
permissions:
30+
contents: read
31+
2932
jobs:
3033
review-security-practices:
3134
if: github.event_name == 'schedule' && github.repository == 'erlang/otp'

0 commit comments

Comments
 (0)