Skip to content

Commit eb2a4f3

Browse files
authored
More github actions permissions work (#13154)
1 parent f07f226 commit eb2a4f3

27 files changed

+52
-18
lines changed

.github/workflows/auto-update-otel-sdk.yml

+4-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ on:
66
- cron: "46 * * * *"
77
workflow_dispatch:
88

9+
permissions:
10+
contents: read
11+
912
jobs:
1013
check-versions:
1114
runs-on: ubuntu-latest
@@ -44,7 +47,7 @@ jobs:
4447
4548
update-otel-sdk:
4649
permissions:
47-
contents: write # for Git to git push
50+
contents: write # for git push to PR branch
4851
runs-on: ubuntu-latest
4952
if: |
5053
needs.check-versions.outputs.current-version != needs.check-versions.outputs.latest-version &&

.github/workflows/backport.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ permissions:
1212
jobs:
1313
backport:
1414
permissions:
15-
contents: write # for Git to git push
15+
contents: write # for git push to PR branch
1616
runs-on: ubuntu-latest
1717
steps:
1818
- run: |

.github/workflows/build-daily-no-build-cache.yml

+1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ jobs:
3333

3434
workflow-notification:
3535
permissions:
36+
contents: read
3637
issues: write
3738
needs:
3839
- common

.github/workflows/build-daily.yml

+1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ jobs:
3636

3737
workflow-notification:
3838
permissions:
39+
contents: read
3940
issues: write
4041
needs:
4142
- common

.github/workflows/codeql-daily.yml

+2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ permissions:
1212
jobs:
1313
analyze:
1414
permissions:
15+
contents: read
1516
actions: read # for github/codeql-action/init to get workflow details
1617
security-events: write # for github/codeql-action/analyze to upload SARIF results
1718
runs-on: ubuntu-latest
@@ -48,6 +49,7 @@ jobs:
4849

4950
workflow-notification:
5051
permissions:
52+
contents: read
5153
issues: write
5254
needs:
5355
- analyze

.github/workflows/issue-management-feedback-label.yml

+6
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,14 @@ on:
44
issue_comment:
55
types: [created]
66

7+
permissions:
8+
contents: read
9+
710
jobs:
811
issue_comment:
12+
permissions:
13+
contents: read
14+
issues: write
915
if: >
1016
contains(github.event.issue.labels.*.name, 'needs author feedback') &&
1117
github.event.comment.user.login == github.event.issue.user.login

.github/workflows/issue-management-stale-action.yml

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ permissions:
1111
jobs:
1212
stale:
1313
permissions:
14+
contents: read
1415
issues: write # for actions/stale to close stale issues
1516
pull-requests: write # for actions/stale to close stale PRs
1617
runs-on: ubuntu-latest

.github/workflows/label.yml

-2
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,10 @@ permissions:
66

77
jobs:
88
label:
9-
109
runs-on: ubuntu-latest
1110
permissions:
1211
contents: read
1312
pull-requests: write
14-
1513
steps:
1614
- uses: actions/labeler@8558fd74291d67161a8a78ce36a881fa63b766a9 # v5.0.0
1715
with:

.github/workflows/native-tests-daily.yml

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ jobs:
1717

1818
workflow-notification:
1919
permissions:
20+
contents: read
2021
issues: write
2122
needs:
2223
- graalvm-native-tests

.github/workflows/overhead-benchmark-daily.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ permissions:
1111
jobs:
1212
run-overhead-tests:
1313
permissions:
14-
contents: write # for writing to the gh-pages branch
14+
contents: write # for git push to gh-pages branch
1515
runs-on: ubuntu-latest
1616
steps:
1717
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
@@ -56,6 +56,7 @@ jobs:
5656

5757
workflow-notification:
5858
permissions:
59+
contents: read
5960
issues: write
6061
needs:
6162
- run-overhead-tests

.github/workflows/owasp-dependency-check-daily.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ permissions:
1414
jobs:
1515
analyze:
1616
runs-on: ubuntu-latest
17-
1817
steps:
1918
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2019

@@ -45,6 +44,7 @@ jobs:
4544

4645
workflow-notification:
4746
permissions:
47+
contents: read
4848
issues: write
4949
needs:
5050
- analyze

.github/workflows/prepare-patch-release.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ permissions:
88
jobs:
99
prepare-patch-release:
1010
permissions:
11-
contents: write # for Git to git push
11+
contents: write # for git push to PR branch
1212
runs-on: ubuntu-latest
1313
steps:
1414
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

.github/workflows/prepare-release-branch.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
2626
create-pull-request-against-release-branch:
2727
permissions:
28-
contents: write # for Git to git push
28+
contents: write # for git push to PR branch
2929
runs-on: ubuntu-latest
3030
needs:
3131
- prereqs
@@ -80,7 +80,7 @@ jobs:
8080
8181
create-pull-request-against-main:
8282
permissions:
83-
contents: write # for Git to git push
83+
contents: write # for git push to PR branch
8484
runs-on: ubuntu-latest
8585
needs:
8686
- prereqs

.github/workflows/publish-petclinic-benchmark-image.yml

+1
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ jobs:
4040

4141
workflow-notification:
4242
permissions:
43+
contents: read
4344
issues: write
4445
needs:
4546
- publish

.github/workflows/publish-smoke-test-early-jdk8-images.yml

+1
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ jobs:
4848

4949
workflow-notification:
5050
permissions:
51+
contents: read
5152
issues: write
5253
needs:
5354
- publish

.github/workflows/publish-smoke-test-fake-backend-images.yml

+1
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ jobs:
8484

8585
workflow-notification:
8686
permissions:
87+
contents: read
8788
issues: write
8889
needs:
8990
- publishLinux

.github/workflows/publish-smoke-test-grpc-images.yml

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ jobs:
2323

2424
workflow-notification:
2525
permissions:
26+
contents: read
2627
issues: write
2728
needs:
2829
- publish

.github/workflows/publish-smoke-test-play-images.yml

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ jobs:
2323

2424
workflow-notification:
2525
permissions:
26+
contents: read
2627
issues: write
2728
needs:
2829
- publish

.github/workflows/publish-smoke-test-quarkus-images.yml

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ jobs:
2626

2727
workflow-notification:
2828
permissions:
29+
contents: read
2930
issues: write
3031
needs:
3132
- publish

.github/workflows/publish-smoke-test-security-manager-images.yml

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ jobs:
2323

2424
workflow-notification:
2525
permissions:
26+
contents: read
2627
issues: write
2728
needs:
2829
- publish

.github/workflows/publish-smoke-test-servlet-images.yml

+1
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ jobs:
8888

8989
workflow-notification:
9090
permissions:
91+
contents: read
9192
issues: write
9293
needs:
9394
- publish

.github/workflows/publish-smoke-test-spring-boot-images.yml

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ jobs:
2323

2424
workflow-notification:
2525
permissions:
26+
contents: read
2627
issues: write
2728
needs:
2829
- publish

.github/workflows/release-update-cloudfoundry-index.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ on:
99
workflow_dispatch:
1010

1111
permissions:
12-
contents: write
13-
pull-requests: write
12+
contents: read
1413

1514
jobs:
16-
1715
update-cloudfoundry-index-yml:
16+
permissions:
17+
contents: write # for git push to PR branch
1818
runs-on: ubuntu-latest
1919
steps:
2020
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

.github/workflows/release.yml

+7
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ name: Release
22
on:
33
workflow_dispatch:
44

5+
permissions:
6+
contents: read
7+
58
jobs:
69
required-jobs:
710
uses: ./.github/workflows/build-common.yml
@@ -16,6 +19,8 @@ jobs:
1619
# and this is not a reason to hold up the release
1720

1821
release:
22+
permissions:
23+
contents: write # for creating the release
1924
runs-on: ubuntu-latest
2025
needs:
2126
- required-jobs
@@ -181,6 +186,8 @@ jobs:
181186
echo "prior-version=$PRIOR_VERSION" >> $GITHUB_OUTPUT
182187
183188
merge-change-log-to-main:
189+
permissions:
190+
contents: write # for git push to PR branch
184191
runs-on: ubuntu-latest
185192
needs:
186193
- release

.github/workflows/reusable-native-tests.yml

+3
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ on:
1010
type: boolean
1111
required: false
1212

13+
permissions:
14+
contents: read
15+
1316
jobs:
1417
graalvm-native-tests:
1518
if: "!inputs.skip-native-tests"

.github/workflows/reusable-workflow-notification.yml

+4-1
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,13 @@ on:
1010
required: true
1111

1212
permissions:
13-
issues: write
13+
contents: read
1414

1515
jobs:
1616
workflow-notification:
17+
permissions:
18+
contents: read
19+
issues: write
1720
runs-on: ubuntu-latest
1821
steps:
1922
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

.github/workflows/scorecard.yml

+3-5
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,19 @@ on:
1111
push:
1212
branches: [ "main" ]
1313

14-
# Declare default permissions as read only.
15-
permissions: read-all
14+
permissions:
15+
contents: read
1616

1717
jobs:
1818
analysis:
1919
name: Scorecard analysis
2020
runs-on: ubuntu-latest
2121
permissions:
22+
contents: read
2223
# Needed to upload the results to code-scanning dashboard.
2324
security-events: write
2425
# Needed to publish results and get a badge (see publish_results below).
2526
id-token: write
26-
# Uncomment the permissions below if installing in a private repository.
27-
# contents: read
28-
# actions: read
2927

3028
steps:
3129
- name: "Checkout code"

0 commit comments

Comments
 (0)