Skip to content

Commit b77edb0

Browse files
Add minimum token permissions for all github workflow files (#1884)
Co-authored-by: otelbot <197425009+otelbot@users.noreply.github.com>
1 parent e1b14ce commit b77edb0

8 files changed

+28
-8
lines changed

.github/workflows/ci-java.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,12 @@ on:
1515
- main
1616

1717
permissions:
18-
pull-requests: write
18+
contents: read
1919

2020
jobs:
2121
build:
22+
permissions:
23+
pull-requests: write
2224
runs-on: ubuntu-latest
2325
steps:
2426
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

.github/workflows/close-stale.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,13 @@ on:
44
- cron: "40 3 * * *" # Run daily at 3:40 AM
55

66
permissions:
7-
issues: write
8-
pull-requests: write
7+
contents: read
98

109
jobs:
1110
stale:
11+
permissions:
12+
issues: write
13+
pull-requests: write
1214
runs-on: ubuntu-latest
1315
steps:
1416
- uses: actions/stale@5bef64f19d7facfb25b37b414482c7164d639639 # v9.1.0

.github/workflows/publish-layer-collector.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,9 @@ jobs:
117117
fi
118118
echo "release_jobs={"architecture": ${architectures}, "aws_region": ${aws_regions}}" | tr -d '[:space:]' >> $GITHUB_OUTPUT
119119
release-layer:
120+
permissions: # required by the reusable workflow
121+
contents: read
122+
id-token: write
120123
uses: ./.github/workflows/layer-publish.yml
121124
needs: prepare-release-jobs
122125
strategy:

.github/workflows/release-layer-collector.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ on:
77
- layer-collector/**
88

99
permissions:
10-
id-token: write
1110
contents: read
1211

1312
jobs:
@@ -59,6 +58,9 @@ jobs:
5958
echo "COLLECTOR_VERSION=$COLLECTOR_VERSION" >> $GITHUB_OUTPUT
6059
6160
publish-layer:
61+
permissions: # required by the reusable workflow
62+
contents: read
63+
id-token: write
6264
uses: ./.github/workflows/layer-publish.yml
6365
needs: build-layer
6466
strategy:

.github/workflows/release-layer-java.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ on:
77
- layer-javaagent/**
88

99
permissions:
10-
id-token: write
1110
contents: read
1211

1312
jobs:
@@ -80,6 +79,9 @@ jobs:
8079
echo "JAVAWRAPPER_VERSION=$JAVAWRAPPER_VERSION" >> $GITHUB_OUTPUT
8180
8281
publish-javaagent-layer:
82+
permissions: # required by the reusable workflow
83+
contents: read
84+
id-token: write
8385
uses: ./.github/workflows/layer-publish.yml
8486
needs: build-layer
8587
strategy:
@@ -114,6 +116,9 @@ jobs:
114116
secrets: inherit
115117

116118
publish-javawrapper-layer:
119+
permissions: # required by the reusable workflow
120+
contents: read
121+
id-token: write
117122
uses: ./.github/workflows/layer-publish.yml
118123
needs: build-layer
119124
strategy:

.github/workflows/release-layer-nodejs.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ on:
77
- layer-nodejs/**
88

99
permissions:
10-
id-token: write
1110
contents: read
1211

1312
jobs:
@@ -65,6 +64,9 @@ jobs:
6564
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6665

6766
publish-layer:
67+
permissions: # required by the reusable workflow
68+
contents: read
69+
id-token: write
6870
uses: ./.github/workflows/layer-publish.yml
6971
needs: build-layer
7072
strategy:

.github/workflows/release-layer-python.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ on:
77
- layer-python/**
88

99
permissions:
10-
id-token: write
1110
contents: read
1211

1312
jobs:
@@ -72,6 +71,9 @@ jobs:
7271
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7372

7473
publish-layer:
74+
permissions: # required by the reusable workflow
75+
contents: read
76+
id-token: write
7577
uses: ./.github/workflows/layer-publish.yml
7678
needs: build-layer
7779
strategy:

.github/workflows/release-layer-ruby.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ on:
77
- layer-ruby/**
88

99
permissions:
10-
id-token: write
1110
contents: read
1211

1312
jobs:
@@ -64,6 +63,9 @@ jobs:
6463
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6564

6665
publish-layer:
66+
permissions: # required by the reusable workflow
67+
contents: read
68+
id-token: write
6769
uses: ./.github/workflows/layer-publish.yml
6870
needs: build-layer
6971
strategy:

0 commit comments

Comments
 (0)