Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,14 @@ jobs:
strategy:
fail-fast: false
matrix:
# The floor and the newest. 3.10 is the real floor: main.py annotates
# with `str | None` and has no `from __future__ import annotations`, so
# the annotation is evaluated at def time, and main_test.py uses
# parenthesized context managers. Both are 3.10+.
# The floor and the newest. 3.11 is the real floor: the pinned
# commit-check (2.20.0 and later) requires it, and the action refuses
# an older python3 before installing anything.
#
# The action itself runs on whatever python3 the runner ships, so the
# in-between versions add little here — unlike commit-check, which is a
# published package and tests every one.
py: ['3.10', '3.14']
py: ['3.11', '3.14']
os: ['ubuntu-latest', 'macos-latest', 'windows-latest']
runs-on: ${{ matrix.os }}
steps:
Expand Down Expand Up @@ -54,8 +53,8 @@ jobs:
persist-credentials: false
- uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
with:
# 3.10 is the real floor, see the test job
python-version: "3.10"
# 3.11 is the real floor, see the test job
python-version: "3.11"
- name: Install dependencies
run: |
pip install -r requirements.txt
Expand Down
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -256,8 +256,10 @@ fails when a contributor did not install the hook.

The action is a composite step and uses what the runner already has:

- **Python 3.10 or newer** on `PATH` (`python3`, or `python` on Windows). No
`setup-python` step is needed on GitHub-hosted runners. Everything the action
- **Python 3.11 or newer** on `PATH` (`python3`, or `python` on Windows). The
`*-latest` GitHub-hosted runners already have it. `ubuntu-22.04` ships 3.10,
so add `actions/setup-python` with `python-version: "3.11"` (or newer) before
this step there. Everything the action
installs goes under `$RUNNER_TEMP`, never into your checkout.
- **`gh` CLI** — used to verify the build-provenance attestation of the
`commit-check` wheel before installing it. Present on GitHub-hosted images;
Expand Down
7 changes: 7 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,13 @@ runs:
PYTHON_CMD="python3"
fi

# The pinned commit-check needs Python 3.11+. Say so here: on an older
# python3, pip would only report that no matching version exists.
if ! $PYTHON_CMD -c 'import sys; sys.exit(sys.version_info < (3, 11))'; then
echo "::error::commit-check-action needs Python 3.11 or newer on PATH, found $($PYTHON_CMD --version 2>&1). Add actions/setup-python with python-version 3.11 or newer before this step."
exit 1
fi

# Everything the action installs lives under $RUNNER_TEMP, never in the
# caller's checkout: a later `git status`, linter or upload-artifact step
# must not see our venv or wheels.
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Install commit-check CLI
# For details please see: https://github.com/commit-check/commit-check
commit-check==2.19.5
commit-check==2.20.0
# Interact with the GitHub API.
PyGithub==2.10.0
Loading