diff --git a/.github/workflows/eslint.yml b/.github/workflows/eslint.yml index a8a46f3..05e542e 100644 --- a/.github/workflows/eslint.yml +++ b/.github/workflows/eslint.yml @@ -38,7 +38,21 @@ jobs: - name: Save Code Linting Report JSON run: npm run lint:ci continue-on-error: true + - name: Check if PR is from a fork + id: fork-check + run: | + if [[ ${{ github.event_name }} == 'pull_request' && ${{ github.event.pull_request.head.repo.fork }} == 'true' ]]; then + echo "is_fork=true" >> $GITHUB_STATE + else + echo "is_fork=false" >> $GITHUB_STATE + fi + - name: Run ESLint if PR is from a fork + if: env.is_fork == 'true' + run: npm run lint:ci && npx eslint . + env: + CI: TRUE - name: Annotate Code Linting Results + if: env.is_fork == 'false' uses: ataylorme/eslint-annotate-action@v2 with: only-pr-files: false