Skip to content

Commit 0f2f4c0

Browse files
committed
Set fork condition for the whole job
1 parent 5cc3842 commit 0f2f4c0

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

.github/workflows/pr-workflow-check.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ on:
55

66
jobs:
77
check:
8+
if: ${{ github.event.pull_request.head.repo.fork }}
89
runs-on: ubuntu-latest
910
steps:
1011
- name: Checkout merge commit
@@ -14,7 +15,6 @@ jobs:
1415
fetch-depth: 2
1516

1617
- name: Check changes to .github
17-
if: ${{ github.event.pull_request.head.repo.fork }}
1818
id: check
1919
run: |
2020
echo "==> Changed files:"
@@ -34,7 +34,7 @@ jobs:
3434
fi
3535
3636
- name: Comment PR
37-
if: ${{ always() && github.event.pull_request.head.repo.fork && steps.check.outputs.bad == 'true' }}
37+
if: ${{ always() && steps.check.outputs.bad == 'true' }}
3838
uses: actions/github-script@v7
3939
with:
4040
script: |
@@ -46,7 +46,3 @@ jobs:
4646
> This pull request contains changes to GitHub workflows!
4747
> Proceed with caution and if not sure, contact your GitHub admin.`
4848
})
49-
50-
- if: ${{ !github.event.pull_request.head.repo.fork }}
51-
run: |
52-
echo "Not a PR from fork."

0 commit comments

Comments
 (0)