Skip to content

Commit d0ffe4d

Browse files
authored
Skip preview job on forks (#2497)
1 parent 1b3522c commit d0ffe4d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

.github/workflows/test.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,16 @@ jobs:
2222
- run: npm test
2323

2424
- name: Deploy Preview
25-
if: ${{github.event_name == 'pull_request' && !(github.actor == 'dependabot[bot]' || github.actor == 'renovate[bot]')}}
25+
# Only run this job if the repository is NOT a fork and the actor is not dependabot or renovate
26+
if: ${{ github.event.pull_request.head.repo.full_name == github.repository && !(github.actor == 'dependabot[bot]' || github.actor == 'renovate[bot]') }}
2627
uses: JamesIves/[email protected]
2728
with:
2829
branch: gh-pages
2930
folder: out
3031
target-folder: preview/preview/preview/${{github.event.number}}
3132
- name: Comment about preview
32-
if: ${{github.event_name == 'pull_request' && !(github.actor == 'dependabot[bot]' || github.actor == 'renovate[bot]')}}
33+
# Only run this job if the repository is NOT a fork and the actor is not dependabot or renovate
34+
if: ${{ github.event.pull_request.head.repo.full_name == github.repository && !(github.actor == 'dependabot[bot]' || github.actor == 'renovate[bot]') }}
3335
uses: marocchino/sticky-pull-request-comment@v2
3436
with:
3537
message: |

0 commit comments

Comments
 (0)