merge 'dev' branch into 'main' #10
This file contains 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: Format | |
on: | |
push: | |
branches: [dev] | |
pull_request: | |
branches: [main, dev] | |
jobs: | |
format: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
persist-credentials: true | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: lts/* | |
- name: Install pnpm | |
uses: pnpm/action-setup@v3 | |
with: | |
version: latest | |
- name: Install dependencies | |
run: pnpm install | |
- name: Format code | |
run: pnpm run format | |
- name: Commit formatted files | |
run: | | |
git config --local user.email "[email protected]" | |
git config --local user.name "GitHub Action" | |
# Exclude .github/workflows from being staged | |
git add -- ':!.github/workflows/*' | |
git commit -m "style: format code" || echo "No changes to commit" | |
- name: Push changes | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: git push |