Improve eslint template with caching
This commit is contained in:
@@ -9,6 +9,19 @@ jobs:
|
|||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v6
|
||||||
with:
|
with:
|
||||||
ref: ${{ github.ref }}
|
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
|
- name: Install packages
|
||||||
run: npm install
|
run: npm install
|
||||||
- name: Run eslint
|
- name: Run eslint
|
||||||
@@ -16,4 +29,4 @@ jobs:
|
|||||||
- name: Push changes back to repository
|
- name: Push changes back to repository
|
||||||
uses: stefanzweifel/git-auto-commit-action@v7 # or actions/ for my gitea
|
uses: stefanzweifel/git-auto-commit-action@v7 # or actions/ for my gitea
|
||||||
with:
|
with:
|
||||||
commit_message: "[skip ci] Run Eslint on push"
|
commit_message: "[skip ci] Eslint ${{ github.event.head_commit.message }}"
|
||||||
|
|||||||
Reference in New Issue
Block a user