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
16 changes: 14 additions & 2 deletions .github/workflows/prek-autoupdate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,21 @@ jobs:
- name: Install the project
run: uv sync

# The diff makes runs self-documenting: when no hooks changed the next
# step is a no-op ("Branch ... is not ahead of base") and the log would
# otherwise give no indication of why no pull request was opened.
- name: Run prek autoupdate
run: uv run prek autoupdate

run: |
uv run prek autoupdate
git --no-pager diff -- .pre-commit-config.yaml

# Requires "Allow GitHub Actions to create and approve pull requests"
# under Settings > Actions > General (and the same setting at the org
# level, if the repo belongs to one). Without it this step fails with
# "GitHub Actions is not permitted to create or approve pull requests".
# Note that pull requests opened with the default GITHUB_TOKEN do not
# trigger other workflows; pass `token:` a PAT if the autoupdate PR
# should run the tests and prek workflows.
- name: Open a pull request
uses: peter-evans/create-pull-request@v8
with:
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ on:
permissions:
contents: read

env:
# Force uv to install a managed interpreter rather than reusing the runner's
# preinstalled system Python. Without this there is nothing for
# `cache-python` to save and the cache step warns and no-ops.
UV_PYTHON_PREFERENCE: only-managed

jobs:
tests:
timeout-minutes: 10
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ repos:
# Cognitive-complexity gate. Complements Ruff (whose overlapping complexity
# rules are disabled in pyproject.toml).
- repo: https://github.com/rohaquinlop/complexipy-pre-commit
rev: v5.1.0
rev: v6.1.0
hooks:
- id: complexipy

Expand Down