Files
ruff/action.yml
T
somazandGitHub f3db229c84 feat: support uv.lock as version-file (#379)
Adds `uv.lock` as a supported `version-file` format, alongside the
existing
`pyproject.toml` and `requirements.txt`. A `uv.lock` pins the exact
resolved
ruff version, so reading it gives a reproducible install that matches
the
project's lockfile — the single source of truth — instead of the
lower-bound /
range typically declared in `pyproject.toml`.

The parser reads the `[[package]]` entry whose `name` is `ruff` and
returns its
`version`. If ruff is absent or the file cannot be parsed, the action
warns and
falls back to `latest` (same behaviour as the other formats).

Validation:
- `npm run all` — tsc typecheck clean, biome clean, dist rebuilt, jest
65/65 pass
- Added unit tests (`__tests__/version/file-parser.test.ts`) + a
`uv.lock` fixture
- Added an integration job (`test-default-version-from-uv-lock`) that
runs the
  action against the fixture and asserts ruff 0.9.5 is installed

closes #375
2026-07-05 11:56:05 +02:00

40 lines
1.4 KiB
YAML

name: "ruff-action"
description: "A GitHub Action to run Ruff, an extremely fast Python linter and code formatter."
author: "astral-sh"
inputs:
args:
description: "Arguments passed to Ruff. Use `ruff --help` to see available options. Defaults to `check`."
required: false
default: "check"
src:
description: "Source path(s) or @actions/glob pattern(s) to run Ruff on. Defaults to the current workspace."
required: false
default: ${{ github.workspace }}
version:
description: "The version of Ruff to use, e.g., `0.6.0`. Defaults to the first discoverable version in pyproject.toml searched upward from `src`, or `latest`."
required: false
default: ""
version-file:
description: "Path to a pyproject.toml, requirements.txt or uv.lock file to read the version from. If parsing fails, the action warns and falls back to `latest`."
required: false
checksum:
description: "The checksum of the ruff version to install"
required: false
manifest-file:
description: "URL to a custom manifest file in the astral-sh/versions format."
required: false
github-token:
description:
"Used for authenticated downloads of Ruff release artifacts from GitHub."
required: false
default: ${{ github.token }}
outputs:
ruff-version:
description: "The installed ruff version. Useful when using latest."
runs:
using: "node24"
main: "dist/ruff-action/index.cjs"
branding:
icon: "code"
color: "black"