From 380c69e7d1fb8869d43b6c72f4ab091795aa46d4 Mon Sep 17 00:00:00 2001 From: Greg Pauloski <18683347+gpauloski@users.noreply.github.com> Date: Mon, 20 Jul 2026 20:50:23 -0700 Subject: [PATCH] Fix github actions --- .github/workflows/prek-autoupdate.yml | 16 ++++++++++++++-- .github/workflows/tests.yml | 6 ++++++ .pre-commit-config.yaml | 2 +- 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/.github/workflows/prek-autoupdate.yml b/.github/workflows/prek-autoupdate.yml index f9bda20..b578b44 100644 --- a/.github/workflows/prek-autoupdate.yml +++ b/.github/workflows/prek-autoupdate.yml @@ -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: diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 551c63d..60cc0fd 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -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 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 89f52fa..8257f5b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -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