Drifter patch precommit #5
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: pre-commit | |
on: | |
pull_request: | |
push: | |
branches: [main] | |
jobs: | |
pre-commit: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-python@v3 | |
- uses: actions/setup-python@v3 | |
- name: Install pre-commit | |
run: | | |
pip install pre-commit | |
- name: Run pre-commit on changed files | |
run: | | |
BASE_REF=$(git merge-base origin/main HEAD) | |
pre-commit run --from-ref $BASE_REF --to-ref HEAD | |
- name: Commit Prettier changes | |
uses: stefanzweifel/git-auto-commit-action@v4 | |
with: | |
commit_message: Apply formatting changes | |
branch: ${{ github.head_ref }} # Push changes back to the current branch |