Skip to content

Commit fe781da

Browse files
Split workflow permissions by trigger path
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
1 parent 801abed commit fe781da

1 file changed

Lines changed: 25 additions & 7 deletions

File tree

.github/workflows/Process-PSModule.yml

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,33 @@ concurrency:
1818
group: ${{ github.workflow }}-${{ github.ref }}
1919
cancel-in-progress: true
2020

21-
permissions:
22-
contents: write
23-
pull-requests: write
24-
statuses: write
25-
pages: write
26-
id-token: write
21+
permissions: {}
2722

2823
jobs:
29-
Process-PSModule:
24+
Process-PSModule-PR:
25+
if: github.event_name == 'pull_request' && github.event.action != 'closed'
26+
permissions:
27+
contents: read
28+
pull-requests: write
29+
statuses: write
30+
uses: PSModule/Process-PSModule/.github/workflows/workflow.yml@fb1bdb8fefd243292f779d2a856a38db6fe6daf4 # v6.1.13
31+
with:
32+
ImportantFilePatterns: |
33+
^src/
34+
^tests/
35+
^README\.md$
36+
secrets:
37+
APIKey: ${{ secrets.APIKey }}
38+
TestData: ${{ secrets.TestData }}
39+
40+
Process-PSModule-Release:
41+
if: github.event_name != 'pull_request' || github.event.action == 'closed'
42+
permissions:
43+
contents: write
44+
pull-requests: write
45+
statuses: write
46+
pages: write
47+
id-token: write
3048
uses: PSModule/Process-PSModule/.github/workflows/workflow.yml@fb1bdb8fefd243292f779d2a856a38db6fe6daf4 # v6.1.13
3149
with:
3250
ImportantFilePatterns: |

0 commit comments

Comments
 (0)