Skip to content

Commit

Permalink
Run eslint conditionally
Browse files Browse the repository at this point in the history
  • Loading branch information
mikejolley committed Jul 27, 2021
1 parent 012999e commit 12a609f
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 23 deletions.
19 changes: 0 additions & 19 deletions .github/workflows/eslint-report.yml

This file was deleted.

28 changes: 24 additions & 4 deletions .github/workflows/linting.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
name: Linting
name: JavaScript and CSS Linting
on:
pull_request:
push:
branches: [trunk]
jobs:
Setup:
name: Setup Caches
name: Setup for Jobs
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Cache node modules
Expand Down Expand Up @@ -38,9 +39,28 @@ jobs:
${{ runner.OS }}-
- name: Install Node Dependencies
run: npm install
- uses: bradennapier/[email protected]
- if: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository }}
name: Run ESLint
run: npm run lint:js
- if: ${{ github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository }}
name: Save Code Linting Report JSON
run: npm run lint:js:report
# Continue to the next step even if this fails
continue-on-error: true
- if: ${{ github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository }}
name: Upload ESLint report
uses: actions/upload-artifact@v2
with:
name: eslint_report.json
path: eslint_report.json
- if: ${{ github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository }}
name: Annotate Code Linting Results
uses: ataylorme/[email protected]
with:
repo-token: '${{ secrets.GITHUB_TOKEN }}'
report-json: 'eslint_report.json'

csslint:
stylelint:
name: Lint CSS
needs: Setup
runs-on: ubuntu-latest
Expand Down

0 comments on commit 12a609f

Please sign in to comment.