From 8a288a151a5ac2306026477c2a8ea3b9c216e054 Mon Sep 17 00:00:00 2001 From: Gavin Lucas Date: Thu, 19 Nov 2026 14:43:28 +0000 Subject: [PATCH 1/3] Key setup-uv's cache on the file that pins the tools setup-uv keys its cache on a project's dependency files, requirements, pyproject.toml, uv.lock and the like, and this repository has none: the versions of actionlint-py, pytest and pyyaml are pinned in premerge.yaml. So nothing matched, the cache key never changed, and both jobs that set up uv warned on every run that the cache would never be invalidated. Keyed on premerge.yaml, a changed pin starts a new cache, and the warnings stop, so a new warning on these jobs is not lost among them. Each uvx call names exact versions, so the old cache never installed a wrong one; the cost was the noise. Signed-off-by: Gavin Lucas --- .github/workflows/premerge.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/premerge.yaml b/.github/workflows/premerge.yaml index f2e8f9a..3759714 100644 --- a/.github/workflows/premerge.yaml +++ b/.github/workflows/premerge.yaml @@ -42,6 +42,10 @@ jobs: - name: Set up uv uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3 + with: + # The tools' versions are pinned in this file, not in a requirements or project file, + # so the cache is keyed on it: a changed pin starts a new cache. + cache-dependency-glob: .github/workflows/premerge.yaml - name: Workflows lint clean # SC2016 is shellcheck noting that `$x` does not expand inside single quotes. Here that @@ -65,6 +69,10 @@ jobs: - name: Set up uv uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3 + with: + # The tools' versions are pinned in this file, not in a requirements or project file, + # so the cache is keyed on it: a changed pin starts a new cache. + cache-dependency-glob: .github/workflows/premerge.yaml - name: Tests pass run: uvx --with pyyaml==6.0.3 pytest==8.3.5 -p no:cacheprovider -q tests From 393d457caad2e9d0f26d5f58e7c036754926005c Mon Sep 17 00:00:00 2001 From: Gavin Lucas Date: Thu, 19 Nov 2026 14:45:57 +0000 Subject: [PATCH 2/3] Give each job that sets up uv a cache of its own actionlint and shared-behaviour installed different tools under one cache key, and setup-uv saves nothing on an exact hit, so whichever job saved first kept the other's tools out of the cache, and that job downloaded them on every run. The job's name is now the key's suffix. Signed-off-by: Gavin Lucas --- .github/workflows/premerge.yaml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/premerge.yaml b/.github/workflows/premerge.yaml index 3759714..9ecda95 100644 --- a/.github/workflows/premerge.yaml +++ b/.github/workflows/premerge.yaml @@ -44,8 +44,11 @@ jobs: uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3 with: # The tools' versions are pinned in this file, not in a requirements or project file, - # so the cache is keyed on it: a changed pin starts a new cache. + # so the cache is keyed on it: a changed pin starts a new cache. Each job installs + # different tools, so each has a cache of its own; with one key between them, the + # first to save would keep the other's tools out of it. cache-dependency-glob: .github/workflows/premerge.yaml + cache-suffix: ${{ github.job }} - name: Workflows lint clean # SC2016 is shellcheck noting that `$x` does not expand inside single quotes. Here that @@ -71,8 +74,11 @@ jobs: uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3 with: # The tools' versions are pinned in this file, not in a requirements or project file, - # so the cache is keyed on it: a changed pin starts a new cache. + # so the cache is keyed on it: a changed pin starts a new cache. Each job installs + # different tools, so each has a cache of its own; with one key between them, the + # first to save would keep the other's tools out of it. cache-dependency-glob: .github/workflows/premerge.yaml + cache-suffix: ${{ github.job }} - name: Tests pass run: uvx --with pyyaml==6.0.3 pytest==8.3.5 -p no:cacheprovider -q tests From 1e3449ff8311a661c252c1bcd597289c8b23e1bf Mon Sep 17 00:00:00 2001 From: Gavin Lucas Date: Thu, 19 Nov 2026 14:46:28 +0000 Subject: [PATCH 3/3] Key repo-hygiene's uv cache on its own script The action set up uv with setup-uv's default glob, which looks in the caller's workspace for requirements and project files. The script pins its one dependency inline and lives in the action's directory, so in a caller with no Python project files nothing matched, and every caller's hygiene job warned that the cache would never be invalidated; quaffed's does. setup-uv hashes files outside the workspace, so the glob is now the script itself, through github.action_path. Signed-off-by: Gavin Lucas --- actions/repo-hygiene/action.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/actions/repo-hygiene/action.yml b/actions/repo-hygiene/action.yml index 6c0f5fc..d678fee 100644 --- a/actions/repo-hygiene/action.yml +++ b/actions/repo-hygiene/action.yml @@ -15,6 +15,12 @@ runs: steps: - name: Set up uv uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3 + with: + # The script pins its own dependencies, inline, and lives in this action's directory, + # not the caller's workspace, where setup-uv would otherwise look and find nothing: a + # warning on every caller's run that the cache is never invalidated. setup-uv hashes + # files outside the workspace too. + cache-dependency-glob: ${{ github.action_path }}/check-repo-hygiene.py - name: Repository conventions hold shell: bash