Skip to content

Commit 15971c8

Browse files
authored
rerun on fork simplification (#45)
* doc: comment that job changes only take affect when merged to main
1 parent e0ad9e4 commit 15971c8

File tree

1 file changed

+11
-15
lines changed

1 file changed

+11
-15
lines changed

.github/workflows/checkmarx.yaml

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,14 @@ permissions:
88
security-events: write # to upload the scan results
99

1010
on:
11+
# pull_request_target allows secrets to be read from fork PRs.
12+
# DO NOT build or run checked out code from this job.
13+
#
14+
# Please note: Due to how this job is run, any changes to this
15+
# job will only take affect when merged to main.
16+
#
17+
# From https://michaelheap.com/access-secrets-from-forks/
18+
# Also see https://securitylab.github.com/resources/github-actions-preventing-pwn-requests/
1119
pull_request_target:
1220
types: [opened, synchronize, reopened]
1321
push:
@@ -26,22 +34,10 @@ jobs:
2634
runs-on: ubuntu-latest
2735

2836
steps:
29-
# From https://michaelheap.com/access-secrets-from-forks/
30-
# Also see https://securitylab.github.com/resources/github-actions-preventing-pwn-requests/
31-
- name: Get User Permission
32-
id: checkAccess
33-
uses: actions-cool/check-user-permission@7b90a27f92f3961b368376107661682c441f6103 #v2
34-
with:
35-
require: write
36-
username: ${{ github.triggering_actor }}
37-
env:
38-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
39-
- name: Check User Permission
40-
if: steps.checkAccess.outputs.require-result == 'false'
37+
- name: Check access
38+
if: ${{ github.event.pull_request.author_association != 'COLLABORATOR' && github.event.pull_request.author_association != 'OWNER' }}
4139
run: |
42-
echo "${{ github.triggering_actor }} does not have permissions on this repo."
43-
echo "Current permission level is ${{ steps.checkAccess.outputs.user-permission }}"
44-
echo "Job originally triggered by ${{ github.actor }}"
40+
echo "This job needs re-running by someone with collaboration permissions."
4541
exit 1
4642
4743
# This is dangerous without the first access check

0 commit comments

Comments
 (0)