v3.0.11 #4
Workflow file for this run
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: Lint and Format | |
on: | |
pull_request: | |
branches: | |
- master | |
jobs: | |
lint-and-prettier: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.head_ref }} | |
- name: Set up Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: "18" | |
- name: Install dependencies | |
run: npm install | |
- name: Run Prettier | |
run: npm run format | |
- name: Commit and push changes back to PR | |
run: | | |
git config --global user.name 'github-actions[bot]' | |
git config --global user.email 'github-actions[bot]@users.noreply.github.com' | |
git add . | |
git diff --quiet || git commit -m "chore: apply lint fixes and prettier formatting" | |
git push origin HEAD:${{ github.head_ref }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |