What ruff-action is
ruff-action lets Ruff be used directly as a GitHub Action rather than installed manually in a workflow step. By default it acts as a pass-fail test, confirming that a given repository does not contain any lint rule violations as defined by its configuration. Under the hood the action installs and runs ruff directly, so it can execute any supported ruff command, such as ruff check --fix. This distinguishes it from Ruff itself, which is the underlying linter and formatter being invoked.
- GitHub Action wrapper around the Ruff CLI
- Default behaviour is a pass-fail lint check
- Can run any supported ruff command
Usage in a workflow
To use ruff-action, a workflow file such as .github/workflows/ruff.yml is created in the repository, triggered on push and pull_request events. The job checks out the repository with actions/checkout@v4 and then calls astral-sh/ruff-action@v3. The action can also be included as a single step inside any other existing workflow file.
- uses: astral-sh/ruff-action@v3
- Typically paired with actions/checkout@v4
- Can run on ubuntu-latest or any GitHub-hosted runner
Configuration parameters
ruff-action accepts optional configuration parameters supplied through the with: block. These control which Ruff version is installed, which command-line arguments are passed, and which source paths are checked. For example, the action can be configured to run ruff check --select B ./src using Ruff version 0.8.0.
- version — the Ruff version to install (default: latest)
- args — command-line arguments passed to Ruff (default: "check")
- src — source paths passed to Ruff (default: [".", "src"])
Requirements and compatibility
ruff-action supports all GitHub-hosted runners. It can be used with any published Ruff version, meaning any version available on PyPI. Workflows that prefer not to use the action can instead install Ruff with pip and run ruff check --output-format=github to enable automatic inline annotations.
- Works with all GitHub-hosted runners
- Supports any Ruff version published on PyPI
- Manual alternative: pip install ruff plus ruff check --output-format=github
Sources
Last verified 03 Nov 2026. This entry is compiled from the public web pages listed above. Nothing here is stated that those pages do not, and each of them was read on the date shown.