This repository has been archived by the owner on Sep 23, 2023. It is now read-only.
Update format.yml #6
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 Code | |
on: | |
push: | |
branches: | |
- main # Change this to your main branch name | |
pull_request: | |
branches: | |
- main # Change this to your main branch name | |
jobs: | |
format: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Install dependencies | |
run: yarn install --frozen-lockfile | |
- name: Format code | |
run: yarn format | |
- name: Commit formatted code | |
run: | | |
git config --local user.email "actions@github.com" | |
git config --local user.name "GitHub Actions" | |
git add . | |
git diff --quiet && git diff --staged --quiet || git commit -m "Format code with Prettier" | |
git push |