From 0126959ac576491135a45011cae7f85c2859b3c1 Mon Sep 17 00:00:00 2001 From: Westbrook Johnson Date: Wed, 6 Aug 2025 08:48:13 -0400 Subject: [PATCH] Skip preview job on forks --- .github/workflows/test.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1925efcbed..2bca9ece70 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -22,14 +22,16 @@ jobs: - run: npm test - name: Deploy Preview - if: ${{github.event_name == 'pull_request' && !(github.actor == 'dependabot[bot]' || github.actor == 'renovate[bot]')}} + # Only run this job if the repository is NOT a fork and the actor is not dependabot or renovate + if: ${{ github.event.pull_request.head.repo.full_name == github.repository && !(github.actor == 'dependabot[bot]' || github.actor == 'renovate[bot]') }} uses: JamesIves/github-pages-deploy-action@v4.4.3 with: branch: gh-pages folder: out target-folder: preview/preview/preview/${{github.event.number}} - name: Comment about preview - if: ${{github.event_name == 'pull_request' && !(github.actor == 'dependabot[bot]' || github.actor == 'renovate[bot]')}} + # Only run this job if the repository is NOT a fork and the actor is not dependabot or renovate + if: ${{ github.event.pull_request.head.repo.full_name == github.repository && !(github.actor == 'dependabot[bot]' || github.actor == 'renovate[bot]') }} uses: marocchino/sticky-pull-request-comment@v2 with: message: |