@@ -4,7 +4,8 @@ name: Tests
44# This GitHub action runs your tests for each pull request and push.
55# Optionally, you can turn it on using a schedule for regular testing.
66on :
7- pull_request :
7+ pull_request_target :
8+ types : [opened, synchronize]
89 paths-ignore :
910 - " README.md"
1011 push :
2223 runs-on : ubuntu-latest
2324 timeout-minutes : 5
2425 steps :
26+ - id : check-access
27+ uses : actions-cool/check-user-permission@v2
28+ with :
29+ require : write
30+ username : ${{ github.triggering_actor }}
31+ - name : Check User Permission
32+ if : steps.check-access.outputs.require-result != 'false'
33+ run : |
34+ echo "User ${{ github.triggering_actor }} lacks the necessary rights on this repository."
35+ echo "Their current access level: ${{ steps.checkAccess.outputs.user-permission }}"
36+ echo "Initial trigger for this job: ${{ github.actor }}"
37+ exit 1
2538 - uses : actions/checkout@v5
39+ with :
40+ ref : ${{ github.event.pull_request.head.sha || github.sha }}
2641 - uses : actions/setup-go@v6
2742 with :
2843 go-version-file : " go.mod"
3752 generate :
3853 runs-on : ubuntu-latest
3954 steps :
55+ - id : check-access
56+ uses : actions-cool/check-user-permission@v2
57+ with :
58+ require : write
59+ username : ${{ github.triggering_actor }}
60+ - name : Check User Permission
61+ if : steps.check-access.outputs.require-result != 'false'
62+ run : |
63+ echo "User ${{ github.triggering_actor }} lacks the necessary rights on this repository."
64+ echo "Their current access level: ${{ steps.checkAccess.outputs.user-permission }}"
65+ echo "Initial trigger for this job: ${{ github.actor }}"
66+ exit 1
4067 - uses : actions/checkout@v5
68+ with :
69+ ref : ${{ github.event.pull_request.head.sha || github.sha }}
4170 - uses : actions/setup-go@v6
4271 with :
4372 go-version-file : " go.mod"
6594 terraform :
6695 - " 1.13.*"
6796 steps :
97+ - id : check-access
98+ uses : actions-cool/check-user-permission@v2
99+ with :
100+ require : write
101+ username : ${{ github.triggering_actor }}
102+ - name : Check User Permission
103+ if : steps.check-access.outputs.require-result != 'false'
104+ run : |
105+ echo "User ${{ github.triggering_actor }} lacks the necessary rights on this repository."
106+ echo "Their current access level: ${{ steps.checkAccess.outputs.user-permission }}"
107+ echo "Initial trigger for this job: ${{ github.actor }}"
108+ exit 1
68109 - uses : actions/checkout@v5
110+ with :
111+ ref : ${{ github.event.pull_request.head.sha || github.sha }}
69112 - uses : actions/setup-go@v6
70113 with :
71114 go-version-file : " go.mod"
0 commit comments