Add Auto-format action (#33)
This commit is contained in:
parent
c7b03776ee
commit
7def0463b1
3 changed files with 45 additions and 18 deletions
28
.github/workflows/format.yml
vendored
Normal file
28
.github/workflows/format.yml
vendored
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
name: 'Format Code'
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
|
||||||
|
env:
|
||||||
|
node_version: 14
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
format:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
ref: ${{ github.head_ref }}
|
||||||
|
- uses: actions/setup-node@v1
|
||||||
|
with:
|
||||||
|
node-version: ${{ env.node_version }}
|
||||||
|
- run: npm ci
|
||||||
|
- run: npm run format
|
||||||
|
- name: Commit changes
|
||||||
|
uses: stefanzweifel/git-auto-commit-action@v4
|
||||||
|
with:
|
||||||
|
commit_message: '[ci] npm run format'
|
||||||
|
branch: ${{ github.head_ref }}
|
||||||
|
push_options: --force
|
3
.github/workflows/nodejs.yml
vendored
3
.github/workflows/nodejs.yml
vendored
|
@ -3,8 +3,7 @@ name: Node CI
|
||||||
on: [push]
|
on: [push]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
test:
|
||||||
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
"build": "tsc",
|
"build": "tsc",
|
||||||
"dev": "tsc --watch",
|
"dev": "tsc --watch",
|
||||||
"lint": "eslint 'src/**/*.{js,ts}'",
|
"lint": "eslint 'src/**/*.{js,ts}'",
|
||||||
"format": "prettier -w 'src/**/*.{js,ts}'",
|
"format": "prettier -w '{src,test}/**/*.{js,ts}'",
|
||||||
"test": "uvu test -i fixtures -i test-utils.js",
|
"test": "uvu test -i fixtures -i test-utils.js",
|
||||||
"watch:extension": "cd vscode && npm run watch"
|
"watch:extension": "cd vscode && npm run watch"
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue