Skip to main content

uv-audit-cooldown

Cooldown-aware uv audit: it warns while a fix is inside your exclude-newer window, and fails once it isn't.

Unofficial, and not affiliated with Astral. It relies on uv audit's preview JSON output.

# GitHub Action
on:
  pull_request:
  schedule:
    - cron: "0 6 * * 1" # advisories appear without code changes
permissions:
  contents: read
jobs:
  audit:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
        with:
          persist-credentials: false
      - uses: jgstew/uv-audit-cooldown@0b808b7239fced579e4bb19f3d3ab3a918472abe # v1.0.0
# pre-commit
repos:
  - repo: https://github.com/jgstew/uv-audit-cooldown
    rev: v1.0.0
    hooks:
      - id: uv-audit-cooldown
        verbose: true # pre-commit hides output of passing hooks
        stages: [manual] # needs the network
uvx uv-audit-cooldown@1.0.0

What it does

It runs uv audit. For each vulnerable package it then runs uv lock --dry-run --upgrade-package <name>, which shows the newest version your own cooldown allows and leaves uv.lock untouched. If no audit finding is reported, no other network call is made.

Situation Result
Every fix is still inside the cooldown pass, with a one-line summary
An upgrade is allowed, but it doesn't reach the fix yet pass, and the summary says so
A fixed version is allowed now fail
A fix is blocked by something other than the cooldown (a pin) fail
No fix has been published fail (--unfixed warning to soften)
No project or no uv.lock (as uv finds them) pass with a warning (--no-lockfile error to fail)

To tell whether a fix is held back only by the cooldown, it runs a second dry run with the cooldown lifted. That one uses --no-build, so it never runs build code from a release that is still inside the cooldown; if it would need a build, the tool exits 2.

In GitHub Actions, messages are printed as ::warning/::error annotations. --verbose prints one line per advisory. Other arguments go to uv audit, e.g. --no-dev or --ignore GHSA-…. Location, config, index, cache, build and resolver options (--project, --index, --prerelease, --exclude-newer, …) also go to the dry runs, so both see the same settings; UV_* environment variables reach both too. --offline isn't used: on a cold CI cache it fails, and with a stale cache it could hide a fix that is already allowed.

Exit codes: 0 nothing to do now, 1 action needed, 2 uv failed or its output wasn't understood.

Action inputs

working-directory (default .), args (extra uv audit arguments), unfixed (error/warning), no-lockfile (warning/error), setup-uv (auto/true/false), uv-version.

Pinning

  • Action: pin uses: to a commit SHA. The Action runs its own checkout (uv run --frozen --project "$GITHUB_ACTION_PATH") and never installs from PyPI.
  • pre-commit: pin rev: to a tag, or to a SHA with pre-commit autoupdate --freeze.
  • uvx: pin a version: uvx uv-audit-cooldown@1.0.0.

pre-commit limitation

pre-commit installs the hook with pip (language: python), which ignores this repo's uv.lock and exclude-newer. The hook's dependency (packaging) and its build backend (uv_build) therefore come from PyPI at their newest allowed versions, with no cooldown. rev: pins only this repo's code. If that matters, use the Action (it runs uv run --frozen from its own lockfile), or a local hook with language: system and entry: uvx --exclude-newer "7 days" uv-audit-cooldown@1.0.0.

astral-sh/uv#18995, astral-sh/uv#22944, astral-sh/uv#19265, astral-sh/uv#18506

Metadata

Release files for uv-audit-cooldown 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for uv-audit-cooldown 1.0.1
File Size Uploaded Provenance Actions
uv_audit_cooldown-1.0.1.tar.gz 11.5 kB Without provenance Details for uv_audit_cooldown-1.0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for uv-audit-cooldown 1.0.1
File Interpreter ABI Platform Actions
uv_audit_cooldown-1.0.1-py3-none-any.whl Python 3 none any Details for uv_audit_cooldown-1.0.1-py3-none-any.whl

Total release size: 24.4 kB

Release files / uv_audit_cooldown-1.0.1.tar.gz

Download URL uv_audit_cooldown-1.0.1.tar.gz
Size 11.5 kB
Tags Source
SHA-256 checksum
How to use checksums
fe0189f44d0f6eb5f8c63e74e4fc8d973abf18868ecaab8382349b2890fbf7ab
BLAKE2b-256 checksum
How to use checksums
e0e8d195ba77b41baca957fef25af71889e70823f2452e7f53b6134207bf2a5b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / uv_audit_cooldown-1.0.1-py3-none-any.whl

Download URL uv_audit_cooldown-1.0.1-py3-none-any.whl
Size 12.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
64bed099dbf5529bb728f5c375d924aa8977900c9c1319d59f1f8e3c7d0bb4a4
BLAKE2b-256 checksum
How to use checksums
4db58a163357f85ccba51aa7f89ad09b7f19b10d33c123c12b6ccb2cc084742d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for uv-audit-cooldown 1.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page