Skip to content

Commit 80c40f6

Browse files
authored
Update pr-merge.yaml
try and fix permissions issue of missing secret on PRs
1 parent f442d58 commit 80c40f6

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

.github/workflows/pr-merge.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,25 @@
88
notify:
99
runs-on: ubuntu-latest
1010
steps:
11+
- name: Get User Permission
12+
id: checkAccess
13+
uses: actions-cool/check-user-permission@v2
14+
with:
15+
require: write
16+
username: ${{ github.triggering_actor }}
17+
env:
18+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
19+
- name: Check User Permission
20+
if: steps.checkAccess.outputs.require-result == 'false'
21+
run: |
22+
echo "${{ github.triggering_actor }} does not have permissions on this repo."
23+
echo "Current permission level is ${{ steps.checkAccess.outputs.user-permission }}"
24+
echo "Job originally triggered by ${{ github.actor }}"
25+
exit 1
26+
- name: Checkout code
27+
uses: actions/checkout@v3
28+
with:
29+
ref: ${{ github.event.pull_request.head.sha }} # This is dangerous without the first access check
1130
- name: Send Discord notification
1231
shell: bash
1332
env:

0 commit comments

Comments
 (0)