Last active
December 25, 2024 15:17
-
-
Save raxityo/9954205d741def1ade2c0aa880b7847b to your computer and use it in GitHub Desktop.
This file contains hidden or 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
# GitHub Action that will run prettier on the whole repo and commit the changes to the PR. | |
name: Prettier | |
on: | |
pull_request: | |
branches: [main] | |
jobs: | |
prettier: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.head_ref }} | |
- name: Setup Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 21 | |
cache: npm | |
- name: Install dependencies | |
run: npm ci | |
- name: Run Prettier | |
run: npx prettier --write . | |
- name: Commit changes | |
uses: stefanzweifel/git-auto-commit-action@v4 | |
with: | |
commit_message: "chore:prettier" | |
branch: ${{ github.head_ref }} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment