actions-up 1.14.0 → 1.14.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli/build-json-report.js +18 -18
- package/dist/cli/index.js +101 -101
- package/dist/cli/merge-scan-results.js +2 -2
- package/dist/cli/normalize-update-mode.js +2 -2
- package/dist/cli/normalize-update-style.js +2 -2
- package/dist/cli/print-mode-warning.js +5 -5
- package/dist/cli/print-skipped-warning.js +7 -7
- package/dist/cli/resolve-scan-directories.js +8 -8
- package/dist/cli/validate-cli-options.js +2 -2
- package/dist/core/api/check-updates.js +114 -113
- package/dist/core/api/create-github-client.js +26 -26
- package/dist/core/api/get-all-releases.js +12 -12
- package/dist/core/api/get-all-tags.js +4 -4
- package/dist/core/api/get-compatible-update.js +6 -6
- package/dist/core/api/get-latest-release.js +15 -15
- package/dist/core/api/get-reference-type.js +5 -5
- package/dist/core/api/get-tag-info.js +14 -14
- package/dist/core/api/get-tag-sha.js +7 -7
- package/dist/core/api/internal-rate-limit-error.js +2 -2
- package/dist/core/api/make-request.js +4 -4
- package/dist/core/api/resolve-github-token-sync.js +7 -7
- package/dist/core/api/update-rate-limit-info.js +3 -6
- package/dist/core/ast/guards/has-range.js +2 -2
- package/dist/core/ast/guards/is-node.js +2 -2
- package/dist/core/ast/guards/is-pair.js +2 -2
- package/dist/core/ast/guards/is-scalar.js +2 -2
- package/dist/core/ast/guards/is-yaml-map.js +2 -2
- package/dist/core/ast/guards/is-yaml-sequence.js +2 -2
- package/dist/core/ast/scanners/scan-composite-action-ast.js +13 -13
- package/dist/core/ast/scanners/scan-workflow-ast.js +21 -21
- package/dist/core/ast/update/apply-updates.js +24 -24
- package/dist/core/ast/utils/extract-uses-from-steps.js +14 -14
- package/dist/core/ast/utils/find-map-pair.js +6 -6
- package/dist/core/ast/utils/get-line-number.js +4 -4
- package/dist/core/constants.js +2 -2
- package/dist/core/filters/parse-exclude-patterns.js +2 -2
- package/dist/core/fs/find-yaml-files-recursive.js +9 -9
- package/dist/core/fs/is-yaml-file.js +2 -2
- package/dist/core/fs/read-yaml-document.js +6 -6
- package/dist/core/ignore/should-ignore.js +4 -4
- package/dist/core/index.js +5 -5
- package/dist/core/interactive/format-version.js +14 -14
- package/dist/core/interactive/pad-string.js +4 -4
- package/dist/core/interactive/prompt-update-selection.js +153 -138
- package/dist/core/interactive/strip-ansi.js +2 -2
- package/dist/core/parsing/parse-action-reference.js +2 -2
- package/dist/core/scan-action-file.js +6 -6
- package/dist/core/scan-github-actions.js +83 -83
- package/dist/core/scan-recursive.js +24 -24
- package/dist/core/scan-workflow-file.js +6 -6
- package/dist/core/schema/composite/is-composite-action-runs.js +2 -2
- package/dist/core/schema/composite/is-composite-action-structure.js +2 -2
- package/dist/core/schema/workflow/is-workflow-structure.js +2 -2
- package/dist/core/updates/resolve-target-reference.js +26 -15
- package/dist/core/versions/find-compatible-tag.js +16 -16
- package/dist/core/versions/get-update-level.js +8 -8
- package/dist/core/versions/is-semver-like.js +2 -2
- package/dist/core/versions/is-sha.js +2 -2
- package/dist/core/versions/normalize-version.js +4 -4
- package/dist/core/versions/preserve-tag-format.d.ts +17 -0
- package/dist/core/versions/preserve-tag-format.js +11 -0
- package/dist/core/versions/read-inline-version-comment.js +4 -4
- package/dist/package.js +2 -2
- package/package.json +3 -3
- package/readme.md +8 -6
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { makeRequest } from "./make-request.js";
|
|
2
|
-
import { GitHubRateLimitError } from "./internal-rate-limit-error.js";
|
|
3
|
-
async function
|
|
1
|
+
import { makeRequest as e } from "./make-request.js";
|
|
2
|
+
import { GitHubRateLimitError as t } from "./internal-rate-limit-error.js";
|
|
3
|
+
async function n(n, r) {
|
|
4
4
|
let { owner: i, repo: a, tag: o } = r, s = o.replace(/^refs\/tags\//u, ""), c = `${i}/${a}#${s}`;
|
|
5
5
|
if (n.caches.tagSha.has(c)) return n.caches.tagSha.get(c) ?? null;
|
|
6
6
|
try {
|
|
7
|
-
let t = (await
|
|
7
|
+
let t = (await e(n, `/repos/${i}/${a}/git/refs/tags/${s}`)).data, r = t.object.sha, o = t.object.type, l = null;
|
|
8
8
|
if (r && o === "tag") try {
|
|
9
|
-
l = (await
|
|
9
|
+
l = (await e(n, `/repos/${i}/${a}/git/tags/${r}`)).data.object.sha ?? null;
|
|
10
10
|
} catch {
|
|
11
11
|
l = r;
|
|
12
12
|
}
|
|
13
13
|
else r && o === "commit" && (l = r);
|
|
14
14
|
return n.caches.tagSha.set(c, l), l;
|
|
15
15
|
} catch (e) {
|
|
16
|
-
if (e instanceof Error && e.message.includes("rate limit")) throw new
|
|
16
|
+
if (e instanceof Error && e.message.includes("rate limit")) throw new t(n.rateLimitReset);
|
|
17
17
|
return n.caches.tagSha.set(c, null), null;
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
|
-
export { getTagSha };
|
|
20
|
+
export { n as getTagSha };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
var
|
|
1
|
+
var e = class extends Error {
|
|
2
2
|
constructor(e) {
|
|
3
3
|
let t = e.toLocaleTimeString();
|
|
4
4
|
super(`GitHub API rate limit exceeded. Resets at ${t}`), this.name = "GitHubRateLimitError";
|
|
5
5
|
}
|
|
6
6
|
};
|
|
7
|
-
export { GitHubRateLimitError };
|
|
7
|
+
export { e as GitHubRateLimitError };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { updateRateLimitInfo } from "./update-rate-limit-info.js";
|
|
2
|
-
async function
|
|
1
|
+
import { updateRateLimitInfo as e } from "./update-rate-limit-info.js";
|
|
2
|
+
async function t(t, n, r = {}) {
|
|
3
3
|
let i = {
|
|
4
4
|
Accept: "application/vnd.github.v3+json",
|
|
5
5
|
"User-Agent": "actions-up",
|
|
@@ -11,7 +11,7 @@ async function makeRequest(t, n, r = {}) {
|
|
|
11
11
|
headers: i
|
|
12
12
|
}), o = {};
|
|
13
13
|
for (let [e, t] of a.headers.entries()) o[e] = t;
|
|
14
|
-
if (
|
|
14
|
+
if (e(t, o), !a.ok) {
|
|
15
15
|
let e = /* @__PURE__ */ Error(`GitHub API error: ${a.status} ${a.statusText}`);
|
|
16
16
|
if (e.status = a.status, a.status === 403) {
|
|
17
17
|
let t = await a.text();
|
|
@@ -24,4 +24,4 @@ async function makeRequest(t, n, r = {}) {
|
|
|
24
24
|
data: await a.json()
|
|
25
25
|
};
|
|
26
26
|
}
|
|
27
|
-
export { makeRequest };
|
|
27
|
+
export { t as makeRequest };
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { join } from "node:path";
|
|
2
|
-
import { execFileSync } from "node:child_process";
|
|
3
|
-
import { readFileSync } from "node:fs";
|
|
4
|
-
function
|
|
1
|
+
import { join as e } from "node:path";
|
|
2
|
+
import { execFileSync as t } from "node:child_process";
|
|
3
|
+
import { readFileSync as n } from "node:fs";
|
|
4
|
+
function r() {
|
|
5
5
|
let r = process.env.GITHUB_TOKEN;
|
|
6
6
|
if (r && r.trim() !== "") return r.trim();
|
|
7
7
|
let i = process.env.GH_TOKEN;
|
|
8
8
|
if (i && i.trim() !== "") return i.trim();
|
|
9
9
|
try {
|
|
10
|
-
let e =
|
|
10
|
+
let e = t("gh", ["auth", "token"], {
|
|
11
11
|
stdio: [
|
|
12
12
|
"ignore",
|
|
13
13
|
"pipe",
|
|
@@ -19,7 +19,7 @@ function resolveGitHubTokenSync() {
|
|
|
19
19
|
if (e) return e;
|
|
20
20
|
} catch {}
|
|
21
21
|
try {
|
|
22
|
-
let t =
|
|
22
|
+
let t = n(e(process.cwd(), ".git", "config"), "utf8"), r = t.match(/^\s*(?:github\.(?:oauth-token|token)|hub\.oauthtoken)\s*=\s*(?<token>\S[^\n\r]*)$/mu)?.groups?.token?.trim();
|
|
23
23
|
if (r) return r;
|
|
24
24
|
let i = null;
|
|
25
25
|
for (let e of t.split(/\r?\n/u)) {
|
|
@@ -39,4 +39,4 @@ function resolveGitHubTokenSync() {
|
|
|
39
39
|
}
|
|
40
40
|
} catch {}
|
|
41
41
|
}
|
|
42
|
-
export { resolveGitHubTokenSync };
|
|
42
|
+
export { r as resolveGitHubTokenSync };
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
function
|
|
1
|
+
function e(e, t) {
|
|
2
2
|
let n = t["x-ratelimit-remaining"];
|
|
3
3
|
n !== void 0 && (e.rateLimitRemaining = typeof n == "string" ? Number.parseInt(n, 10) : n);
|
|
4
4
|
let r = t["x-ratelimit-reset"];
|
|
5
|
-
|
|
6
|
-
let t = typeof r == "string" ? Number.parseInt(r, 10) : r;
|
|
7
|
-
e.rateLimitReset = /* @__PURE__ */ new Date(t * 1e3);
|
|
8
|
-
}
|
|
5
|
+
r !== void 0 && (e.rateLimitReset = /* @__PURE__ */ new Date((typeof r == "string" ? Number.parseInt(r, 10) : r) * 1e3));
|
|
9
6
|
}
|
|
10
|
-
export { updateRateLimitInfo };
|
|
7
|
+
export { e as updateRateLimitInfo };
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { isCompositeActionStructure } from "../../schema/composite/is-composite-action-structure.js";
|
|
2
|
-
import { isCompositeActionRuns } from "../../schema/composite/is-composite-action-runs.js";
|
|
3
|
-
import { isYAMLMap } from "../guards/is-yaml-map.js";
|
|
4
|
-
import { extractUsesFromSteps } from "../utils/extract-uses-from-steps.js";
|
|
5
|
-
import { findMapPair } from "../utils/find-map-pair.js";
|
|
6
|
-
function
|
|
1
|
+
import { isCompositeActionStructure as e } from "../../schema/composite/is-composite-action-structure.js";
|
|
2
|
+
import { isCompositeActionRuns as t } from "../../schema/composite/is-composite-action-runs.js";
|
|
3
|
+
import { isYAMLMap as n } from "../guards/is-yaml-map.js";
|
|
4
|
+
import { extractUsesFromSteps as r } from "../utils/extract-uses-from-steps.js";
|
|
5
|
+
import { findMapPair as i } from "../utils/find-map-pair.js";
|
|
6
|
+
function a(a, o, s) {
|
|
7
7
|
let c = a.toJSON();
|
|
8
|
-
if (!
|
|
9
|
-
let l =
|
|
10
|
-
if (!l?.value || !
|
|
8
|
+
if (!e(c) || !a.contents || !n(a.contents)) return [];
|
|
9
|
+
let l = i(a.contents, "runs");
|
|
10
|
+
if (!l?.value || !n(l.value)) return [];
|
|
11
11
|
let u = c.runs;
|
|
12
|
-
if (!u || !
|
|
13
|
-
let d =
|
|
14
|
-
return d?.value ?
|
|
12
|
+
if (!u || !t(u) || !u.steps || !Array.isArray(u.steps)) return [];
|
|
13
|
+
let d = i(l.value, "steps");
|
|
14
|
+
return d?.value ? r({
|
|
15
15
|
stepsNode: d.value,
|
|
16
16
|
filePath: s,
|
|
17
17
|
content: o
|
|
18
18
|
}) : [];
|
|
19
19
|
}
|
|
20
|
-
export { scanCompositeActionAst };
|
|
20
|
+
export { a as scanCompositeActionAst };
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import { parseActionReference } from "../../parsing/parse-action-reference.js";
|
|
2
|
-
import { getLineNumberForKey } from "../utils/get-line-number.js";
|
|
3
|
-
import { isYAMLMap } from "../guards/is-yaml-map.js";
|
|
4
|
-
import { isScalar } from "../guards/is-scalar.js";
|
|
5
|
-
import { isNode } from "../guards/is-node.js";
|
|
6
|
-
import { isPair } from "../guards/is-pair.js";
|
|
7
|
-
import { extractUsesFromSteps } from "../utils/extract-uses-from-steps.js";
|
|
8
|
-
import { findMapPair } from "../utils/find-map-pair.js";
|
|
9
|
-
import { isWorkflowStructure } from "../../schema/workflow/is-workflow-structure.js";
|
|
10
|
-
function
|
|
11
|
-
if (!
|
|
12
|
-
let f =
|
|
13
|
-
if (!f?.value || !
|
|
1
|
+
import { parseActionReference as e } from "../../parsing/parse-action-reference.js";
|
|
2
|
+
import { getLineNumberForKey as t } from "../utils/get-line-number.js";
|
|
3
|
+
import { isYAMLMap as n } from "../guards/is-yaml-map.js";
|
|
4
|
+
import { isScalar as r } from "../guards/is-scalar.js";
|
|
5
|
+
import { isNode as i } from "../guards/is-node.js";
|
|
6
|
+
import { isPair as a } from "../guards/is-pair.js";
|
|
7
|
+
import { extractUsesFromSteps as o } from "../utils/extract-uses-from-steps.js";
|
|
8
|
+
import { findMapPair as s } from "../utils/find-map-pair.js";
|
|
9
|
+
import { isWorkflowStructure as c } from "../../schema/workflow/is-workflow-structure.js";
|
|
10
|
+
function l(l, u, d) {
|
|
11
|
+
if (!c(l.toJSON()) || !l.contents || !n(l.contents)) return [];
|
|
12
|
+
let f = s(l.contents, "jobs");
|
|
13
|
+
if (!f?.value || !n(f.value)) return [];
|
|
14
14
|
let p = [];
|
|
15
15
|
for (let c of f.value.items) {
|
|
16
|
-
if (!
|
|
17
|
-
let l =
|
|
18
|
-
if (f?.value && f.key &&
|
|
19
|
-
let
|
|
20
|
-
|
|
16
|
+
if (!a(c) || !c.value || !i(c.value) || !n(c.value)) continue;
|
|
17
|
+
let l = r(c.key) ? String(c.key.value) : void 0, f = s(c.value, "uses");
|
|
18
|
+
if (f?.value && f.key && r(f.value)) {
|
|
19
|
+
let n = e(String(f.value.value), d, t(u, f.key));
|
|
20
|
+
n && (l && (n.job = l), p.push(n));
|
|
21
21
|
}
|
|
22
|
-
let m =
|
|
23
|
-
m?.value && p.push(...
|
|
22
|
+
let m = s(c.value, "steps");
|
|
23
|
+
m?.value && p.push(...o({
|
|
24
24
|
stepsNode: m.value,
|
|
25
25
|
filePath: d,
|
|
26
26
|
content: u,
|
|
@@ -29,4 +29,4 @@ function scanWorkflowAst(l, u, d) {
|
|
|
29
29
|
}
|
|
30
30
|
return p;
|
|
31
31
|
}
|
|
32
|
-
export { scanWorkflowAst };
|
|
32
|
+
export { l as scanWorkflowAst };
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { readFile, writeFile } from "node:fs/promises";
|
|
2
|
-
async function
|
|
1
|
+
import { readFile as e, writeFile as t } from "node:fs/promises";
|
|
2
|
+
async function n(n) {
|
|
3
3
|
let i = /* @__PURE__ */ new Map();
|
|
4
|
-
for (let e of
|
|
5
|
-
let { file:
|
|
6
|
-
if (!
|
|
7
|
-
let
|
|
8
|
-
|
|
4
|
+
for (let e of n) {
|
|
5
|
+
let { file: t } = e.action;
|
|
6
|
+
if (!t) continue;
|
|
7
|
+
let n = i.get(t) ?? [];
|
|
8
|
+
n.push(e), i.set(t, n);
|
|
9
9
|
}
|
|
10
|
-
let a = [...i.entries()].map(async ([
|
|
11
|
-
let a = await
|
|
10
|
+
let a = [...i.entries()].map(async ([n, i]) => {
|
|
11
|
+
let a = await e(n, "utf8");
|
|
12
12
|
for (let e of i) {
|
|
13
|
-
let
|
|
14
|
-
if (!
|
|
13
|
+
let t = e.targetRef ?? e.latestSha, n = e.targetRefStyle ?? (e.latestSha ? "sha" : null);
|
|
14
|
+
if (!t || !n) continue;
|
|
15
15
|
function i(e) {
|
|
16
16
|
return e.replaceAll(/[$()*+\-./?[\\\]^{|}]/gu, String.raw`\$&`);
|
|
17
17
|
}
|
|
18
|
-
let o = i(e.action.name), s = e.currentVersion ? i(e.currentVersion) : "";
|
|
18
|
+
let o = i(e.action.name), s = e.currentVersion ? i(e.currentVersion) : "", c = s ? String.raw`(?=(?:['"]|[ \t\]}{,#]|$))` : "";
|
|
19
19
|
if (o.includes("\n") || o.includes("\r")) {
|
|
20
20
|
console.error(`Invalid action name: ${e.action.name}`);
|
|
21
21
|
continue;
|
|
@@ -24,30 +24,30 @@ async function applyUpdates(r) {
|
|
|
24
24
|
console.error(`Invalid version: ${e.currentVersion}`);
|
|
25
25
|
continue;
|
|
26
26
|
}
|
|
27
|
-
if (
|
|
28
|
-
console.error(`Invalid target ref: ${
|
|
27
|
+
if (t.includes("\n") || t.includes("\r") || t.trim() === "") {
|
|
28
|
+
console.error(`Invalid target ref: ${t}`);
|
|
29
29
|
continue;
|
|
30
30
|
}
|
|
31
|
-
if (
|
|
32
|
-
console.error(`Invalid SHA format: ${
|
|
31
|
+
if (n === "sha" && !/^[\da-f]{40}$/iu.test(t)) {
|
|
32
|
+
console.error(`Invalid SHA format: ${t}`);
|
|
33
33
|
continue;
|
|
34
34
|
}
|
|
35
|
-
let
|
|
36
|
-
a = a.replace(
|
|
35
|
+
let l = String.raw`['"]?\buses\b['"]?\s*:\s*`, u = String.raw`(?:^[^\S\n]*(?:-[^\S\n]*)?|[{\[,][^\S\n]*)` + l, d = new RegExp(String.raw`(?<prefix>${u})` + String.raw`(?<quote>['"]?)` + String.raw`(?<name>${o})@${s}${c}` + String.raw`\k<quote>` + String.raw`(?<after>[ \t\]}{,]*)` + String.raw`(?<comment>[^\S\r\n]*#[^\r\n]*)?`, "gm");
|
|
36
|
+
a = a.replace(d, (i, ...a) => {
|
|
37
37
|
let o = a.at(-3), c = a.at(-2), l = a.at(-1), u = c.indexOf("\n", o + i.length), d = (u === -1 ? c.slice(o + i.length) : c.slice(o + i.length, u)).trim().length > 0, f = l.after.endsWith(" ") ? "" : " ", p = "";
|
|
38
|
-
if (
|
|
39
|
-
else if (l.comment && !
|
|
38
|
+
if (n === "sha") p = d && !l.comment && s !== "" ? "" : `${f}# ${e.latestVersion}`;
|
|
39
|
+
else if (l.comment && !r(l.comment)) {
|
|
40
40
|
let { comment: e } = l;
|
|
41
41
|
p = e;
|
|
42
42
|
}
|
|
43
|
-
return `${`${l.prefix}${l.quote}${l.name}`}@${`${
|
|
43
|
+
return `${`${l.prefix}${l.quote}${l.name}`}@${`${t}${l.quote}${l.after}${p}`}`;
|
|
44
44
|
});
|
|
45
45
|
}
|
|
46
|
-
await
|
|
46
|
+
await t(n, a, "utf8");
|
|
47
47
|
});
|
|
48
48
|
await Promise.all(a);
|
|
49
49
|
}
|
|
50
|
-
function
|
|
50
|
+
function r(e) {
|
|
51
51
|
return /^#\s*[Vv]?\d+(?:\.\d+){0,2}(?:[+-][\w\-.]+)?\s*$/u.test(e.trim());
|
|
52
52
|
}
|
|
53
|
-
export { applyUpdates };
|
|
53
|
+
export { n as applyUpdates };
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import { parseActionReference } from "../../parsing/parse-action-reference.js";
|
|
2
|
-
import { isYAMLSequence } from "../guards/is-yaml-sequence.js";
|
|
3
|
-
import { getLineNumberForKey } from "./get-line-number.js";
|
|
4
|
-
import { isYAMLMap } from "../guards/is-yaml-map.js";
|
|
5
|
-
import { isScalar } from "../guards/is-scalar.js";
|
|
6
|
-
import { isNode } from "../guards/is-node.js";
|
|
7
|
-
import { isPair } from "../guards/is-pair.js";
|
|
8
|
-
function
|
|
1
|
+
import { parseActionReference as e } from "../../parsing/parse-action-reference.js";
|
|
2
|
+
import { isYAMLSequence as t } from "../guards/is-yaml-sequence.js";
|
|
3
|
+
import { getLineNumberForKey as n } from "./get-line-number.js";
|
|
4
|
+
import { isYAMLMap as r } from "../guards/is-yaml-map.js";
|
|
5
|
+
import { isScalar as i } from "../guards/is-scalar.js";
|
|
6
|
+
import { isNode as a } from "../guards/is-node.js";
|
|
7
|
+
import { isPair as o } from "../guards/is-pair.js";
|
|
8
|
+
function s(s) {
|
|
9
9
|
let { stepsNode: c, filePath: l, content: u, jobName: d } = s;
|
|
10
|
-
if (!
|
|
10
|
+
if (!t(c)) return [];
|
|
11
11
|
let f = [];
|
|
12
|
-
for (let
|
|
13
|
-
if (!
|
|
14
|
-
let s =
|
|
12
|
+
for (let t of c.items) {
|
|
13
|
+
if (!r(t) || !a(t)) continue;
|
|
14
|
+
let s = t.toJSON();
|
|
15
15
|
if (typeof s != "object" || !s || Array.isArray(s)) continue;
|
|
16
16
|
let c = s;
|
|
17
17
|
if (typeof c.uses != "string") continue;
|
|
18
|
-
let p =
|
|
18
|
+
let p = t.items.find((e) => o(e) && i(e.key) && e.key.value === "uses"), m = p?.key ? n(u, p.key) : 0, h = e(c.uses, l, m);
|
|
19
19
|
h && (d && (h.job = d), f.push(h));
|
|
20
20
|
}
|
|
21
21
|
return f;
|
|
22
22
|
}
|
|
23
|
-
export { extractUsesFromSteps };
|
|
23
|
+
export { s as extractUsesFromSteps };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { isYAMLMap } from "../guards/is-yaml-map.js";
|
|
2
|
-
import { isScalar } from "../guards/is-scalar.js";
|
|
3
|
-
import { isPair } from "../guards/is-pair.js";
|
|
4
|
-
function
|
|
5
|
-
return !
|
|
1
|
+
import { isYAMLMap as e } from "../guards/is-yaml-map.js";
|
|
2
|
+
import { isScalar as t } from "../guards/is-scalar.js";
|
|
3
|
+
import { isPair as n } from "../guards/is-pair.js";
|
|
4
|
+
function r(r, i) {
|
|
5
|
+
return !e(r) || !Array.isArray(r.items) ? null : r.items.find((e) => n(e) && t(e.key) && e.key.value === i) ?? null;
|
|
6
6
|
}
|
|
7
|
-
export { findMapPair };
|
|
7
|
+
export { r as findMapPair };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { hasRange } from "../guards/has-range.js";
|
|
2
|
-
function
|
|
3
|
-
if (
|
|
1
|
+
import { hasRange as e } from "../guards/has-range.js";
|
|
2
|
+
function t(t, n) {
|
|
3
|
+
if (e(n) && n.range) {
|
|
4
4
|
let [e] = n.range;
|
|
5
5
|
if (typeof e == "number" && Number.isFinite(e)) return t.slice(0, Math.max(0, e)).split("\n").length;
|
|
6
6
|
}
|
|
7
7
|
return 0;
|
|
8
8
|
}
|
|
9
|
-
export { getLineNumberForKey };
|
|
9
|
+
export { t as getLineNumberForKey };
|
package/dist/core/constants.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
export { ACTIONS_DIRECTORY, GITHUB_DIRECTORY, WORKFLOWS_DIRECTORY };
|
|
1
|
+
var e = ".github", t = "workflows", n = "actions";
|
|
2
|
+
export { n as ACTIONS_DIRECTORY, e as GITHUB_DIRECTORY, t as WORKFLOWS_DIRECTORY };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function
|
|
1
|
+
function e(e) {
|
|
2
2
|
let t = [];
|
|
3
3
|
for (let n of e) {
|
|
4
4
|
let e = n.trim();
|
|
@@ -20,4 +20,4 @@ function parseExcludePatterns(e) {
|
|
|
20
20
|
}
|
|
21
21
|
return t;
|
|
22
22
|
}
|
|
23
|
-
export { parseExcludePatterns };
|
|
23
|
+
export { e as parseExcludePatterns };
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { isYamlFile } from "./is-yaml-file.js";
|
|
2
|
-
import { join } from "node:path";
|
|
3
|
-
import { lstat, readdir } from "node:fs/promises";
|
|
4
|
-
async function
|
|
1
|
+
import { isYamlFile as e } from "./is-yaml-file.js";
|
|
2
|
+
import { join as t } from "node:path";
|
|
3
|
+
import { lstat as n, readdir as r } from "node:fs/promises";
|
|
4
|
+
async function i(i) {
|
|
5
5
|
let a = [], o = /* @__PURE__ */ new Set();
|
|
6
6
|
async function s(i) {
|
|
7
|
-
if ((await
|
|
7
|
+
if ((await n(i)).isSymbolicLink() || o.has(i)) return;
|
|
8
8
|
o.add(i);
|
|
9
|
-
let c = (await
|
|
9
|
+
let c = (await r(i)).map(async (r) => {
|
|
10
10
|
try {
|
|
11
|
-
let o =
|
|
11
|
+
let o = t(i, r), c = await n(o);
|
|
12
12
|
if (c.isSymbolicLink()) return;
|
|
13
|
-
c.isDirectory() ? await s(o) : c.isFile() &&
|
|
13
|
+
c.isDirectory() ? await s(o) : c.isFile() && e(r) && a.push(o);
|
|
14
14
|
} catch {}
|
|
15
15
|
});
|
|
16
16
|
await Promise.all(c);
|
|
17
17
|
}
|
|
18
18
|
return await s(i), a;
|
|
19
19
|
}
|
|
20
|
-
export { findYamlFilesRecursive };
|
|
20
|
+
export { i as findYamlFilesRecursive };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { readFile } from "node:fs/promises";
|
|
2
|
-
import { parseDocument } from "yaml";
|
|
3
|
-
async function
|
|
4
|
-
let r = await
|
|
1
|
+
import { readFile as e } from "node:fs/promises";
|
|
2
|
+
import { parseDocument as t } from "yaml";
|
|
3
|
+
async function n(n) {
|
|
4
|
+
let r = await e(n, "utf8");
|
|
5
5
|
return {
|
|
6
|
-
document:
|
|
6
|
+
document: t(r),
|
|
7
7
|
content: r
|
|
8
8
|
};
|
|
9
9
|
}
|
|
10
|
-
export { readYamlDocument };
|
|
10
|
+
export { n as readYamlDocument };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { readFile } from "node:fs/promises";
|
|
2
|
-
async function
|
|
1
|
+
import { readFile as e } from "node:fs/promises";
|
|
2
|
+
async function t(t, n) {
|
|
3
3
|
if (!t) return !1;
|
|
4
|
-
let r = (await
|
|
4
|
+
let r = (await e(t, "utf8")).split("\n");
|
|
5
5
|
for (let e of r) if (e.includes("actions-up-ignore-file")) return !0;
|
|
6
6
|
if (!n || n <= 0) return !1;
|
|
7
7
|
let i = /* @__PURE__ */ new Set(), a = !1;
|
|
@@ -11,4 +11,4 @@ async function shouldIgnore(t, n) {
|
|
|
11
11
|
}
|
|
12
12
|
return i.has(n);
|
|
13
13
|
}
|
|
14
|
-
export { shouldIgnore };
|
|
14
|
+
export { t as shouldIgnore };
|
package/dist/core/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { applyUpdates } from "./ast/update/apply-updates.js";
|
|
2
|
-
import { checkUpdates } from "./api/check-updates.js";
|
|
3
|
-
import { scanRecursive } from "./scan-recursive.js";
|
|
4
|
-
import { scanGitHubActions } from "./scan-github-actions.js";
|
|
5
|
-
export { applyUpdates, checkUpdates, scanGitHubActions, scanRecursive };
|
|
1
|
+
import { applyUpdates as e } from "./ast/update/apply-updates.js";
|
|
2
|
+
import { checkUpdates as t } from "./api/check-updates.js";
|
|
3
|
+
import { scanRecursive as n } from "./scan-recursive.js";
|
|
4
|
+
import { scanGitHubActions as r } from "./scan-github-actions.js";
|
|
5
|
+
export { e as applyUpdates, t as checkUpdates, r as scanGitHubActions, n as scanRecursive };
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
function
|
|
4
|
-
if (!
|
|
5
|
-
let o =
|
|
6
|
-
if (!s || !o) return
|
|
7
|
-
let c =
|
|
1
|
+
import e from "picocolors";
|
|
2
|
+
import t from "semver";
|
|
3
|
+
function n(n, a) {
|
|
4
|
+
if (!n) return e.gray("unknown");
|
|
5
|
+
let o = t.parse(n), s = a ? t.parse(r(a)) : null;
|
|
6
|
+
if (!s || !o) return n;
|
|
7
|
+
let c = t.diff(r(a), n), l = s.major === 0 ? e.yellowBright : e.gray, u = [
|
|
8
8
|
o.major,
|
|
9
9
|
o.minor,
|
|
10
10
|
o.patch
|
|
11
|
-
], d = u.map((
|
|
11
|
+
], d = u.map((t, n) => c === "major" ? e.redBright : c === "minor" && n >= 1 || c === "patch" && n === 2 ? l : i), f = d[0](String(u[0]));
|
|
12
12
|
return u[1] !== void 0 && (f += d[0](".") + d[1](String(u[1]))), u[2] !== void 0 && (f += d[1](".") + d[2](String(u[2]))), f;
|
|
13
13
|
}
|
|
14
|
-
function
|
|
15
|
-
let
|
|
16
|
-
for (;
|
|
17
|
-
return
|
|
14
|
+
function r(e) {
|
|
15
|
+
let t = e.replace(/^v/u, "").split(".");
|
|
16
|
+
for (; t.length < 3;) t.push("0");
|
|
17
|
+
return t.slice(0, 3).join(".");
|
|
18
18
|
}
|
|
19
|
-
function
|
|
19
|
+
function i(e) {
|
|
20
20
|
return e;
|
|
21
21
|
}
|
|
22
|
-
export { formatVersion };
|
|
22
|
+
export { n as formatVersion };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { stripAnsi } from "./strip-ansi.js";
|
|
2
|
-
function
|
|
3
|
-
let r = n -
|
|
1
|
+
import { stripAnsi as e } from "./strip-ansi.js";
|
|
2
|
+
function t(t, n) {
|
|
3
|
+
let r = n - e(t).length;
|
|
4
4
|
return r <= 0 ? t : t + " ".repeat(r);
|
|
5
5
|
}
|
|
6
|
-
export { padString };
|
|
6
|
+
export { t as padString };
|