Skip to content

Commit 2836f66

Browse files
committed
fix: correct behavior when running on push to main, do not run on merged PRs
Signed-off-by: Taylor Price <[email protected]>
1 parent 9acc7fe commit 2836f66

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

.github/workflows/test.yaml

+4-9
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,9 @@ on:
1818

1919
jobs:
2020
check-perms:
21+
if: ${{ !github.event.pull_request.merged }}
2122
runs-on: ubuntu-latest
2223
steps:
23-
- uses: agilepathway/[email protected]
24-
id: label_check
25-
with:
26-
any_of: run_ci
27-
repo_token: ${{ secrets.GITHUB_TOKEN }}
28-
allow_failure: true
2924
- name: Get User Permission
3025
id: checkAccess
3126
uses: actions-cool/check-user-permission@v2
@@ -35,7 +30,7 @@ jobs:
3530
env:
3631
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3732
- name: Check User Permission
38-
if: steps.checkAccess.outputs.require-result == 'false' || steps.label_check.outputs.label_check != 'success'
33+
if: steps.checkAccess.outputs.require-result == 'false'
3934
run: |
4035
echo "${{ github.triggering_actor }} does not have permissions on this repo."
4136
echo "Current permission level is ${{ steps.checkAccess.outputs.user-permission }}"
@@ -49,7 +44,7 @@ jobs:
4944
- uses: actions/checkout@v4
5045
with:
5146
fetch-depth: 1
52-
ref: ${{ github.event.pull_request.head.sha }}
47+
ref: ${{ github.event_name == 'pull_request_target' && github.event.pull_request.head.sha || '' }}
5348
- uses: actions/setup-go@v5
5449
with:
5550
cache: false
@@ -73,7 +68,7 @@ jobs:
7368
- uses: actions/checkout@v4
7469
with:
7570
fetch-depth: 1
76-
ref: ${{ github.event.pull_request.head.sha }}
71+
ref: ${{ github.event_name == 'pull_request_target' && github.event.pull_request.head.sha || '' }}
7772
- uses: actions/setup-go@v5
7873
with:
7974
cache: false

0 commit comments

Comments
 (0)