Fix: handle null before_script without throwing AttributeError (#175) #48
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
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| name: pre-commit | |
| jobs: | |
| pre-commit: | |
| permissions: | |
| # Give the default GITHUB_TOKEN write permission to commit and push the | |
| # added or changed files to the repository. | |
| contents: write | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| ref: ${{ github.head_ref }} | |
| - uses: j178/prek-action@v2 | |
| with: | |
| # only run the pre-commit config in the project root, not in templates | |
| extra-args: "--all-files --config ./.pre-commit-config.yaml" | |
| - uses: stefanzweifel/git-auto-commit-action@v5 | |
| if: "!cancelled()" | |
| with: | |
| commit_message: pre-commit autofixes |