Skip to content

Commit

Permalink
fix: add automating format after push action
Browse files Browse the repository at this point in the history
  • Loading branch information
Bagusajieiswara committed Dec 20, 2024
1 parent 6cdbc38 commit c844866
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,21 @@ jobs:
# Optionally, you can also run linting if set up in Nx
- name: Run Lint
run: pnpm run lint --if-present


# Format the code
- name: Format Code
run: pnpm format

# Commit and push changes if any files were formatted
- name: Commit and Push Changes
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git add .
if ! git diff-index --quiet HEAD; then
git commit -m "Auto format code"
git push
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit c844866

Please sign in to comment.