mirror of
https://github.com/astral-sh/ruff-action.git
synced 2026-11-25 21:41:57 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
eaf0ecdd66 | ||
|
|
78b7b9921e | ||
|
|
9b2efb7fd8 | ||
|
|
da0c801a2d | ||
|
|
257550e917 | ||
|
|
94b3590e87 | ||
|
|
7a9e8edffe |
@@ -0,0 +1,35 @@
|
||||
import * as fs from "node:fs";
|
||||
import * as yaml from "js-yaml";
|
||||
|
||||
interface WorkflowJob {
|
||||
needs?: string[];
|
||||
[key: string]: unknown;
|
||||
}
|
||||
|
||||
interface Workflow {
|
||||
jobs: Record<string, WorkflowJob>;
|
||||
[key: string]: unknown;
|
||||
}
|
||||
|
||||
const workflow = yaml.load(
|
||||
fs.readFileSync("../workflows/test.yml", "utf8"),
|
||||
) as Workflow;
|
||||
const jobs = Object.keys(workflow.jobs);
|
||||
const allTestsPassed = workflow.jobs["all-tests-passed"];
|
||||
const needs: string[] = allTestsPassed.needs || [];
|
||||
|
||||
const expectedNeeds = jobs.filter((j) => j !== "all-tests-passed");
|
||||
const missing = expectedNeeds.filter((j) => !needs.includes(j));
|
||||
|
||||
if (missing.length > 0) {
|
||||
console.error(
|
||||
`Missing jobs in all-tests-passed needs: ${missing.join(", ")}`,
|
||||
);
|
||||
console.info(
|
||||
"Please add the missing jobs to the needs section of all-tests-passed in test.yml.",
|
||||
);
|
||||
process.exit(1);
|
||||
}
|
||||
console.log(
|
||||
"All jobs in test.yml are in the needs section of all-tests-passed.",
|
||||
);
|
||||
@@ -24,6 +24,14 @@ jobs:
|
||||
npm install
|
||||
- run: |
|
||||
npm run all
|
||||
- name: Transpile scripts
|
||||
run: |
|
||||
tsc ./*.ts
|
||||
working-directory: .github/scripts
|
||||
- name: Check all jobs are in all-tests-passed.needs
|
||||
run: |
|
||||
node check-all-tests-passed-needs.js
|
||||
working-directory: .github/scripts
|
||||
- name: Make sure no changes from linters are detected
|
||||
run: |
|
||||
git diff --exit-code || (echo "::error::Please run 'npm run all' to fix the issues" && exit 1)
|
||||
@@ -203,6 +211,23 @@ jobs:
|
||||
fi
|
||||
env:
|
||||
RUFF_VERSION: ${{ steps.ruff-action.outputs.ruff-version }}
|
||||
test-pep440-version-specifier:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Install version 0.11.11
|
||||
id: ruff-action
|
||||
uses: ./
|
||||
with:
|
||||
version: ">=0.11.10,<0.12.0"
|
||||
src: __tests__/fixtures/python-project
|
||||
- name: Correct version gets installed
|
||||
run: |
|
||||
if [ "$RUFF_VERSION" != "0.11.11" ]; then
|
||||
exit 1
|
||||
fi
|
||||
env:
|
||||
RUFF_VERSION: ${{ steps.ruff-action.outputs.ruff-version }}
|
||||
test-checksum:
|
||||
runs-on: ${{ matrix.inputs.os }}
|
||||
strategy:
|
||||
@@ -298,6 +323,7 @@ jobs:
|
||||
- test-default-version-from-pyproject-optional-dependencies
|
||||
- test-default-version-from-requirements
|
||||
- test-semver-range
|
||||
- test-pep440-version-specifier
|
||||
- test-checksum
|
||||
- test-with-explicit-token
|
||||
- test-args
|
||||
|
||||
@@ -4,8 +4,8 @@ A GitHub Action to run [ruff](https://github.com/astral-sh/ruff).
|
||||
|
||||
This action is commonly used as a pass/fail test to ensure your repository stays
|
||||
clean, abiding the [rules](https://docs.astral.sh/ruff/rules/) specified in your
|
||||
configuration. Though it runs `ruff`, the action can do anything `ruff` can (ex,
|
||||
fix).
|
||||
configuration. Though it runs `ruff check` by default, the action can do
|
||||
anything `ruff` can (ex, fix).
|
||||
|
||||
## Contents
|
||||
|
||||
@@ -18,7 +18,7 @@ fix).
|
||||
- [Install specific versions](#install-specific-versions)
|
||||
- [Install the latest version](#install-the-latest-version)
|
||||
- [Install a specific version](#install-a-specific-version)
|
||||
- [Install a version by supplying a semver range](#install-a-version-by-supplying-a-semver-range)
|
||||
- [Install a version by supplying a semver range or pep440 specifier](#install-a-version-by-supplying-a-semver-range-or-pep440-specifier)
|
||||
- [Install a version from a specified version file](#install-a-version-from-a-specified-version-file)
|
||||
- [Validate checksum](#validate-checksum)
|
||||
- [GitHub authentication token](#github-authentication-token)
|
||||
@@ -116,9 +116,10 @@ the latest version is installed.
|
||||
version: "0.4.4"
|
||||
```
|
||||
|
||||
#### Install a version by supplying a semver range
|
||||
#### Install a version by supplying a semver range or pep440 specifier
|
||||
|
||||
You can specify a [semver range](https://github.com/npm/node-semver?tab=readme-ov-file#ranges)
|
||||
or [pep440 specifier](https://peps.python.org/pep-0440/#version-specifiers)
|
||||
to install the latest version that satisfies the range.
|
||||
|
||||
```yaml
|
||||
@@ -135,6 +136,13 @@ to install the latest version that satisfies the range.
|
||||
version: "0.4.x"
|
||||
```
|
||||
|
||||
```yaml
|
||||
- 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.
|
||||
|
||||
BIN
Binary file not shown.
BIN
Binary file not shown.
Generated
+85
-33
@@ -13,17 +13,19 @@
|
||||
"@actions/exec": "^1.1.1",
|
||||
"@actions/tool-cache": "^2.0.2",
|
||||
"@octokit/core": "^6.1.4",
|
||||
"@octokit/plugin-paginate-rest": "^11.4.3",
|
||||
"@octokit/plugin-rest-endpoint-methods": "^13.3.1",
|
||||
"@octokit/plugin-paginate-rest": "^13.0.1",
|
||||
"@octokit/plugin-rest-endpoint-methods": "^16.0.0",
|
||||
"@renovatebot/pep440": "^4.1.0",
|
||||
"smol-toml": "^1.3.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@biomejs/biome": "1.9.4",
|
||||
"@types/node": "^22.13.10",
|
||||
"@types/semver": "^7.5.8",
|
||||
"@types/js-yaml": "^4.0.9",
|
||||
"@types/node": "^22.15.21",
|
||||
"@types/semver": "^7.7.0",
|
||||
"@vercel/ncc": "^0.38.3",
|
||||
"js-yaml": "^4.1.0",
|
||||
"typescript": "^5.8.2"
|
||||
"typescript": "^5.8.3"
|
||||
}
|
||||
},
|
||||
"node_modules/@actions/core": {
|
||||
@@ -288,34 +290,65 @@
|
||||
"integrity": "sha512-izFjMJ1sir0jn0ldEKhZ7xegCTj/ObmEDlEfpFrx4k/JyZSMRHbO3/rBwgE7f3m2DHt+RrNGIVw4wSmwnm3t/g=="
|
||||
},
|
||||
"node_modules/@octokit/plugin-paginate-rest": {
|
||||
"version": "11.4.3",
|
||||
"resolved": "https://registry.npmjs.org/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-11.4.3.tgz",
|
||||
"integrity": "sha512-tBXaAbXkqVJlRoA/zQVe9mUdb8rScmivqtpv3ovsC5xhje/a+NOCivs7eUhWBwCApJVsR4G5HMeaLbq7PxqZGA==",
|
||||
"version": "13.0.1",
|
||||
"resolved": "https://registry.npmjs.org/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-13.0.1.tgz",
|
||||
"integrity": "sha512-m1KvHlueScy4mQJWvFDCxFBTIdXS0K1SgFGLmqHyX90mZdCIv6gWBbKRhatxRjhGlONuTK/hztYdaqrTXcFZdQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@octokit/types": "^13.7.0"
|
||||
"@octokit/types": "^14.1.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 18"
|
||||
"node": ">= 20"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@octokit/core": ">=6"
|
||||
}
|
||||
},
|
||||
"node_modules/@octokit/plugin-rest-endpoint-methods": {
|
||||
"version": "13.3.1",
|
||||
"resolved": "https://registry.npmjs.org/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-13.3.1.tgz",
|
||||
"integrity": "sha512-o8uOBdsyR+WR8MK9Cco8dCgvG13H1RlM1nWnK/W7TEACQBFux/vPREgKucxUfuDQ5yi1T3hGf4C5ZmZXAERgwQ==",
|
||||
"node_modules/@octokit/plugin-paginate-rest/node_modules/@octokit/openapi-types": {
|
||||
"version": "25.1.0",
|
||||
"resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-25.1.0.tgz",
|
||||
"integrity": "sha512-idsIggNXUKkk0+BExUn1dQ92sfysJrje03Q0bv0e+KPLrvyqZF8MnBpFz8UNfYDwB3Ie7Z0TByjWfzxt7vseaA==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@octokit/plugin-paginate-rest/node_modules/@octokit/types": {
|
||||
"version": "14.1.0",
|
||||
"resolved": "https://registry.npmjs.org/@octokit/types/-/types-14.1.0.tgz",
|
||||
"integrity": "sha512-1y6DgTy8Jomcpu33N+p5w58l6xyt55Ar2I91RPiIA0xCJBXyUAhXCcmZaDWSANiha7R9a6qJJ2CRomGPZ6f46g==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@octokit/types": "^13.8.0"
|
||||
"@octokit/openapi-types": "^25.1.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@octokit/plugin-rest-endpoint-methods": {
|
||||
"version": "16.0.0",
|
||||
"resolved": "https://registry.npmjs.org/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-16.0.0.tgz",
|
||||
"integrity": "sha512-kJVUQk6/dx/gRNLWUnAWKFs1kVPn5O5CYZyssyEoNYaFedqZxsfYs7DwI3d67hGz4qOwaJ1dpm07hOAD1BXx6g==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@octokit/types": "^14.1.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 18"
|
||||
"node": ">= 20"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@octokit/core": ">=6"
|
||||
}
|
||||
},
|
||||
"node_modules/@octokit/plugin-rest-endpoint-methods/node_modules/@octokit/openapi-types": {
|
||||
"version": "25.1.0",
|
||||
"resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-25.1.0.tgz",
|
||||
"integrity": "sha512-idsIggNXUKkk0+BExUn1dQ92sfysJrje03Q0bv0e+KPLrvyqZF8MnBpFz8UNfYDwB3Ie7Z0TByjWfzxt7vseaA==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@octokit/plugin-rest-endpoint-methods/node_modules/@octokit/types": {
|
||||
"version": "14.1.0",
|
||||
"resolved": "https://registry.npmjs.org/@octokit/types/-/types-14.1.0.tgz",
|
||||
"integrity": "sha512-1y6DgTy8Jomcpu33N+p5w58l6xyt55Ar2I91RPiIA0xCJBXyUAhXCcmZaDWSANiha7R9a6qJJ2CRomGPZ6f46g==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@octokit/openapi-types": "^25.1.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@octokit/request": {
|
||||
"version": "9.2.2",
|
||||
"resolved": "https://registry.npmjs.org/@octokit/request/-/request-9.2.2.tgz",
|
||||
@@ -350,21 +383,39 @@
|
||||
"@octokit/openapi-types": "^23.0.1"
|
||||
}
|
||||
},
|
||||
"node_modules/@renovatebot/pep440": {
|
||||
"version": "4.1.0",
|
||||
"resolved": "https://registry.npmjs.org/@renovatebot/pep440/-/pep440-4.1.0.tgz",
|
||||
"integrity": "sha512-mo2RxnOSp78Njt1HmgMwjl6FapP4OyIS8HypJlymCvN7AIV2Xf5PmZfl/E3O1WWZ6IjKrfsEAaPWFMi8tnkq3g==",
|
||||
"license": "Apache-2.0",
|
||||
"engines": {
|
||||
"node": "^20.9.0 || ^22.11.0",
|
||||
"pnpm": "^9.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/js-yaml": {
|
||||
"version": "4.0.9",
|
||||
"resolved": "https://registry.npmjs.org/@types/js-yaml/-/js-yaml-4.0.9.tgz",
|
||||
"integrity": "sha512-k4MGaQl5TGo/iipqb2UDG2UwjXziSWkh0uysQelTlJpX1qGlpUZYm8PnO4DxG1qBomtJUdYJ6qR6xdIah10JLg==",
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@types/node": {
|
||||
"version": "22.13.10",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-22.13.10.tgz",
|
||||
"integrity": "sha512-I6LPUvlRH+O6VRUqYOcMudhaIdUVWfsjnZavnsraHvpBwaEyMN29ry+0UVJhImYL16xsscu0aske3yA+uPOWfw==",
|
||||
"version": "22.15.21",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-22.15.21.tgz",
|
||||
"integrity": "sha512-EV/37Td6c+MgKAbkcLG6vqZ2zEYHD7bvSrzqqs2RIhbA6w3x+Dqz8MZM3sP6kGTeLrdoOgKZe+Xja7tUB2DNkQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"undici-types": "~6.20.0"
|
||||
"undici-types": "~6.21.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/semver": {
|
||||
"version": "7.5.8",
|
||||
"resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.8.tgz",
|
||||
"integrity": "sha512-I8EUhyrgfLrcTkzV3TSsGyl1tSuPrEDzr0yd5m90UgNxQkyDXULk3b6MlQqTCpZpNtWe1K0hzclnZkTcLBe2UQ==",
|
||||
"dev": true
|
||||
"version": "7.7.0",
|
||||
"resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.7.0.tgz",
|
||||
"integrity": "sha512-k107IF4+Xr7UHjwDc7Cfd6PRQfbdkiRabXGRjo07b4WyPahFBZCZ1sE+BNxYIJPPg73UkfOsVOLwqVc/6ETrIA==",
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@vercel/ncc": {
|
||||
"version": "0.38.3",
|
||||
@@ -441,9 +492,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/typescript": {
|
||||
"version": "5.8.2",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.8.2.tgz",
|
||||
"integrity": "sha512-aJn6wq13/afZp/jT9QZmwEjDqqvSGp1VT5GVg+f/t6/oVyrgXM6BY1h9BRh/O5p3PlUPAe+WuiEZOmb/49RqoQ==",
|
||||
"version": "5.8.3",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.8.3.tgz",
|
||||
"integrity": "sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ==",
|
||||
"dev": true,
|
||||
"license": "Apache-2.0",
|
||||
"bin": {
|
||||
@@ -455,9 +506,10 @@
|
||||
}
|
||||
},
|
||||
"node_modules/undici": {
|
||||
"version": "5.28.5",
|
||||
"resolved": "https://registry.npmjs.org/undici/-/undici-5.28.5.tgz",
|
||||
"integrity": "sha512-zICwjrDrcrUE0pyyJc1I2QzBkLM8FINsgOrt6WjA+BgajVq9Nxu2PbFFXUrAggLfDXlZGZBVZYw7WNV5KiBiBA==",
|
||||
"version": "5.29.0",
|
||||
"resolved": "https://registry.npmjs.org/undici/-/undici-5.29.0.tgz",
|
||||
"integrity": "sha512-raqeBD6NQK4SkWhQzeYKd1KmIG6dllBOTt55Rmkt4HtI9mwdWtJljnrXjAFUBLTSN67HWrOIZ3EPF4kjUw80Bg==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@fastify/busboy": "^2.0.0"
|
||||
},
|
||||
@@ -466,9 +518,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/undici-types": {
|
||||
"version": "6.20.0",
|
||||
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.20.0.tgz",
|
||||
"integrity": "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg==",
|
||||
"version": "6.21.0",
|
||||
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz",
|
||||
"integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==",
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
|
||||
+7
-5
@@ -26,16 +26,18 @@
|
||||
"@actions/exec": "^1.1.1",
|
||||
"@actions/tool-cache": "^2.0.2",
|
||||
"@octokit/core": "^6.1.4",
|
||||
"@octokit/plugin-paginate-rest": "^11.4.3",
|
||||
"@octokit/plugin-rest-endpoint-methods": "^13.3.1",
|
||||
"@octokit/plugin-paginate-rest": "^13.0.1",
|
||||
"@octokit/plugin-rest-endpoint-methods": "^16.0.0",
|
||||
"@renovatebot/pep440": "^4.1.0",
|
||||
"smol-toml": "^1.3.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@biomejs/biome": "1.9.4",
|
||||
"@types/node": "^22.13.10",
|
||||
"@types/semver": "^7.5.8",
|
||||
"@types/js-yaml": "^4.0.9",
|
||||
"@types/node": "^22.15.21",
|
||||
"@types/semver": "^7.7.0",
|
||||
"@vercel/ncc": "^0.38.3",
|
||||
"js-yaml": "^4.1.0",
|
||||
"typescript": "^5.8.2"
|
||||
"typescript": "^5.8.3"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,107 @@
|
||||
// AUTOGENERATED_DO_NOT_EDIT
|
||||
export const KNOWN_CHECKSUMS: { [key: string]: string } = {
|
||||
"aarch64-apple-darwin-0.11.11":
|
||||
"814ccb26bed9c027bfc20ac88d33494ab0be62721757c73be70e26c23efbb3f7",
|
||||
"aarch64-pc-windows-msvc-0.11.11":
|
||||
"7c43804a3a9646edbc70eda6dab061343a5545844dbaff82ba472df3be4b74e0",
|
||||
"aarch64-unknown-linux-gnu-0.11.11":
|
||||
"26bc61fce6be2f358f656c7cc5b33725aafdc6ae6b21ee48fde10ad0d9b702ea",
|
||||
"aarch64-unknown-linux-musl-0.11.11":
|
||||
"3ca33d9b68b8b0bc7e3673b7638910ac2f7c5399303b37bec4d13c005481a78a",
|
||||
"arm-unknown-linux-musleabihf-0.11.11":
|
||||
"9d5cf3a8e5c495156479a7bb0a438f0f4bec6dbf69cdd48ede1cd508c41cd43b",
|
||||
"armv7-unknown-linux-gnueabihf-0.11.11":
|
||||
"acb854e89c24333a17cc2aba7adabab7314dc16bb92b52094661f9ca5843703f",
|
||||
"armv7-unknown-linux-musleabihf-0.11.11":
|
||||
"4e48259a71c1e806e64801bb3a55df555ee8b62360fb15f19e7ab3c496ee6f10",
|
||||
"i686-pc-windows-msvc-0.11.11":
|
||||
"507a588d22c9eb3558c86e85d50f6cbc099d52444dc05290c61ae8454aee25de",
|
||||
"i686-unknown-linux-gnu-0.11.11":
|
||||
"bd1e258d14a9a399bbb6fac468c3bfdc464858c028dd48ae3517f35b01a310c9",
|
||||
"i686-unknown-linux-musl-0.11.11":
|
||||
"4de74178a1e0181ed56b623943a3198c4f7f90da918d050e846a1468050bf4ad",
|
||||
"powerpc64-unknown-linux-gnu-0.11.11":
|
||||
"da883ef2174136c0d50570a16c01f57fd99c55e05914ba35dafd37b49e5f0331",
|
||||
"powerpc64le-unknown-linux-gnu-0.11.11":
|
||||
"ecd54e2738005a345ecc80f834f89a3d55c791e89ad43ca24becfbed79d490a4",
|
||||
"s390x-unknown-linux-gnu-0.11.11":
|
||||
"7a12eb9e85126cf9018842bc206b763211e9295ad6906e46c73b76ae110924ba",
|
||||
"x86_64-apple-darwin-0.11.11":
|
||||
"8bef00e82bc07ea26b45adcffc3d55b2d0821f3a3e4d5f441f4dd4ad608fc1be",
|
||||
"x86_64-pc-windows-msvc-0.11.11":
|
||||
"b7619ff27098a4d7f37c52fb8fc61ccfe677aaade7722a385b40f8d5273ebddd",
|
||||
"x86_64-unknown-linux-gnu-0.11.11":
|
||||
"4883053606fc9efed6f8860145bcbf66f0f421684054c156c84b04bd9bf1638f",
|
||||
"x86_64-unknown-linux-musl-0.11.11":
|
||||
"bb64b083767a5fd0a62e10e9a35614974ad53025e2878cf14a0c698680e6c30c",
|
||||
"aarch64-apple-darwin-0.11.10":
|
||||
"1c4187c5ecd76535b76e991af1114d9c9947fe69e6d1a69c9ed6723d6777a53e",
|
||||
"aarch64-pc-windows-msvc-0.11.10":
|
||||
"765234e319c8fce0b0216f570f4480b7a7b77d019347fa301536b808c245375b",
|
||||
"aarch64-unknown-linux-gnu-0.11.10":
|
||||
"a39ff81bfe023d55008943f11221d49759d73b9fe6bf76584626cfcdd33d8684",
|
||||
"aarch64-unknown-linux-musl-0.11.10":
|
||||
"acddbf808ba83c9dda01391ddd1c7f0c23d36f1f2cbbee6290d98363f3e4cafc",
|
||||
"arm-unknown-linux-musleabihf-0.11.10":
|
||||
"8647e140f06719c68220157205ef21644901dfab8daefe72cf08317e45b212d4",
|
||||
"armv7-unknown-linux-gnueabihf-0.11.10":
|
||||
"49eab0e5ec80c1d1a13737d5ad0ca69ac79227ece39750e4db38ad9f3a20f3f0",
|
||||
"armv7-unknown-linux-musleabihf-0.11.10":
|
||||
"51bf490bd5a357d76dd5ca7d5aa6724e4445a413720e3d370cf28194f12800fc",
|
||||
"i686-pc-windows-msvc-0.11.10":
|
||||
"e0aab393a0e9da99e7cadcfbad7bfa6abbe3de9e1fc69eb3e649ed27769fd7a1",
|
||||
"i686-unknown-linux-gnu-0.11.10":
|
||||
"5cab3435770f98a3171e3890b870b2bf682f1639470d46e1538a2117a0072464",
|
||||
"i686-unknown-linux-musl-0.11.10":
|
||||
"f98f40b6a9fddde57459ce635b94cacc417a6682aeab24ee1091f7486c64eaee",
|
||||
"powerpc64-unknown-linux-gnu-0.11.10":
|
||||
"084d19d34b553212aceb988f2de97f304a214f0c93a230366bae55351d0c552c",
|
||||
"powerpc64le-unknown-linux-gnu-0.11.10":
|
||||
"02abc4c8d4f40d4c2a02a4fe1edf6061ac724e95b0c65e5ccfd968b150d7154d",
|
||||
"s390x-unknown-linux-gnu-0.11.10":
|
||||
"379ae3fa5b61d8e7433cf9fa5c76aec8a7e3f17e686f55100cccb13765b4c8f4",
|
||||
"x86_64-apple-darwin-0.11.10":
|
||||
"25f0a8b819ea5c9377be02fd98c363ffb5659c35358881a1ce909f30b362cb39",
|
||||
"x86_64-pc-windows-msvc-0.11.10":
|
||||
"d77bc4ecdb0f50f5a70422db90ec735caf71c3ea3e201e6e84a78fed695a4950",
|
||||
"x86_64-unknown-linux-gnu-0.11.10":
|
||||
"ade458637abe06ff6780e0b3a5fdd281da552d33eb75b954fc2a27278258b856",
|
||||
"x86_64-unknown-linux-musl-0.11.10":
|
||||
"8765d2f71c422f60a1456a2b2d9b2ee2ab286cb4859a774b5efb0a837a07f6dd",
|
||||
"aarch64-apple-darwin-0.11.9":
|
||||
"d7955d8cf0b96471757d9733b21576b00baebecc056e3382d7023f092bfa8526",
|
||||
"aarch64-pc-windows-msvc-0.11.9":
|
||||
"bebd2f05e37101023d32ca6b0a6ca1f619b0c5faccde7df0960d96bcc2bcf8bc",
|
||||
"aarch64-unknown-linux-gnu-0.11.9":
|
||||
"8dffb447ee07405dcb0939666703a53ac38d6703abbe48db6d5ec8189544dd37",
|
||||
"aarch64-unknown-linux-musl-0.11.9":
|
||||
"a3d6ee64ce182345d88ce2d1a2960d9261d2bcf6746b85be769b31e27349f6fb",
|
||||
"arm-unknown-linux-musleabihf-0.11.9":
|
||||
"1c480bcfad71617754f9518e44db9670ff87145b79d03dec3db4b50c5a743dc3",
|
||||
"armv7-unknown-linux-gnueabihf-0.11.9":
|
||||
"2a8739fb4544a2da95d3f64f43a01d86468dc4c72d47f0cdea4dbd36767e5b3b",
|
||||
"armv7-unknown-linux-musleabihf-0.11.9":
|
||||
"5cfb13bad415b339162d60ca044c248130882ab014d648532fe789540f8fc80d",
|
||||
"i686-pc-windows-msvc-0.11.9":
|
||||
"17dd0dc46c38bf1fe4af50f1cc5b128054a43182cfb643d5ab2ac0382e94719b",
|
||||
"i686-unknown-linux-gnu-0.11.9":
|
||||
"472c13baa143869103ab40f8281d39691abc24ede7bfbcbc57bb2a796b84bb52",
|
||||
"i686-unknown-linux-musl-0.11.9":
|
||||
"d1f795e59c2e0842352b00e8301ee8fe2fe321fd5af39f419b77534b4f6bd817",
|
||||
"powerpc64-unknown-linux-gnu-0.11.9":
|
||||
"e5165cf2db7d74d1d05bc7fee0c36eb92578716a6b86d95d63c3a4577102350e",
|
||||
"powerpc64le-unknown-linux-gnu-0.11.9":
|
||||
"022579b3fc348651103a2dddb21f5844dde111d9b539f6179448e076dc9979fe",
|
||||
"s390x-unknown-linux-gnu-0.11.9":
|
||||
"f657228facc1a131a4896a028a847bba95ccf82dd6570385cacabb8f186db26d",
|
||||
"x86_64-apple-darwin-0.11.9":
|
||||
"88d5c544ac4a420b3c58e0a858a7807c545668a6a3fb9e5403ad73aa0d55b653",
|
||||
"x86_64-pc-windows-msvc-0.11.9":
|
||||
"b3c7144d40b3860b104cb88e5c8a95a326b81b3d305b9b6a2ce304761b8508c3",
|
||||
"x86_64-unknown-linux-gnu-0.11.9":
|
||||
"276f6b928f61724b255e04e7e3b9e6859f86f4eec5d1b906a72983f3365b6671",
|
||||
"x86_64-unknown-linux-musl-0.11.9":
|
||||
"7125dd1baf4f4d635a185c84fa8bef7f572a088e30d160a07f97f2c9fac70c6d",
|
||||
"aarch64-apple-darwin-0.11.8":
|
||||
"bc3fc6693437efab1add3f288d6d16fac6926e6888c1e758ec162d5b6fe9099d",
|
||||
"aarch64-pc-windows-msvc-0.11.8":
|
||||
|
||||
@@ -3,6 +3,7 @@ import * as tc from "@actions/tool-cache";
|
||||
import * as path from "node:path";
|
||||
import { promises as fs } from "node:fs";
|
||||
import * as semver from "semver";
|
||||
import * as pep440 from "@renovatebot/pep440";
|
||||
import { OWNER, REPO, TOOL_CACHE_NAME } from "../utils/constants";
|
||||
import type { Architecture, Platform } from "../utils/platforms";
|
||||
import { validateChecksum } from "./checksum/checksum";
|
||||
@@ -124,8 +125,8 @@ export async function resolveVersion(
|
||||
return version;
|
||||
}
|
||||
const availableVersions = await getAvailableVersions(githubToken);
|
||||
const resolvedVersion = tc.evaluateVersions(availableVersions, version);
|
||||
if (resolvedVersion === "") {
|
||||
const resolvedVersion = maxSatisfying(availableVersions, version);
|
||||
if (resolvedVersion === undefined) {
|
||||
throw new Error(`No version found for ${version}`);
|
||||
}
|
||||
core.debug(`Resolved version: ${resolvedVersion}`);
|
||||
@@ -195,3 +196,22 @@ async function getLatestRelease(
|
||||
});
|
||||
return latestRelease;
|
||||
}
|
||||
|
||||
function maxSatisfying(
|
||||
versions: string[],
|
||||
version: string,
|
||||
): string | undefined {
|
||||
const maxSemver = tc.evaluateVersions(versions, version);
|
||||
if (maxSemver !== "") {
|
||||
core.debug(`Found a version that satisfies the semver range: ${maxSemver}`);
|
||||
return maxSemver;
|
||||
}
|
||||
const maxPep440 = pep440.maxSatisfying(versions, version);
|
||||
if (maxPep440 !== null) {
|
||||
core.debug(
|
||||
`Found a version that satisfies the pep440 specifier: ${maxPep440}`,
|
||||
);
|
||||
return maxPep440;
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user