Skip to content

Further dev setup

Further dev setup #6

name: Prettier Eslint
on:
push:
branches: [main]
pull_request:
types: [opened, synchronize]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
jobs:
lint-and-prettier:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 9
- name: Setup node
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Run ESLint
run: pnpm run lint
- name: Prettier write
run: pnpm run prettier --write .
- uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: 'style fixes by prettier'
commit_options: '--no-verify'
- name: Lint fix
run: pnpm run lint --quiet --fix
- uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: 'style fixes by eslint'
commit_options: '--no-verify'