Skip to content

Commit

Permalink
fix: eslint (#3213)
Browse files Browse the repository at this point in the history
  • Loading branch information
guanbinrui authored Nov 18, 2024
1 parent 3a7c4a5 commit ab49cb0
Showing 1 changed file with 45 additions and 39 deletions.
84 changes: 45 additions & 39 deletions .github/workflows/eslint.yml
Original file line number Diff line number Diff line change
@@ -1,44 +1,50 @@
name: ESLint

on:
push:
branches:
- '**'
- '!main'
- '!released'
workflow_dispatch:
push:
branches:
- '**'
- '!main'
- '!released'
workflow_dispatch:

jobs:
eslint:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2
with:
submodules: 'true'

- name: Authenticate NPM
uses: DimensionDev/github-token-action@latest
with:
registry: true

- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version-file: '.node-version'

- uses: pnpm/action-setup@v4
- name: Install dependencies
run: pnpm install

- name: Run ESLint
run: npx eslint --fix .

- name: Commit and Push changes
run: |
git add src/
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git commit -m "chore: format code with Eslint [bot]"
git push origin
eslint:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2
with:
submodules: 'true'

- name: Authenticate NPM
uses: DimensionDev/github-token-action@latest
with:
registry: true

- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version-file: '.node-version'

- uses: pnpm/action-setup@v4

- name: Install dependencies
run: pnpm install

- name: Run ESLint
run: |
npx eslint --fix . || echo "ESLint completed with warnings"
- name: Check if changes were made
run: |
git diff --quiet || git add src/
- name: Commit and Push changes
if: ${{ steps.Check if changes were made.outcome != 'success' }}
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git commit -m "chore: format code with ESLint [bot]"
git push origin

0 comments on commit ab49cb0

Please sign in to comment.