diff --git a/.github/workflows/pr-validation.yml b/.github/workflows/pr-validation.yml index 20be5d14..9d78f55e 100644 --- a/.github/workflows/pr-validation.yml +++ b/.github/workflows/pr-validation.yml @@ -5,16 +5,20 @@ on: jobs: task-check: - # github.event.repository.name only contains 'GildedRose-Refactoring-Kata' (no owner)! - # we could check owner and name if: github.repository == 'emilybache/GildedRose-Refactoring-Kata' - # but checking owner is enough/better/more stable - # Only run from the base repository - if: ${{ github.repository_owner == 'emilybache' || env.FORK_TESTING == 'true' }} runs-on: ubuntu-latest permissions: issues: write pull-requests: write steps: + # github.event.repository.name only contains 'GildedRose-Refactoring-Kata' (no owner)! + # we could check owner and name if: github.repository == 'emilybache/GildedRose-Refactoring-Kata' + # but checking owner is enough/better/more stable + # Only run from the base repository + - name: Skip if not main repo or fork testing + if: ${{ github.repository_owner != 'emilybache' && env.PR_TESTING != 'true' }} + run: | + echo "Skipping workflow on fork without PR_TESTING" + exit 0 - name: Comment if checkmark is missing if: ${{ !contains(github.event.pull_request.body, '[X] I acknowledge') }} uses: actions/github-script@v6