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,6 +1,6 @@
|
|
|
1
|
-
import { isAbsolute, relative, resolve } from "node:path";
|
|
2
|
-
function
|
|
3
|
-
let
|
|
1
|
+
import { isAbsolute as e, relative as t, resolve as n } from "node:path";
|
|
2
|
+
function r(e) {
|
|
3
|
+
let t = n(e.cwd ?? process.cwd());
|
|
4
4
|
return {
|
|
5
5
|
summary: {
|
|
6
6
|
totalBreakingUpdates: e.outdated.filter((e) => e.isBreaking).length,
|
|
@@ -13,7 +13,7 @@ function buildJsonReport(e) {
|
|
|
13
13
|
totalSkipped: e.skipped.length
|
|
14
14
|
},
|
|
15
15
|
options: {
|
|
16
|
-
directories: e.directories.map((e) =>
|
|
16
|
+
directories: e.directories.map((e) => o(e, t)),
|
|
17
17
|
excludePatterns: e.excludePatterns,
|
|
18
18
|
includeBranches: e.includeBranches,
|
|
19
19
|
recursive: e.recursive,
|
|
@@ -23,17 +23,17 @@ function buildJsonReport(e) {
|
|
|
23
23
|
reportOnly: !0,
|
|
24
24
|
json: !0
|
|
25
25
|
},
|
|
26
|
-
blockedByMode: e.blockedByMode.map((e) =>
|
|
27
|
-
updates: e.outdated.map((e) =>
|
|
28
|
-
skipped: e.skipped.map((e) =>
|
|
26
|
+
blockedByMode: e.blockedByMode.map((e) => i(e, t)),
|
|
27
|
+
updates: e.outdated.map((e) => i(e, t)),
|
|
28
|
+
skipped: e.skipped.map((e) => i(e, t)),
|
|
29
29
|
status: e.status,
|
|
30
30
|
schemaVersion: 1
|
|
31
31
|
};
|
|
32
32
|
}
|
|
33
|
-
function
|
|
33
|
+
function i(e, t) {
|
|
34
34
|
return {
|
|
35
35
|
action: {
|
|
36
|
-
file:
|
|
36
|
+
file: a(e.action.file, t),
|
|
37
37
|
version: e.action.version ?? null,
|
|
38
38
|
line: e.action.line ?? null,
|
|
39
39
|
uses: e.action.uses ?? null,
|
|
@@ -55,14 +55,14 @@ function serializeUpdate(e, n) {
|
|
|
55
55
|
latestSha: e.latestSha
|
|
56
56
|
};
|
|
57
57
|
}
|
|
58
|
-
function
|
|
59
|
-
if (!
|
|
60
|
-
if (!
|
|
61
|
-
let
|
|
62
|
-
return
|
|
58
|
+
function a(n, r, i = null) {
|
|
59
|
+
if (!n) return null;
|
|
60
|
+
if (!e(n)) return n;
|
|
61
|
+
let a = t(r, n);
|
|
62
|
+
return a === "" ? i ?? n : a.startsWith("..") || e(a) ? n : a;
|
|
63
63
|
}
|
|
64
|
-
function
|
|
65
|
-
let
|
|
66
|
-
return
|
|
64
|
+
function o(n, r) {
|
|
65
|
+
let i = t(r, n);
|
|
66
|
+
return i === "" ? "." : i.startsWith("..") || e(i) ? n : i;
|
|
67
67
|
}
|
|
68
|
-
export { buildJsonReport };
|
|
68
|
+
export { r as buildJsonReport };
|
package/dist/cli/index.js
CHANGED
|
@@ -1,147 +1,147 @@
|
|
|
1
|
-
import { readInlineVersionComment } from "../core/versions/read-inline-version-comment.js";
|
|
2
|
-
import { isSha } from "../core/versions/is-sha.js";
|
|
3
|
-
import { promptUpdateSelection } from "../core/interactive/prompt-update-selection.js";
|
|
4
|
-
import { resolveTargetReference } from "../core/updates/resolve-target-reference.js";
|
|
5
|
-
import { getCompatibleUpdate } from "../core/api/get-compatible-update.js";
|
|
6
|
-
import { createGitHubClient } from "../core/api/create-github-client.js";
|
|
7
|
-
import { resolveScanDirectories } from "./resolve-scan-directories.js";
|
|
8
|
-
import { getUpdateLevel } from "../core/versions/get-update-level.js";
|
|
9
|
-
import { applyUpdates } from "../core/ast/update/apply-updates.js";
|
|
10
|
-
import { normalizeUpdateStyle } from "./normalize-update-style.js";
|
|
11
|
-
import { printSkippedWarning } from "./print-skipped-warning.js";
|
|
12
|
-
import { normalizeUpdateMode } from "./normalize-update-mode.js";
|
|
13
|
-
import { validateCliOptions } from "./validate-cli-options.js";
|
|
14
|
-
import { shouldIgnore } from "../core/ignore/should-ignore.js";
|
|
15
|
-
import { checkUpdates } from "../core/api/check-updates.js";
|
|
16
|
-
import { mergeScanResults } from "./merge-scan-results.js";
|
|
17
|
-
import { printModeWarning } from "./print-mode-warning.js";
|
|
18
|
-
import { scanRecursive } from "../core/scan-recursive.js";
|
|
19
|
-
import { buildJsonReport } from "./build-json-report.js";
|
|
20
|
-
import { scanGitHubActions } from "../core/scan-github-actions.js";
|
|
1
|
+
import { readInlineVersionComment as e } from "../core/versions/read-inline-version-comment.js";
|
|
2
|
+
import { isSha as t } from "../core/versions/is-sha.js";
|
|
3
|
+
import { promptUpdateSelection as n } from "../core/interactive/prompt-update-selection.js";
|
|
4
|
+
import { resolveTargetReference as r } from "../core/updates/resolve-target-reference.js";
|
|
5
|
+
import { getCompatibleUpdate as i } from "../core/api/get-compatible-update.js";
|
|
6
|
+
import { createGitHubClient as a } from "../core/api/create-github-client.js";
|
|
7
|
+
import { resolveScanDirectories as o } from "./resolve-scan-directories.js";
|
|
8
|
+
import { getUpdateLevel as s } from "../core/versions/get-update-level.js";
|
|
9
|
+
import { applyUpdates as c } from "../core/ast/update/apply-updates.js";
|
|
10
|
+
import { normalizeUpdateStyle as l } from "./normalize-update-style.js";
|
|
11
|
+
import { printSkippedWarning as u } from "./print-skipped-warning.js";
|
|
12
|
+
import { normalizeUpdateMode as d } from "./normalize-update-mode.js";
|
|
13
|
+
import { validateCliOptions as f } from "./validate-cli-options.js";
|
|
14
|
+
import { shouldIgnore as p } from "../core/ignore/should-ignore.js";
|
|
15
|
+
import { checkUpdates as m } from "../core/api/check-updates.js";
|
|
16
|
+
import { mergeScanResults as h } from "./merge-scan-results.js";
|
|
17
|
+
import { printModeWarning as g } from "./print-mode-warning.js";
|
|
18
|
+
import { scanRecursive as _ } from "../core/scan-recursive.js";
|
|
19
|
+
import { buildJsonReport as v } from "./build-json-report.js";
|
|
20
|
+
import { scanGitHubActions as y } from "../core/scan-github-actions.js";
|
|
21
21
|
import "../core/index.js";
|
|
22
|
-
import { version } from "../package.js";
|
|
23
|
-
import { createSpinner } from "nanospinner";
|
|
24
|
-
import { resolve } from "node:path";
|
|
22
|
+
import { version as b } from "../package.js";
|
|
23
|
+
import { createSpinner as x } from "nanospinner";
|
|
24
|
+
import { resolve as S } from "node:path";
|
|
25
25
|
import "node:worker_threads";
|
|
26
|
-
import
|
|
27
|
-
import
|
|
28
|
-
function
|
|
29
|
-
let T =
|
|
30
|
-
T.help().version(
|
|
31
|
-
let w =
|
|
32
|
-
recursive:
|
|
26
|
+
import C from "picocolors";
|
|
27
|
+
import w from "cac";
|
|
28
|
+
function T() {
|
|
29
|
+
let T = w("actions-up");
|
|
30
|
+
T.help().version(b).option("--dir <directory>", "Directory to scan (repeatable). Default: .github, or . with --recursive").option("--dry-run", "Preview changes without applying them").option("--exclude <regex>", "Exclude actions by regex (repeatable)").option("--include-branches", "Also check actions pinned to branches (default: false)").option("--json", "Output update information as machine-readable JSON").option("--min-age <days>", "Minimum age in days for updates (default: 0)", { default: 0 }).option("--mode <mode>", "Update mode: major, minor, or patch (default: major)", { default: "major" }).option("--style <style>", "Update style: sha or preserve (default: sha)", { default: "sha" }).option("--recursive, -r", "Recursively scan directories for YAML files").option("--yes, -y", "Skip all confirmations").command("", "Update GitHub Actions").action(async (b) => {
|
|
31
|
+
let w = b.json ?? !1, T = null, E = o({
|
|
32
|
+
recursive: b.recursive,
|
|
33
33
|
cwd: process.cwd(),
|
|
34
|
-
dir:
|
|
35
|
-
}), D = E.map(({ root: e, dir:
|
|
36
|
-
Array.isArray(
|
|
34
|
+
dir: b.dir
|
|
35
|
+
}), D = E.map(({ root: e, dir: t }) => S(e, t)), O = b.includeBranches ?? !1, k = d(b.mode), A = l(b.style), j = [];
|
|
36
|
+
Array.isArray(b.exclude) ? j.push(...b.exclude) : typeof b.exclude == "string" && j.push(b.exclude);
|
|
37
37
|
let M = j.flatMap((e) => e.split(",")).map((e) => e.trim()).filter(Boolean);
|
|
38
38
|
try {
|
|
39
|
-
|
|
40
|
-
yes:
|
|
39
|
+
f({
|
|
40
|
+
yes: b.yes,
|
|
41
41
|
json: w
|
|
42
|
-
}), w || (console.info(
|
|
43
|
-
function
|
|
44
|
-
process.stdout.write(`${JSON.stringify(
|
|
45
|
-
recursive:
|
|
42
|
+
}), w || (console.info(C.cyan("\n🚀 Actions Up!\n")), T = x("Scanning GitHub Actions...").start());
|
|
43
|
+
function o({ actionsToCheckCount: e, blockedByMode: t = [], outdated: n = [], skipped: r = [], scanResult: i, status: a }) {
|
|
44
|
+
process.stdout.write(`${JSON.stringify(v({
|
|
45
|
+
recursive: b.recursive ?? !1,
|
|
46
46
|
excludePatterns: M,
|
|
47
47
|
directories: D,
|
|
48
|
-
minAge:
|
|
48
|
+
minAge: b.minAge,
|
|
49
49
|
actionsToCheckCount: e,
|
|
50
50
|
includeBranches: O,
|
|
51
|
-
blockedByMode:
|
|
52
|
-
scanResult:
|
|
53
|
-
outdated:
|
|
54
|
-
skipped:
|
|
55
|
-
status:
|
|
51
|
+
blockedByMode: t,
|
|
52
|
+
scanResult: i,
|
|
53
|
+
outdated: n,
|
|
54
|
+
skipped: r,
|
|
55
|
+
status: a,
|
|
56
56
|
style: A,
|
|
57
57
|
mode: k
|
|
58
58
|
}), null, 2)}\n`);
|
|
59
59
|
}
|
|
60
|
-
let
|
|
61
|
-
if (T?.success(`Found ${
|
|
60
|
+
let l = h(b.recursive ? await Promise.all(E.map(({ root: e, dir: t }) => _(e, t))) : await Promise.all(E.map(({ root: e, dir: t }) => y(e, t)))), d = l.actions.length, S = l.workflows.size, j = l.compositeActions.size;
|
|
61
|
+
if (T?.success(`Found ${C.yellow(d)} actions in ${C.yellow(S)} workflows and ${C.yellow(j)} composite actions`), d === 0) {
|
|
62
62
|
if (w) {
|
|
63
|
-
|
|
63
|
+
o({
|
|
64
64
|
status: "no-actions-found",
|
|
65
65
|
actionsToCheckCount: 0,
|
|
66
|
-
scanResult:
|
|
66
|
+
scanResult: l
|
|
67
67
|
});
|
|
68
68
|
return;
|
|
69
69
|
}
|
|
70
|
-
console.info(
|
|
70
|
+
console.info(C.green("\n✨ No GitHub Actions found in this repository"));
|
|
71
71
|
return;
|
|
72
72
|
}
|
|
73
|
-
let N =
|
|
73
|
+
let N = l.actions;
|
|
74
74
|
if (M.length > 0) {
|
|
75
|
-
let { parseExcludePatterns: e } = await import("../core/filters/parse-exclude-patterns.js"),
|
|
76
|
-
|
|
77
|
-
let { name:
|
|
78
|
-
for (let e of
|
|
75
|
+
let { parseExcludePatterns: e } = await import("../core/filters/parse-exclude-patterns.js"), t = e(M);
|
|
76
|
+
t.length > 0 && (N = N.filter((e) => {
|
|
77
|
+
let { name: n } = e;
|
|
78
|
+
for (let e of t) if (e.test(n)) return !1;
|
|
79
79
|
return !0;
|
|
80
80
|
}));
|
|
81
81
|
}
|
|
82
|
-
if (w || (T =
|
|
82
|
+
if (w || (T = x("Checking for updates...").start()), N.length === 0) {
|
|
83
83
|
if (T?.success("No actions to check after excludes"), w) {
|
|
84
|
-
|
|
84
|
+
o({
|
|
85
85
|
status: "nothing-to-check",
|
|
86
86
|
actionsToCheckCount: 0,
|
|
87
|
-
scanResult:
|
|
87
|
+
scanResult: l
|
|
88
88
|
});
|
|
89
89
|
return;
|
|
90
90
|
}
|
|
91
|
-
console.info(
|
|
91
|
+
console.info(C.green("\n✨ Nothing to check after excludes\n"));
|
|
92
92
|
return;
|
|
93
93
|
}
|
|
94
|
-
let P = process.env.GITHUB_TOKEN, F =
|
|
94
|
+
let P = process.env.GITHUB_TOKEN, F = a(P), I = await m(N, P, {
|
|
95
95
|
client: F,
|
|
96
96
|
includeBranches: O,
|
|
97
97
|
style: A
|
|
98
98
|
}), L = [];
|
|
99
99
|
await Promise.all(I.map(async (e) => {
|
|
100
|
-
await
|
|
100
|
+
await p(e.action.file, e.action.line) || L.push(e);
|
|
101
101
|
}));
|
|
102
|
-
let R = L.filter((e) => e.status === "skipped"), z = L.filter((e) => e.hasUpdate), B =
|
|
102
|
+
let R = L.filter((e) => e.status === "skipped"), z = L.filter((e) => e.hasUpdate), B = b.minAge * 24 * 60 * 60 * 1e3, V = Date.now();
|
|
103
103
|
z = z.filter((e) => e.publishedAt ? V - e.publishedAt.getTime() >= B : !0);
|
|
104
104
|
let H = [];
|
|
105
105
|
if (k !== "major") {
|
|
106
|
-
let
|
|
107
|
-
let
|
|
108
|
-
if (
|
|
109
|
-
let
|
|
110
|
-
|
|
106
|
+
let n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map(), o = await Promise.all(z.map(async (n) => {
|
|
107
|
+
let r = n.currentVersion;
|
|
108
|
+
if (t(n.currentVersion)) {
|
|
109
|
+
let t = await e(n.action.file, n.action.line, a);
|
|
110
|
+
t && (r = t);
|
|
111
111
|
}
|
|
112
|
-
let
|
|
112
|
+
let i = s(r, n.latestVersion);
|
|
113
113
|
return {
|
|
114
|
-
effectiveCurrentVersion:
|
|
115
|
-
allowed: k === "minor" ?
|
|
116
|
-
update:
|
|
114
|
+
effectiveCurrentVersion: r,
|
|
115
|
+
allowed: k === "minor" ? i === "minor" || i === "patch" || i === "none" : i === "patch" || i === "none",
|
|
116
|
+
update: n
|
|
117
117
|
};
|
|
118
|
-
})),
|
|
118
|
+
})), c = [], l = await Promise.all(o.map(async (e) => {
|
|
119
119
|
if (e.allowed) return { update: e.update };
|
|
120
|
-
let
|
|
120
|
+
let t = await i(F, {
|
|
121
121
|
currentVersion: e.effectiveCurrentVersion,
|
|
122
122
|
actionName: e.update.action.name,
|
|
123
|
-
tagsCache:
|
|
124
|
-
shaCache:
|
|
123
|
+
tagsCache: n,
|
|
124
|
+
shaCache: r,
|
|
125
125
|
mode: k
|
|
126
126
|
});
|
|
127
|
-
return
|
|
127
|
+
return t ? { update: {
|
|
128
128
|
...e.update,
|
|
129
|
-
latestVersion:
|
|
130
|
-
latestSha:
|
|
129
|
+
latestVersion: t.version,
|
|
130
|
+
latestSha: t.sha,
|
|
131
131
|
isBreaking: !1,
|
|
132
132
|
hasUpdate: !0
|
|
133
133
|
} } : { blocked: e.update };
|
|
134
134
|
}));
|
|
135
|
-
for (let e of
|
|
135
|
+
for (let e of l) {
|
|
136
136
|
if (e.update) {
|
|
137
|
-
|
|
137
|
+
c.push(e.update);
|
|
138
138
|
continue;
|
|
139
139
|
}
|
|
140
140
|
H.push(e.blocked);
|
|
141
141
|
}
|
|
142
|
-
z =
|
|
142
|
+
z = c;
|
|
143
143
|
}
|
|
144
|
-
z = z.map((e) =>
|
|
144
|
+
z = z.map((e) => r(e, A));
|
|
145
145
|
let U = z.filter((e) => !e.targetRef).map((e) => ({
|
|
146
146
|
...e,
|
|
147
147
|
skipReason: "unsupported-style",
|
|
@@ -152,57 +152,57 @@ function run() {
|
|
|
152
152
|
let W = z.filter((e) => e.isBreaking);
|
|
153
153
|
if (z.length === 0) {
|
|
154
154
|
if (T?.success("All actions are up to date!"), w) {
|
|
155
|
-
|
|
155
|
+
o({
|
|
156
156
|
actionsToCheckCount: N.length,
|
|
157
157
|
status: "up-to-date",
|
|
158
158
|
blockedByMode: H,
|
|
159
|
-
scanResult:
|
|
159
|
+
scanResult: l,
|
|
160
160
|
skipped: R
|
|
161
161
|
});
|
|
162
162
|
return;
|
|
163
163
|
}
|
|
164
|
-
R.length > 0 &&
|
|
164
|
+
R.length > 0 && u(R, O, A), H.length > 0 && g(H, k), console.info(C.green("\n✨ Everything is already at the latest version!\n"));
|
|
165
165
|
return;
|
|
166
166
|
}
|
|
167
|
-
if (T?.success(`Found ${
|
|
168
|
-
|
|
167
|
+
if (T?.success(`Found ${C.yellow(z.length)} updates available${W.length > 0 ? ` (${C.redBright(W.length)} breaking)` : ""}`), w) {
|
|
168
|
+
o({
|
|
169
169
|
actionsToCheckCount: N.length,
|
|
170
170
|
status: "updates-available",
|
|
171
171
|
blockedByMode: H,
|
|
172
|
-
scanResult:
|
|
172
|
+
scanResult: l,
|
|
173
173
|
outdated: z,
|
|
174
174
|
skipped: R
|
|
175
175
|
});
|
|
176
176
|
return;
|
|
177
177
|
}
|
|
178
|
-
if (R.length > 0 &&
|
|
179
|
-
console.info(
|
|
178
|
+
if (R.length > 0 && u(R, O, A), H.length > 0 && g(H, k), b.dryRun) {
|
|
179
|
+
console.info(C.yellow("\n📋 Dry Run - No changes will be made\n"));
|
|
180
180
|
for (let e of z) {
|
|
181
|
-
let
|
|
182
|
-
console.info(`${
|
|
181
|
+
let t = e.targetRefStyle === "sha" && e.targetRef ? `${e.latestVersion} ${C.gray(`(${e.targetRef.slice(0, 7)})`)}` : e.targetRef ?? e.latestVersion;
|
|
182
|
+
console.info(`${C.cyan(e.action.file ?? "unknown")}:\n${e.action.name}: ${C.redBright(e.currentVersion)} → ${C.green(t)}\n`);
|
|
183
183
|
}
|
|
184
|
-
console.info(
|
|
184
|
+
console.info(C.gray(`\n${z.length} actions would be updated\n`));
|
|
185
185
|
return;
|
|
186
186
|
}
|
|
187
|
-
if (
|
|
187
|
+
if (b.yes) {
|
|
188
188
|
let e = z.filter((e) => e.targetRef);
|
|
189
189
|
if (e.length === 0) {
|
|
190
|
-
console.info(
|
|
190
|
+
console.info(C.yellow("\n⚠️ No actionable updates available\n"));
|
|
191
191
|
return;
|
|
192
192
|
}
|
|
193
|
-
console.info(
|
|
193
|
+
console.info(C.yellow(`\n🔄 Updating ${e.length} actions...\n`)), await c(e), console.info(C.green("\n✓ Updates applied successfully!"));
|
|
194
194
|
} else {
|
|
195
195
|
(R.length > 0 || H.length > 0) && console.info("");
|
|
196
|
-
let e = await
|
|
196
|
+
let e = await n(z, { showAge: b.minAge > 0 });
|
|
197
197
|
if (!e || e.length === 0) {
|
|
198
|
-
console.info(
|
|
198
|
+
console.info(C.gray("\nNo updates applied"));
|
|
199
199
|
return;
|
|
200
200
|
}
|
|
201
|
-
console.info(
|
|
201
|
+
console.info(C.yellow(`\n🔄 Updating ${e.length} selected actions...\n`)), await c(e), console.info(C.green("\n✓ Updates applied successfully!"));
|
|
202
202
|
}
|
|
203
203
|
} catch (e) {
|
|
204
|
-
T?.error("Failed"), e instanceof Error && e.name === "GitHubRateLimitError" ? (console.error(
|
|
204
|
+
T?.error("Failed"), e instanceof Error && e.name === "GitHubRateLimitError" ? (console.error(C.yellow("\n⚠️ Rate Limit Exceeded\n")), console.error(e.message), console.error(C.gray("\nExample: GITHUB_TOKEN=ghp_xxxx actions-up\n"))) : console.error(C.redBright("\nError:"), e instanceof Error ? e.message : String(e)), process.exit(1);
|
|
205
205
|
}
|
|
206
206
|
}), T.parse();
|
|
207
207
|
}
|
|
208
|
-
export { run };
|
|
208
|
+
export { T as run };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function
|
|
1
|
+
function e(e) {
|
|
2
2
|
let t = {
|
|
3
3
|
compositeActions: /* @__PURE__ */ new Map(),
|
|
4
4
|
workflows: /* @__PURE__ */ new Map(),
|
|
@@ -15,4 +15,4 @@ function mergeScanResults(e) {
|
|
|
15
15
|
return n.has(t) ? !1 : (n.add(t), !0);
|
|
16
16
|
}), t;
|
|
17
17
|
}
|
|
18
|
-
export { mergeScanResults };
|
|
18
|
+
export { e as mergeScanResults };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
function
|
|
1
|
+
function e(e) {
|
|
2
2
|
let t = (e ?? "major").toLowerCase();
|
|
3
3
|
if (t === "major" || t === "minor" || t === "patch") return t;
|
|
4
4
|
throw Error(`Invalid mode "${e}". Expected "major", "minor", or "patch".`);
|
|
5
5
|
}
|
|
6
|
-
export { normalizeUpdateMode };
|
|
6
|
+
export { e as normalizeUpdateMode };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
function
|
|
1
|
+
function e(e) {
|
|
2
2
|
let t = (e ?? "sha").toLowerCase();
|
|
3
3
|
if (t === "preserve" || t === "sha") return t;
|
|
4
4
|
throw Error(`Invalid style "${e}". Expected "sha" or "preserve".`);
|
|
5
5
|
}
|
|
6
|
-
export { normalizeUpdateStyle };
|
|
6
|
+
export { e as normalizeUpdateStyle };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import
|
|
2
|
-
function
|
|
1
|
+
import e from "picocolors";
|
|
2
|
+
function t(t, n) {
|
|
3
3
|
if (t.length === 0) return;
|
|
4
4
|
let r = new Intl.PluralRules("en-US", { type: "cardinal" }).select(t.length) === "one" ? "action" : "actions", i = n === "minor" ? "major" : "major/minor";
|
|
5
|
-
console.info(
|
|
5
|
+
console.info(e.yellow(`\n⚠️ Skipped ${t.length} ${r} due to ${i} updates`));
|
|
6
6
|
for (let n of t) {
|
|
7
7
|
let t = n.action.uses ?? `${n.action.name}@${n.currentVersion ?? "unknown"}`;
|
|
8
|
-
console.info(
|
|
8
|
+
console.info(e.gray(` • ${t}`));
|
|
9
9
|
}
|
|
10
10
|
}
|
|
11
|
-
export { printModeWarning };
|
|
11
|
+
export { t as printModeWarning };
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import
|
|
2
|
-
function
|
|
1
|
+
import e from "picocolors";
|
|
2
|
+
function t(e, t, r) {
|
|
3
3
|
let i = e.filter((e) => e.skipReason === "branch" || e.skipReason === void 0), a = e.filter((e) => e.skipReason === "unsupported-style");
|
|
4
|
-
i.length > 0 &&
|
|
4
|
+
i.length > 0 && n(i, t ? "pinned to branches" : "pinned to branches (use --include-branches to check them)"), a.length > 0 && n(a, r === "preserve" ? "whose current ref style could not be preserved" : "that could not be updated with the current style");
|
|
5
5
|
}
|
|
6
|
-
function
|
|
6
|
+
function n(t, n) {
|
|
7
7
|
let r = new Intl.PluralRules("en-US", { type: "cardinal" }).select(t.length) === "one" ? "action" : "actions";
|
|
8
|
-
console.info(
|
|
8
|
+
console.info(e.yellow(`\n⚠️ Skipped ${t.length} ${r} ${n}`));
|
|
9
9
|
for (let n of t) {
|
|
10
10
|
let t = n.action.uses ?? `${n.action.name}@${n.currentVersion ?? "unknown"}`;
|
|
11
|
-
console.info(
|
|
11
|
+
console.info(e.gray(` • ${t}`));
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
|
-
export { printSkippedWarning };
|
|
14
|
+
export { t as printSkippedWarning };
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { GITHUB_DIRECTORY } from "../core/constants.js";
|
|
2
|
-
import { basename, dirname, isAbsolute, relative, resolve } from "node:path";
|
|
3
|
-
function
|
|
1
|
+
import { GITHUB_DIRECTORY as e } from "../core/constants.js";
|
|
2
|
+
import { basename as t, dirname as n, isAbsolute as r, relative as i, resolve as a } from "node:path";
|
|
3
|
+
function o(o) {
|
|
4
4
|
let { recursive: s, cwd: c, dir: l } = o, u = [];
|
|
5
|
-
Array.isArray(l) ? u.push(...l) : typeof l == "string" ? u.push(l) : s ? u.push(".") : u.push(
|
|
5
|
+
Array.isArray(l) ? u.push(...l) : typeof l == "string" ? u.push(l) : s ? u.push(".") : u.push(e);
|
|
6
6
|
let d = /* @__PURE__ */ new Set(), f = [];
|
|
7
7
|
for (let e of u) {
|
|
8
|
-
let o =
|
|
8
|
+
let o = a(c, e), l = i(c, o), u = l.startsWith("..") || r(l) || a(c, l) !== o, p;
|
|
9
9
|
p = s ? {
|
|
10
10
|
root: o,
|
|
11
11
|
dir: "."
|
|
12
12
|
} : u ? {
|
|
13
|
-
dir:
|
|
14
|
-
root:
|
|
13
|
+
dir: t(o),
|
|
14
|
+
root: n(o)
|
|
15
15
|
} : {
|
|
16
16
|
dir: l || ".github",
|
|
17
17
|
root: c
|
|
@@ -21,4 +21,4 @@ function resolveScanDirectories(o) {
|
|
|
21
21
|
}
|
|
22
22
|
return f;
|
|
23
23
|
}
|
|
24
|
-
export { resolveScanDirectories };
|
|
24
|
+
export { o as resolveScanDirectories };
|