-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3a7c4a5
commit ab49cb0
Showing
1 changed file
with
45 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |