diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 09dfa08..83e13f0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -28,6 +28,9 @@ jobs: - uses: j178/prek-action@v3.0.0 with: extra-args: --all-files + env: + # Not a real commit -- no-commit-to-branch would always fail here. + SKIP: no-commit-to-branch checks: name: Check Python ${{ matrix.python-version }} on ${{ matrix.runs-on }} diff --git a/noxfile.py b/noxfile.py index aed41d2..328eca2 100644 --- a/noxfile.py +++ b/noxfile.py @@ -1,6 +1,7 @@ """Nox configuration.""" import argparse +import os import shutil from pathlib import Path @@ -17,12 +18,16 @@ def lint(session: nox.Session) -> None: """Run the linter.""" session.install("prek") + # Not a real commit -- no-commit-to-branch would always fail here. + # Merge into any SKIP already set, rather than clobber it. + skip = ",".join(filter(None, [os.environ.get("SKIP"), "no-commit-to-branch"])) session.run( "prek", "run", "--all-files", "--show-diff-on-failure", *session.posargs, + env={"SKIP": skip}, )