diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml new file mode 100644 index 00000000..0d340b26 --- /dev/null +++ b/.github/workflows/format.yml @@ -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)" diff --git a/.vscode/settings.json b/.vscode/settings.json index f8b0fb32..9455e9b6 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -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",