Skip to content

Commit

Permalink
Update GitHub Action
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 0a3572c commit 29054a7
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions .github/workflows/eslint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ permissions:
jobs:
eslint:
runs-on: ubuntu-latest
env:
CI: TRUE
steps:
- uses: actions/checkout@v4
- name: Setup Node
Expand All @@ -33,27 +35,23 @@ jobs:
cache: 'npm'
- name: Install Node Dependencies
run: npm ci
env:
CI: TRUE
- 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
echo "is_fork=true" >> $GITHUB_ENV
else
echo "is_fork=false" >> $GITHUB_STATE
echo "is_fork=false" >> $GITHUB_ENV
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
if: ${{ env.is_fork == 'true' }}
run: npm run lint:ci
- name: Annotate Code Linting Results
if: env.is_fork == 'false'
uses: ataylorme/eslint-annotate-action@v2
if: ${{ env.is_fork == 'false' }}
uses: ataylorme/eslint-annotate-action@v3
with:
only-pr-files: false
fail-on-warning: true
Expand Down

0 comments on commit 29054a7

Please sign in to comment.