Skip to content

Commit

Permalink
chore: add format workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
ota-meshi committed Dec 11, 2023
1 parent 375c7fc commit 3f6078c
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 2 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: 👔 Format

on:
workflow_dispatch: null

jobs:
format:
runs-on: ubuntu-latest

steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Setup node
uses: actions/setup-node@v4
- name: Install deps
run: npm install
- name: Format
run: npm run eslint-fix
- name: Commit
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add .
if [ -z "$(git status --porcelain)" ]; then
echo "no formatting changed"
exit 0
fi
git commit -m "chore: format"
git push
echo "pushed formatting changes https://github.com/$GITHUB_REPOSITORY/commit/$(git rev-parse HEAD)"
4 changes: 2 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
"css.validate": false,
"typescript.tsdk": "node_modules/typescript/lib",
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true,
"source.fixAll.stylelint": true
"source.fixAll.eslint": "explicit",
"source.fixAll.stylelint": "explicit"
},
"stylelint.validate": [
"css",
Expand Down

0 comments on commit 3f6078c

Please sign in to comment.