Skip to content

fix codestyle basedon eslint #11

fix codestyle basedon eslint

fix codestyle basedon eslint #11

Workflow file for this run

name: Lint
on:
push:
branches:
- master
pull_request:
permissions:
checks: write
contents: write
jobs:
run-linters:
name: Run linters
runs-on: ubuntu-latest
steps:
- name: Check out Git repository
uses: actions/checkout@v3
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install dependencies
run: npm install
- name: Run linters
run: |
./node_modules/.bin/eslint --ext .js,.vue src --fix
- name: Check if fixes were made
id: check-fixes
run: echo "::set-output name=has_fixes::$(git status --porcelain | grep -E '^(M| M)' | wc -l)"
- name: Commit changes (if fixes were made)
if: steps.check-fixes.outputs.has_fixes > 0
uses: EndBug/add-and-commit@v9
with:
author_name: Lint Bot
message: 'Run linters'