33 lines
1.0 KiB
YAML
33 lines
1.0 KiB
YAML
name: Lint code using eslint on push
|
|
on:
|
|
push
|
|
jobs:
|
|
run_eslint:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Check out Git repository
|
|
uses: actions/checkout@v6
|
|
with:
|
|
ref: ${{ github.ref }}
|
|
persist-credentials: true
|
|
- name: Cache node modules
|
|
id: cache-npm
|
|
uses: actions/cache@v4
|
|
env:
|
|
cache-name: cache-node-modules
|
|
with:
|
|
path: ~/.npm
|
|
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-build-${{ env.cache-name }}-
|
|
${{ runner.os }}-build-
|
|
${{ runner.os }}-
|
|
- name: Install packages
|
|
run: npm install
|
|
- name: Run eslint
|
|
run: npm run lint-fix
|
|
- name: Push changes back to repository
|
|
uses: stefanzweifel/git-auto-commit-action@v7 # or actions/ for my gitea
|
|
with:
|
|
commit_message: "[skip ci] Eslint ${{ github.event.head_commit.message }}"
|