Allow manual format workflow #4
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Auto Format | |
| on: | |
| push: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| jobs: | |
| format: | |
| if: github.actor != 'github-actions[bot]' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: 20 | |
| cache: npm | |
| - run: npm ci | |
| - name: Prettier | |
| run: npx --yes prettier --write "**/*.{md,json,yml,yaml,ts,mts}" | |
| - name: Stylua | |
| uses: JohnnyMorganz/stylua-action@v4 | |
| with: | |
| version: latest | |
| args: src spec types | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Commit changes | |
| uses: stefanzweifel/git-auto-commit-action@v5 | |
| with: | |
| commit_message: "chore: auto format" | |
| branch: main | |
| commit_user_name: github-actions[bot] | |
| commit_user_email: 41898282+github-actions[bot]@users.noreply.github.com |