Skip to content

Commit 24da778

Browse files
authored
Move permissions to top level of reusable workflow (#242)
1 parent 4ddc15a commit 24da778

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

.github/workflows/tox.yml

+7-9
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,13 @@ on:
5454
description: Command to run after test commands.
5555
required: false
5656
type: string
57-
57+
# keep permissions at top level because this is a composite workflow
58+
permissions:
59+
checks: read
60+
contents: read
61+
id-token: write
62+
packages: write # some tox environments might produce containers
63+
pull-requests: write # allow codenotify to comment on pull-request
5864
env:
5965
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # might be needed by tox commands
6066
FORCE_COLOR: 1 # tox, pytest, ansible-lint
@@ -89,8 +95,6 @@ jobs:
8995
defaults:
9096
run:
9197
shell: ${{ matrix.shell || 'bash'}}
92-
permissions:
93-
packages: write # some tox environments might produce containers
9498
strategy:
9599
fail-fast: false
96100
matrix: ${{ fromJson(needs.prepare.outputs.matrix) }}
@@ -176,12 +180,6 @@ jobs:
176180
check:
177181
if: always()
178182
environment: ${{ inputs.environment }}
179-
permissions:
180-
checks: read
181-
contents: read
182-
id-token: write
183-
pull-requests: write # allow codenotify to comment on pull-request
184-
185183
needs:
186184
- test
187185
runs-on: ubuntu-24.04

0 commit comments

Comments
 (0)