A GitHub Action to run Ruff
Find a file
dependabot[bot] cd51da8b6c
Bump peter-evans/create-pull-request from 7.0.8 to 7.0.9 (#273)
Bumps
[peter-evans/create-pull-request](https://github.com/peter-evans/create-pull-request)
from 7.0.8 to 7.0.9.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/peter-evans/create-pull-request/releases">peter-evans/create-pull-request's
releases</a>.</em></p>
<blockquote>
<h2>Create Pull Request v7.0.9</h2>
<p>⚙️ Fixes an <a
href="https://redirect.github.com/peter-evans/create-pull-request/issues/4228">incompatibility</a>
with the recently released <code>actions/checkout@v6</code>.</p>
<h2>What's Changed</h2>
<ul>
<li>~70 dependency updates by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a></li>
<li>docs: fix workaround description about <code>ready_for_review</code>
by <a href="https://github.com/ybiquitous"><code>@​ybiquitous</code></a>
in <a
href="https://redirect.github.com/peter-evans/create-pull-request/pull/3939">peter-evans/create-pull-request#3939</a></li>
<li>Docs: <code>add-paths</code> default behavior by <a
href="https://github.com/joeflack4"><code>@​joeflack4</code></a> in <a
href="https://redirect.github.com/peter-evans/create-pull-request/pull/3928">peter-evans/create-pull-request#3928</a></li>
<li>docs: update to create-github-app-token v2 by <a
href="https://github.com/Goooler"><code>@​Goooler</code></a> in <a
href="https://redirect.github.com/peter-evans/create-pull-request/pull/4063">peter-evans/create-pull-request#4063</a></li>
<li>Fix compatibility with actions/checkout@v6 by <a
href="https://github.com/ericsciple"><code>@​ericsciple</code></a> in <a
href="https://redirect.github.com/peter-evans/create-pull-request/pull/4230">peter-evans/create-pull-request#4230</a></li>
</ul>
<h2>New Contributors</h2>
<ul>
<li><a href="https://github.com/joeflack4"><code>@​joeflack4</code></a>
made their first contribution in <a
href="https://redirect.github.com/peter-evans/create-pull-request/pull/3928">peter-evans/create-pull-request#3928</a></li>
<li><a href="https://github.com/Goooler"><code>@​Goooler</code></a> made
their first contribution in <a
href="https://redirect.github.com/peter-evans/create-pull-request/pull/4063">peter-evans/create-pull-request#4063</a></li>
<li><a
href="https://github.com/ericsciple"><code>@​ericsciple</code></a> made
their first contribution in <a
href="https://redirect.github.com/peter-evans/create-pull-request/pull/4230">peter-evans/create-pull-request#4230</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/peter-evans/create-pull-request/compare/v7.0.8...v7.0.9">https://github.com/peter-evans/create-pull-request/compare/v7.0.8...v7.0.9</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="84ae59a2cd"><code>84ae59a</code></a>
fix: compatibility with actions/checkout@v6 (<a
href="https://redirect.github.com/peter-evans/create-pull-request/issues/4230">#4230</a>)</li>
<li><a
href="b4733b9419"><code>b4733b9</code></a>
build(deps-dev): bump js-yaml from 4.1.0 to 4.1.1 (<a
href="https://redirect.github.com/peter-evans/create-pull-request/issues/4222">#4222</a>)</li>
<li><a
href="0edc001d28"><code>0edc001</code></a>
build(deps-dev): bump the npm group with 2 updates (<a
href="https://redirect.github.com/peter-evans/create-pull-request/issues/4201">#4201</a>)</li>
<li><a
href="430aea0fb1"><code>430aea0</code></a>
build(deps): bump the github-actions group with 3 updates (<a
href="https://redirect.github.com/peter-evans/create-pull-request/issues/4200">#4200</a>)</li>
<li><a
href="46cdba753c"><code>46cdba7</code></a>
build(deps-dev): bump the npm group with 3 updates (<a
href="https://redirect.github.com/peter-evans/create-pull-request/issues/4185">#4185</a>)</li>
<li><a
href="b937339b17"><code>b937339</code></a>
build(deps): bump the github-actions group with 2 updates (<a
href="https://redirect.github.com/peter-evans/create-pull-request/issues/4184">#4184</a>)</li>
<li><a
href="e9af275c37"><code>e9af275</code></a>
ci: update dependabot config</li>
<li><a
href="d3e081a03a"><code>d3e081a</code></a>
build(deps-dev): bump <code>@​types/node</code> from 18.19.127 to
18.19.128 (<a
href="https://redirect.github.com/peter-evans/create-pull-request/issues/4178">#4178</a>)</li>
<li><a
href="9ec683ee07"><code>9ec683e</code></a>
build(deps-dev): bump <code>@​types/node</code> from 18.19.125 to
18.19.127 (<a
href="https://redirect.github.com/peter-evans/create-pull-request/issues/4165">#4165</a>)</li>
<li><a
href="65d8d10bf7"><code>65d8d10</code></a>
build(deps-dev): bump ts-jest from 29.4.2 to 29.4.4 (<a
href="https://redirect.github.com/peter-evans/create-pull-request/issues/4163">#4163</a>)</li>
<li>Additional commits viewable in <a
href="271a8d0340...84ae59a2cd">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=peter-evans/create-pull-request&package-manager=github_actions&previous-version=7.0.8&new-version=7.0.9)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-11-24 09:02:11 +01:00
.github Bump peter-evans/create-pull-request from 7.0.8 to 7.0.9 (#273) 2025-11-24 09:02:11 +01:00
.vscode bump biome to 2.1.4 (#201) 2025-08-12 19:53:24 +00:00
__tests__/fixtures feat: support reading Ruff version from tools.poetry.dependencies (#177) 2025-07-14 09:58:25 +02:00
dist chore: update known checksums for 0.14.6 (#271) 2025-11-22 07:51:24 +00:00
src chore: update known checksums for 0.14.6 (#271) 2025-11-22 07:51:24 +00:00
.editorconfig Convert from composite to typescript (#17) 2024-12-03 17:18:31 +01:00
.gitattributes Convert from composite to typescript (#17) 2024-12-03 17:18:31 +01:00
.gitignore Convert from composite to typescript (#17) 2024-12-03 17:18:31 +01:00
action.yml Default to ruff-version from pyproject.toml (#30) 2024-12-23 11:07:46 +01:00
biome.json bump biome to 2.1.4 (#201) 2025-08-12 19:53:24 +00:00
CODEOWNERS Convert from composite to typescript (#17) 2024-12-03 17:18:31 +01:00
LICENSE Initial commit 2023-03-31 08:38:06 -07:00
package-lock.json bump biome to 2.1.4 (#201) 2025-08-12 19:53:24 +00:00
package.json bump biome to 2.1.4 (#201) 2025-08-12 19:53:24 +00:00
README.md Add support for pep440 version specifiers (#150) 2025-05-26 20:20:17 +02:00
tsconfig.json bump biome to 2.1.4 (#201) 2025-08-12 19:53:24 +00:00

ruff-action

A GitHub Action to run ruff.

This action is commonly used as a pass/fail test to ensure your repository stays clean, abiding the rules specified in your configuration. Though it runs ruff check by default, the action can do anything ruff can (ex, fix).

Contents

Usage

Input Description Default
version The version of Ruff to install. See Install specific versions latest
version-file The file to read the version from. See Install a version from a specified version file None
args The arguments to pass to the ruff command. See Configuring Ruff check
src The directory or single files to run ruff on. github.workspace
checksum The sha256 checksum of the downloaded executable. None
github-token The GitHub token to use for authentication. GITHUB_TOKEN

Basic

- uses: astral-sh/ruff-action@v3

Specify a different source directory

- uses: astral-sh/ruff-action@v3
  with:
    src: "./src"

Specify multiple files

- uses: astral-sh/ruff-action@v3
  with:
    src: >-
      path/to/file1.py
      path/to/file2.py

Use to install ruff

This action adds ruff to the PATH, so you can use it in subsequent steps.

- uses: astral-sh/ruff-action@v3
- run: ruff check --fix
- run: ruff format

By default, this action runs ruff check after installation. If you do not want to run any ruff command but only install it, you can use the args input to overwrite the default value (check):

- name: Install ruff without running check or format
  uses: astral-sh/ruff-action@v3
  with:
    args: "--version"

Use ruff format

- uses: astral-sh/ruff-action@v3
  with:
    args: "format --check --diff"

Install specific versions

By default this action looks for a pyproject.toml file in the root of the repository to determine the ruff version to install. If no pyproject.toml file is found, or no ruff version is defined in project.dependencies, project.optional-dependencies, or dependency-groups, the latest version is installed.

Note

This action does only support ruff versions v0.0.247 and above.

Install the latest version

- name: Install the latest version of ruff
  uses: astral-sh/ruff-action@v3
  with:
    version: "latest"

Install a specific version

- name: Install a specific version of ruff
  uses: astral-sh/ruff-action@v3
  with:
    version: "0.4.4"

Install a version by supplying a semver range or pep440 specifier

You can specify a semver range or pep440 specifier to install the latest version that satisfies the range.

- name: Install a semver range of ruff
  uses: astral-sh/ruff-action@v3
  with:
    version: ">=0.4.0"
- name: Pinning a minor version of ruff
  uses: astral-sh/ruff-action@v3
  with:
    version: "0.4.x"
- name: Install a pep440-specifier-satisfying version of ruff
  uses: astral-sh/ruff-action@v3
  with:
    version: ">=0.11.10,<0.12.0"

Install a version from a specified version file

You can specify a file to read the version from. Currently pyproject.toml and requirements.txt are supported.

- name: Install a version from a specified version file
  uses: astral-sh/ruff-action@v3
  with:
    version-file: "my-path/to/pyproject.toml-or-requirements.txt"

Validate checksum

You can specify a checksum to validate the downloaded executable. Checksums up to the default version are automatically verified by this action. The sha256 hashes can be found on the releases page of the ruff repo.

- name: Install a specific version and validate the checksum
  uses: astral-sh/ruff-action@v3
  with:
    version: "0.7.4"
    checksum: "0de731c669b9ece77e799ac3f4a160c30849752714d9775c94cc4cfaf326860c"

GitHub authentication token

This action uses the GitHub API to fetch the ruff release artifacts. To avoid hitting the GitHub API rate limit too quickly, an authentication token can be provided via the github-token input. By default, the GITHUB_TOKEN secret is used, which is automatically provided by GitHub Actions.

If the default permissions for the GitHub token are not sufficient, you can provide a custom GitHub token with the necessary permissions.

- name: Install the latest version of ruff with a custom GitHub token
  uses: astral-sh/ruff-action@v3
  with:
    github-token: ${{ secrets.CUSTOM_GITHUB_TOKEN }}

Outputs

Output Description
ruff-version The version of Ruff that was installed.