chore: use node LTS in prettier workflow (#6) #19
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: prettier | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
format: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Use Node LTS | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 'lts/*' | |
- name: Run Prettier | |
run: | | |
npx prettier --write **/* | |
shell: bash | |
- name: Commit and push changes | |
run: | | |
git config --local user.email "[email protected]" | |
git config --local user.name "GitHub Action" | |
git diff --quiet || (git commit -a -m "chore(prettier): format code" && git push) | |
shell: bash |