Skip to content

Commit 1d3086c

Browse files
opentelemetrybototelbot[bot]traskkaylareopelle
authored
ci: Add minimum token permissions for all github workflow files (#1578)
Add minimum token permissions for all github workflow files Co-authored-by: otelbot <[email protected]> Co-authored-by: Trask Stalnaker <[email protected]> Co-authored-by: Kayla Reopelle <[email protected]>
1 parent 3c31306 commit 1d3086c

16 files changed

+70
-3
lines changed

.github/workflows/check-spelling.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ name: Spelling
33
on:
44
pull_request:
55

6+
permissions:
7+
contents: read
8+
69
jobs:
710
spelling-check:
811
name: SPELLING check

.github/workflows/ci-contrib.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ on:
1111
schedule:
1212
- cron: "0 0 * * *"
1313

14+
permissions:
15+
contents: read
16+
1417
concurrency:
1518
group: ${{ github.workflow }}-${{ github.event.pull_request.number }} # Ensure that only one instance of this workflow is running per Pull Request
1619
cancel-in-progress: true # Cancel any previous runs of this workflow

.github/workflows/ci-instrumentation-with-services.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ on:
1111
schedule:
1212
- cron: "0 0 * * *"
1313

14+
permissions:
15+
contents: read
16+
1417
concurrency:
1518
group: ${{ github.workflow }}-${{ github.event.pull_request.number }} # Ensure that only one instance of this workflow is running per Pull Request
1619
cancel-in-progress: true # Cancel any previous runs of this workflow

.github/workflows/ci-instrumentation.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ on:
1111
schedule:
1212
- cron: "0 0 * * *"
1313

14+
permissions:
15+
contents: read
16+
1417
concurrency:
1518
group: ${{ github.workflow }}-${{ github.event.pull_request.number }} # Ensure that only one instance of this workflow is running per Pull Request
1619
cancel-in-progress: true # Cancel any previous runs of this workflow

.github/workflows/ci-markdown-link.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,13 @@ on:
55
paths:
66
- '**/*.md'
77

8+
permissions:
9+
contents: read
10+
811
jobs:
912
markdown-link-check:
13+
permissions:
14+
pull-requests: write # required for posting PR review comments
1015
runs-on: ubuntu-latest
1116
steps:
1217
- uses: actions/checkout@v4

.github/workflows/ci-markdownlint.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ name: Markdown Lint Check
33
on:
44
pull_request:
55

6+
permissions:
7+
contents: read
8+
69
jobs:
710
markdownlint-check:
811
runs-on: ubuntu-latest

.github/workflows/conventional-commits.yaml

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

1212
permissions:
1313
contents: read
14-
pull-requests: read
1514

1615
concurrency:
1716
group: ${{ github.workflow }}-${{ github.event.pull_request.number }} # Ensure that only one instance of this workflow is running per Pull Request

.github/workflows/installation-tests.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ on:
99
# Everyday at 2 PM UTC
1010
- cron: "0 14 * * *"
1111

12+
permissions:
13+
contents: read
14+
1215
jobs:
1316
installation-tests:
1417
strategy:

.github/workflows/release-hook-on-closed.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,14 @@ on:
44
pull_request:
55
types: [closed]
66

7+
permissions:
8+
contents: read
9+
710
jobs:
811
release-process-request:
12+
permissions:
13+
contents: write # required for creating releases
14+
pull-requests: write # required for updating release PRs
915
if: ${{ github.repository == 'open-telemetry/opentelemetry-ruby-contrib' }}
1016
env:
1117
ruby_version: "3.1"

.github/workflows/release-hook-on-push.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,14 @@ on:
55
branches:
66
- main
77

8+
permissions:
9+
contents: read
10+
811
jobs:
912
release-update-open-requests:
13+
permissions:
14+
contents: write # required for updating releases
15+
pull-requests: write # required for updating release PRs
1016
if: ${{ github.repository == 'open-telemetry/opentelemetry-ruby-contrib' }}
1117
env:
1218
ruby_version: "3.1"

0 commit comments

Comments
 (0)