Skip to content

Commit 3f6078c

Browse files
committed
chore: add format workflow
1 parent 375c7fc commit 3f6078c

File tree

2 files changed

+33
-2
lines changed

2 files changed

+33
-2
lines changed

.github/workflows/format.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: 👔 Format
2+
3+
on:
4+
workflow_dispatch: null
5+
6+
jobs:
7+
format:
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- name: Checkout repo
12+
uses: actions/checkout@v4
13+
- name: Setup node
14+
uses: actions/setup-node@v4
15+
- name: Install deps
16+
run: npm install
17+
- name: Format
18+
run: npm run eslint-fix
19+
- name: Commit
20+
run: |
21+
git config --local user.email "github-actions[bot]@users.noreply.github.com"
22+
git config --local user.name "github-actions[bot]"
23+
24+
git add .
25+
if [ -z "$(git status --porcelain)" ]; then
26+
echo "no formatting changed"
27+
exit 0
28+
fi
29+
git commit -m "chore: format"
30+
git push
31+
echo "pushed formatting changes https://github.com/$GITHUB_REPOSITORY/commit/$(git rev-parse HEAD)"

.vscode/settings.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
"css.validate": false,
1717
"typescript.tsdk": "node_modules/typescript/lib",
1818
"editor.codeActionsOnSave": {
19-
"source.fixAll.eslint": true,
20-
"source.fixAll.stylelint": true
19+
"source.fixAll.eslint": "explicit",
20+
"source.fixAll.stylelint": "explicit"
2121
},
2222
"stylelint.validate": [
2323
"css",

0 commit comments

Comments
 (0)