Skip to content
AI News HubLIVE
More
Original source1 min read

Using uvx in GitHub Actions in a cache-friendly way

Summary

A cache-friendly recipe for using uvx tool-name in GitHub Actions workflows. Set the UV_EXCLUDE_NEWER environment variable to a specific date and include that date in the GitHub Actions cache key. This avoids downloading the tool on every run, and you can upgrade by bumping the date.

Using uvx in GitHub Actions in a cache-friendly way
Report an error

The correction channel is not available yet. You can copy the article reference below for later.

Correction instructions
Read article

TIL: Using uvx in GitHub Actions in a cache-friendly way

Simon Willison’s Weblog

Subscribe

14th July 2026

TIL

Using uvx in GitHub Actions in a cache-friendly way — I often find myself wanting to run a quick Python tool inside of GitHub Actions using uvx name-of-tool - but I don't want that to result in a network request to PyPI every time the workflow runs. I want the tool to be fetched the first time and then reused from the GitHub Actions cache for subsequent runs.

I finally found a cache-friendly recipe for using uvx tool-name in GitHub Actions workflows that I like.

The trick is setting a UV_EXCLUDE_NEWER: "2026-07-12" environment variable at the start of the workflow and then using that as part of the GitHub Actions cache key. This means any uvx tool-name commands will resolve to the most recent version as-of that date, and you can bust the cache and upgrade the tools by bumping the date in the future.

My goal here is to use Python tools in GitHub Actions without every run of the workflow hitting PyPI to download a fresh copy of the tool and its dependencies.

Recent articles

The new GPT-5.6 family: Luna, Terra, Sol - 9th July 2026

sqlite-utils 4.0, now with database schema migrations - 7th July 2026

sqlite-utils 4.0rc2, mostly written by Claude Fable (for about $149.25) - 5th July 2026

This is a beat by Simon Willison, posted on 14th July 2026.

packaging 49

pypi 48

python 1,264

github-actions 68

uv 96

Monthly briefing

Sponsor me for $10/month and get a curated email digest of the month's most important LLM developments.

Pay me to send you less!

Sponsor & subscribe

Disclosures

Colophon

©

2002

2003

2004

2005

2006

2007

2008

2009

2010

2011

2012

2013

2014

2015

2016

2017

2018

2019

2020

2021

2022

2023

2024

2025

2026

Key points and analysis

Article intelligence

EngineersIntermediate

Key points

  • Set UV_EXCLUDE_NEWER to a date (e.g., 2026-07-12) to pin tool versions.
  • Incorporate the date into the GitHub Actions cache key for caching.
  • Bump the date to upgrade tools and invalidate the cache.
  • Reduces network requests and speeds up workflow runs.

Highlights and analysis are generated automatically and may contain errors. Check the original source.