mirror of
https://github.com/astral-sh/ruff-action.git
synced 2026-08-09 02:37:03 +00:00
Compare commits
3
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
47de3deae8 | ||
|
|
d8281c74d4 | ||
|
|
a634044659 |
@@ -16,7 +16,7 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Actionlint
|
||||
uses: eifinger/actionlint-action@8ebeb40569f3c15ca66fe36d1b75f9b70c6c4f6e # v1.9.0
|
||||
uses: eifinger/actionlint-action@23c85443d840cd73bbecb9cddfc933cc21649a38 # v1.9.1
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: "20"
|
||||
|
||||
+3
-10
@@ -30405,16 +30405,13 @@ async function getAvailableVersions(githubToken) {
|
||||
try {
|
||||
const octokit = new PaginatingOctokit({
|
||||
auth: githubToken,
|
||||
baseUrl: constants_1.GITHUB_COM_API,
|
||||
});
|
||||
return await getReleaseTagNames(octokit);
|
||||
}
|
||||
catch (err) {
|
||||
if (err.message.includes("Bad credentials")) {
|
||||
core.info("No (valid) GitHub token provided. Falling back to anonymous. Requests might be rate limited.");
|
||||
const octokit = new PaginatingOctokit({
|
||||
baseUrl: constants_1.GITHUB_COM_API,
|
||||
});
|
||||
const octokit = new PaginatingOctokit();
|
||||
return await getReleaseTagNames(octokit);
|
||||
}
|
||||
throw err;
|
||||
@@ -30429,7 +30426,6 @@ async function getReleaseTagNames(octokit) {
|
||||
}
|
||||
async function getLatestVersion(githubToken) {
|
||||
const octokit = new PaginatingOctokit({
|
||||
baseUrl: constants_1.GITHUB_COM_API,
|
||||
auth: githubToken,
|
||||
});
|
||||
let latestRelease;
|
||||
@@ -30439,9 +30435,7 @@ async function getLatestVersion(githubToken) {
|
||||
catch (err) {
|
||||
if (err.message.includes("Bad credentials")) {
|
||||
core.info("No (valid) GitHub token provided. Falling back to anonymous. Requests might be rate limited.");
|
||||
const octokit = new PaginatingOctokit({
|
||||
baseUrl: constants_1.GITHUB_COM_API,
|
||||
});
|
||||
const octokit = new PaginatingOctokit();
|
||||
latestRelease = await getLatestRelease(octokit);
|
||||
}
|
||||
else {
|
||||
@@ -30599,11 +30593,10 @@ run();
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
exports.GITHUB_COM_API = exports.TOOL_CACHE_NAME = exports.OWNER = exports.REPO = void 0;
|
||||
exports.TOOL_CACHE_NAME = exports.OWNER = exports.REPO = void 0;
|
||||
exports.REPO = "ruff";
|
||||
exports.OWNER = "astral-sh";
|
||||
exports.TOOL_CACHE_NAME = "ruff";
|
||||
exports.GITHUB_COM_API = "https://api.github.com";
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
+1
-2
@@ -30383,11 +30383,10 @@ run();
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
exports.GITHUB_COM_API = exports.TOOL_CACHE_NAME = exports.OWNER = exports.REPO = void 0;
|
||||
exports.TOOL_CACHE_NAME = exports.OWNER = exports.REPO = void 0;
|
||||
exports.REPO = "ruff";
|
||||
exports.OWNER = "astral-sh";
|
||||
exports.TOOL_CACHE_NAME = "ruff";
|
||||
exports.GITHUB_COM_API = "https://api.github.com";
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
Generated
+8
-16
@@ -12,13 +12,14 @@
|
||||
"@actions/core": "^1.11.1",
|
||||
"@actions/exec": "^1.1.1",
|
||||
"@actions/tool-cache": "^2.0.1",
|
||||
"@octokit/core": "^6.1.3",
|
||||
"@octokit/plugin-paginate-rest": "^11.4.0",
|
||||
"@octokit/plugin-rest-endpoint-methods": "^13.3.0",
|
||||
"smol-toml": "^1.3.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@biomejs/biome": "1.9.4",
|
||||
"@types/node": "^22.10.10",
|
||||
"@types/node": "^22.12.0",
|
||||
"@types/semver": "^7.5.8",
|
||||
"@vercel/ncc": "^0.38.3",
|
||||
"js-yaml": "^4.1.0",
|
||||
@@ -236,7 +237,6 @@
|
||||
"version": "5.1.2",
|
||||
"resolved": "https://registry.npmjs.org/@octokit/auth-token/-/auth-token-5.1.2.tgz",
|
||||
"integrity": "sha512-JcQDsBdg49Yky2w2ld20IHAlwr8d/d8N6NiOXbtuoPCqzbsiJgF633mVUw3x4mo0H5ypataQIX7SFu3yy44Mpw==",
|
||||
"peer": true,
|
||||
"engines": {
|
||||
"node": ">= 18"
|
||||
}
|
||||
@@ -245,7 +245,6 @@
|
||||
"version": "6.1.3",
|
||||
"resolved": "https://registry.npmjs.org/@octokit/core/-/core-6.1.3.tgz",
|
||||
"integrity": "sha512-z+j7DixNnfpdToYsOutStDgeRzJSMnbj8T1C/oQjB6Aa+kRfNjs/Fn7W6c8bmlt6mfy3FkgeKBRnDjxQow5dow==",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"@octokit/auth-token": "^5.0.0",
|
||||
"@octokit/graphql": "^8.1.2",
|
||||
@@ -263,7 +262,6 @@
|
||||
"version": "10.1.2",
|
||||
"resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-10.1.2.tgz",
|
||||
"integrity": "sha512-XybpFv9Ms4hX5OCHMZqyODYqGTZ3H6K6Vva+M9LR7ib/xr1y1ZnlChYv9H680y77Vd/i/k+thXApeRASBQkzhA==",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"@octokit/types": "^13.6.2",
|
||||
"universal-user-agent": "^7.0.2"
|
||||
@@ -276,7 +274,6 @@
|
||||
"version": "8.1.2",
|
||||
"resolved": "https://registry.npmjs.org/@octokit/graphql/-/graphql-8.1.2.tgz",
|
||||
"integrity": "sha512-bdlj/CJVjpaz06NBpfHhp4kGJaRZfz7AzC+6EwUImRtrwIw8dIgJ63Xg0OzV9pRn3rIzrt5c2sa++BL0JJ8GLw==",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"@octokit/request": "^9.1.4",
|
||||
"@octokit/types": "^13.6.2",
|
||||
@@ -323,7 +320,6 @@
|
||||
"version": "9.2.0",
|
||||
"resolved": "https://registry.npmjs.org/@octokit/request/-/request-9.2.0.tgz",
|
||||
"integrity": "sha512-kXLfcxhC4ozCnAXy2ff+cSxpcF0A1UqxjvYMqNuPIeOAzJbVWQ+dy5G2fTylofB/gTbObT8O6JORab+5XtA1Kw==",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"@octokit/endpoint": "^10.0.0",
|
||||
"@octokit/request-error": "^6.0.1",
|
||||
@@ -339,7 +335,6 @@
|
||||
"version": "6.1.6",
|
||||
"resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-6.1.6.tgz",
|
||||
"integrity": "sha512-pqnVKYo/at0NuOjinrgcQYpEbv4snvP3bKMRqHaD9kIsk9u1LCpb2smHZi8/qJfgeNqLo5hNW4Z7FezNdEo0xg==",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"@octokit/types": "^13.6.2"
|
||||
},
|
||||
@@ -356,9 +351,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@types/node": {
|
||||
"version": "22.10.10",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-22.10.10.tgz",
|
||||
"integrity": "sha512-X47y/mPNzxviAGY5TcYPtYL8JsY3kAq2n8fMmKoRCxq/c4v4pyGNCzM2R6+M5/umG4ZfHuT+sgqDYqWc9rJ6ww==",
|
||||
"version": "22.12.0",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-22.12.0.tgz",
|
||||
"integrity": "sha512-Fll2FZ1riMjNmlmJOdAyY5pUbkftXslB5DgEzlIuNaiWhXd00FhWxVC/r4yV/4wBb9JfImTu+jiSvXTkJ7F/gA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
@@ -389,8 +384,7 @@
|
||||
"node_modules/before-after-hook": {
|
||||
"version": "3.0.2",
|
||||
"resolved": "https://registry.npmjs.org/before-after-hook/-/before-after-hook-3.0.2.tgz",
|
||||
"integrity": "sha512-Nik3Sc0ncrMK4UUdXQmAnRtzmNQTAAXmXIopizwZ1W1t8QmfJj+zL4OA2I7XPTPW5z5TDqv4hRo/JzouDJnX3A==",
|
||||
"peer": true
|
||||
"integrity": "sha512-Nik3Sc0ncrMK4UUdXQmAnRtzmNQTAAXmXIopizwZ1W1t8QmfJj+zL4OA2I7XPTPW5z5TDqv4hRo/JzouDJnX3A=="
|
||||
},
|
||||
"node_modules/fast-content-type-parse": {
|
||||
"version": "2.0.1",
|
||||
@@ -405,8 +399,7 @@
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/fastify"
|
||||
}
|
||||
],
|
||||
"peer": true
|
||||
]
|
||||
},
|
||||
"node_modules/js-yaml": {
|
||||
"version": "4.1.0",
|
||||
@@ -481,8 +474,7 @@
|
||||
"node_modules/universal-user-agent": {
|
||||
"version": "7.0.2",
|
||||
"resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-7.0.2.tgz",
|
||||
"integrity": "sha512-0JCqzSKnStlRRQfCdowvqy3cy0Dvtlb8xecj/H8JFZuCze4rwjPZQOgvFvn0Ws/usCHQFGpyr+pB9adaGwXn4Q==",
|
||||
"peer": true
|
||||
"integrity": "sha512-0JCqzSKnStlRRQfCdowvqy3cy0Dvtlb8xecj/H8JFZuCze4rwjPZQOgvFvn0Ws/usCHQFGpyr+pB9adaGwXn4Q=="
|
||||
},
|
||||
"node_modules/uuid": {
|
||||
"version": "3.4.0",
|
||||
|
||||
+2
-1
@@ -25,13 +25,14 @@
|
||||
"@actions/core": "^1.11.1",
|
||||
"@actions/exec": "^1.1.1",
|
||||
"@actions/tool-cache": "^2.0.1",
|
||||
"@octokit/core": "^6.1.3",
|
||||
"@octokit/plugin-paginate-rest": "^11.4.0",
|
||||
"@octokit/plugin-rest-endpoint-methods": "^13.3.0",
|
||||
"smol-toml": "^1.3.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@biomejs/biome": "1.9.4",
|
||||
"@types/node": "^22.10.10",
|
||||
"@types/node": "^22.12.0",
|
||||
"@types/semver": "^7.5.8",
|
||||
"@vercel/ncc": "^0.38.3",
|
||||
"js-yaml": "^4.1.0",
|
||||
|
||||
@@ -2,12 +2,7 @@ import * as core from "@actions/core";
|
||||
import * as tc from "@actions/tool-cache";
|
||||
import * as path from "node:path";
|
||||
import { promises as fs } from "node:fs";
|
||||
import {
|
||||
GITHUB_COM_API,
|
||||
OWNER,
|
||||
REPO,
|
||||
TOOL_CACHE_NAME,
|
||||
} from "../utils/constants";
|
||||
import { OWNER, REPO, TOOL_CACHE_NAME } from "../utils/constants";
|
||||
import type { Architecture, Platform } from "../utils/platforms";
|
||||
import { validateChecksum } from "./checksum/checksum";
|
||||
import { Octokit } from "@octokit/core";
|
||||
@@ -96,7 +91,6 @@ async function getAvailableVersions(githubToken: string): Promise<string[]> {
|
||||
try {
|
||||
const octokit = new PaginatingOctokit({
|
||||
auth: githubToken,
|
||||
baseUrl: GITHUB_COM_API,
|
||||
});
|
||||
return await getReleaseTagNames(octokit);
|
||||
} catch (err) {
|
||||
@@ -104,9 +98,7 @@ async function getAvailableVersions(githubToken: string): Promise<string[]> {
|
||||
core.info(
|
||||
"No (valid) GitHub token provided. Falling back to anonymous. Requests might be rate limited.",
|
||||
);
|
||||
const octokit = new PaginatingOctokit({
|
||||
baseUrl: GITHUB_COM_API,
|
||||
});
|
||||
const octokit = new PaginatingOctokit();
|
||||
return await getReleaseTagNames(octokit);
|
||||
}
|
||||
throw err;
|
||||
@@ -125,7 +117,6 @@ async function getReleaseTagNames(
|
||||
|
||||
async function getLatestVersion(githubToken: string) {
|
||||
const octokit = new PaginatingOctokit({
|
||||
baseUrl: GITHUB_COM_API,
|
||||
auth: githubToken,
|
||||
});
|
||||
|
||||
@@ -137,9 +128,7 @@ async function getLatestVersion(githubToken: string) {
|
||||
core.info(
|
||||
"No (valid) GitHub token provided. Falling back to anonymous. Requests might be rate limited.",
|
||||
);
|
||||
const octokit = new PaginatingOctokit({
|
||||
baseUrl: GITHUB_COM_API,
|
||||
});
|
||||
const octokit = new PaginatingOctokit();
|
||||
latestRelease = await getLatestRelease(octokit);
|
||||
} else {
|
||||
throw err;
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
export const REPO = "ruff";
|
||||
export const OWNER = "astral-sh";
|
||||
export const TOOL_CACHE_NAME = "ruff";
|
||||
export const GITHUB_COM_API = "https://api.github.com";
|
||||
|
||||
Reference in New Issue
Block a user