Skip to content

Update dependencies #605

Update dependencies

Update dependencies #605

Workflow file for this run

name: Auto formatter
on:
push:
branches-ignore:
- main
- gh-readonly-queue/main/**
jobs:
fixes:
name: Code fixes
runs-on: ubuntu-latest
# Circuit breaker: Avoid a hayewire bot infinitely committing changes if something goes wrong
if: ${{ github.event.head_commit.message != '[Bot] Code fixes' }}
steps:
- uses: actions/checkout@v4
with:
# This makes git push to work and other workflows to run
token: ${{ secrets.GIT_TOKEN }}
- uses: ./.github/shared
- name: Format changed files
continue-on-error: true
env:
GITHUB_TOKEN: ${{ secrets.GIT_TOKEN }}
run: |
# Check for changed files in the PR and fallback to previous commit if direct push
CHANGED_FILES=$(gh pr diff --name-only 2> /dev/null || git diff --name-only HEAD^ HEAD)
echo "Changed Files:"
echo $CHANGED_FILES
if [ -n "$CHANGED_FILES" ]; then
pnpm exec prettier --write $CHANGED_FILES || true
pnpm generate
fi
- name: Commit files
continue-on-error: true
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git commit -a -m "[Bot] Code fixes"
- name: Push changes
run: git push