Skip to content

ci: disable uv cache on no-op tag-release runs - #30

Closed
jadenfix wants to merge 1 commit into
mainfrom
ci/disable-uv-cache-on-noop-tag-runs
Closed

jadenfix wants to merge 1 commit into
mainfrom
ci/disable-uv-cache-on-noop-tag-runs

Conversation

@jadenfix

@jadenfix jadenfix commented May 5, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes false-failures on tag-on-release-merge.yml runs that don't bump pyproject.toml.

Why it was failing

tag-on-release-merge.yml runs on every push to `main`. When the merge doesn't change `pyproject.toml`, `Read merged release version` exits early (correct) and `Create version tag` is skipped (correct). However, `astral-sh/setup-uv@v6` had already run, and its post-cleanup tries to save the uv cache. Since `uv run` was never actually invoked (early exit), the cache directory is empty, and post-cleanup fails:

```
Error: Cache path /home/runner/work/_temp/setup-uv-cache does not exist on disk.
This likely indicates that there are no dependencies to cache.
```

That single post-step failure marks the entire job red, even though the tag-skip logic worked exactly as intended.

The fix

Add `enable-cache: false` to the setup-uv step. The only uv invocation in this workflow is one stdlib-only one-liner (`import tomllib, pathlib; ...`), so caching had no benefit anyway.

Test plan

  • After merge, a fresh push to `main` (e.g. this PR's merge commit, which doesn't touch `pyproject.toml`) runs `tag-on-release-merge.yml` and completes green, with `Create version tag` correctly skipped.
  • On the next real release-fan-out PR (one that bumps `pyproject.toml`), the `Create version tag` step runs and pushes `vX.Y.Z`, triggering `publish.yml`.

🤖 Generated with Claude Code

Most pushes to main don't bump pyproject.toml, so the version-read
step exits early before invoking uv run. setup-uv@v6's post-cleanup
then errors out trying to save an empty cache, marking the whole job
as failed even though the tag-skip logic worked correctly.

Caching adds no value here anyway -- the only uv invocation is a
single stdlib-only one-liner.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@greptile-apps

greptile-apps Bot commented May 5, 2026

Copy link
Copy Markdown

Greptile Summary

This PR disables the uv cache in tag-on-release-merge.yml by adding enable-cache: false to the astral-sh/setup-uv@v6 step. The fix eliminates a false-failure in the post-cleanup step that occurred whenever the workflow exited early (no pyproject.toml change) without ever invoking uv run, leaving the cache directory absent.

  • Adds a single enable-cache: false line to the setup-uv step; caching was never beneficial here anyway since the only uv run call uses stdlib-only modules (tomllib, pathlib).
  • The early-exit and tag-skip logic is unchanged; this solely prevents the post-step error from marking an otherwise-correct no-op run as failed.

Confidence Score: 5/5

Safe to merge — a one-line targeted fix to a CI workflow with no impact on library code or release logic.

The change is a single configuration line that removes an unused caching step. The workflow's tag-creation and version-reading logic is untouched, and disabling the cache has no effect on the one uv run call that uses only stdlib modules.

No files require special attention.

Important Files Changed

Filename Overview
.github/workflows/tag-on-release-merge.yml Adds enable-cache: false to the setup-uv step, preventing a spurious post-cleanup failure when the workflow exits early without invoking uv run.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Push to main] --> B[Mint App Token]
    B --> C[Checkout repo]
    C --> D[Setup uv + Python\nenable-cache: false]
    D --> E{BEFORE_SHA is zeros?}
    E -- yes --> F[Exit 0 early]
    E -- no --> G{pyproject.toml changed?}
    G -- no --> F
    G -- yes --> H[uv run: read version from pyproject.toml]
    H --> I[Output version value]
    I --> J{version output set?}
    J -- no --> K[Skip tag step]
    J -- yes --> L{Tag already exists?}
    L -- yes --> M[Exit 0, skip push]
    L -- no --> N[git tag vX.Y.Z\ngit push origin vX.Y.Z]
Loading

Reviews (1): Last reviewed commit: "ci: disable uv cache on no-op tag-releas..." | Re-trigger Greptile

@jadenfix

Copy link
Copy Markdown
Contributor Author

Closing per request.

@jadenfix jadenfix closed this May 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant