Skip to content

v3.0.11

v3.0.11 #5

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 }}