diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml new file mode 100644 index 0000000..51e8052 --- /dev/null +++ b/.github/workflows/pre-commit.yml @@ -0,0 +1,32 @@ +name: pre-commit + +on: + push: + branches: + - main + pull_request: + branches: + - main + +permissions: + contents: read + +jobs: + pre-commit: + name: "pre-commit" + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + persist-credentials: false + - uses: actions/setup-python@v4 + - name: pre-commit (cache) + uses: actions/cache@v3 + with: + path: ~/.cache/pre-commit + key: pre-commit-${{ hashFiles('.pre-commit-config.yaml') }} + - name: pre-commit (--all-files) + run: | + python -m pip install pre-commit + pre-commit run --show-diff-on-failure --color=always --all-files diff --git a/.github/workflows/verify.yml b/.github/workflows/verify.yml index 5f758b8..fee30c0 100644 --- a/.github/workflows/verify.yml +++ b/.github/workflows/verify.yml @@ -1,3 +1,5 @@ +name: verify + on: push: branches: @@ -6,7 +8,8 @@ on: branches: - main -name: Verify +permissions: + contents: read jobs: verify: