Skip to content

[pre-commit.ci] pre-commit suggestions #179

[pre-commit.ci] pre-commit suggestions

[pre-commit.ci] pre-commit suggestions #179

Workflow file for this run

name: Code formatting
# see: https://help.github.com/en/actions/reference/events-that-trigger-workflows
on: # Trigger the workflow on push or pull request, but only for the main branch
push:
branches: [main]
pull_request: {}
defaults:
run:
shell: bash
jobs:
pre-commit-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# for private repo - first is the checkout step, which needs to use unlimited fetch depth for pushing
#with:
# fetch-depth: 0
- uses: actions/setup-python@v5
- name: set PY
run: echo "PY=$(python -VV | sha256sum | cut -d' ' -f1)" >> $GITHUB_ENV
- uses: actions/cache@v4
with:
path: ~/.cache/pre-commit
key: pre-commit|${{ env.PY }}|${{ hashFiles('.pre-commit-config.yaml') }}
- uses: pre-commit/action@v3.0.1
# this action also provides an additional behaviour when used in private repositories
# when configured with a GitHub token, the action will push back fixes to the pull request branch
#with:
# token: ${{ secrets.GITHUB_TOKEN }}