Skip to content

Commit

Permalink
Fix ESLint Fork Setup
Browse files Browse the repository at this point in the history
Signed-off-by: Paul Schmiedmayer <[email protected]>
  • Loading branch information
PSchmiedmayer authored May 29, 2024
1 parent f34d1e5 commit 4cb6eaa
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/eslint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4cb6eaa

Please sign in to comment.