Inform user of unsupported old version (#134)

Versions older than v0.0.247 do not have binaries in the GitHub releases
This commit is contained in:
Kevin Stillhammer
2025-05-07 13:28:39 +00:00
committed by GitHub
parent b259b0b299
commit ea12b8ac41
4 changed files with 26 additions and 0 deletions
+17
View File
@@ -51,6 +51,22 @@ jobs:
with:
version: ${{ matrix.ruff-version }}
src: __tests__/fixtures/python-project
test-unsupported-version:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Try install old version
id: install
continue-on-error: true
uses: ./
with:
version: v0.0.246
src: __tests__/fixtures/python-project
- name: Check if the action failed
run: |
if [ ${{ steps.install.outcome }} == "success" ]; then
exit 1
fi
test-version-from-version-file-pyproject:
runs-on: ubuntu-latest
steps:
@@ -272,6 +288,7 @@ jobs:
- lint
- test-latest-version
- test-specific-version
- test-unsupported-version
- test-version-from-version-file-pyproject
- test-default-version-from-pyproject
- test-default-version-from-pyproject-dev-group
+3
View File
@@ -95,6 +95,9 @@ the ruff version to install. If no pyproject.toml file is found, or no ruff vers
`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
```yaml
Generated Vendored
BIN
View File
Binary file not shown.
+6
View File
@@ -23,6 +23,7 @@ import {
} from "./utils/inputs";
import { getRuffVersionFromRequirementsFile } from "./utils/pyproject";
import * as fs from "node:fs";
import * as semver from "semver";
async function run(): Promise<void> {
const platform = getPlatform();
@@ -62,6 +63,11 @@ async function setupRuff(
githubToken: string,
): Promise<{ ruffDir: string; version: string }> {
const resolvedVersion = await determineVersion();
if (semver.lt(resolvedVersion, "v0.0.247")) {
throw Error(
"This action does not support ruff versions older than 0.0.247",
);
}
const toolCacheResult = tryGetFromToolCache(arch, resolvedVersion);
if (toolCacheResult.installedPath) {
core.info(`Found ruffDir in tool-cache for ${toolCacheResult.version}`);