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.
Files changed (65) hide show
  1. package/dist/cli/build-json-report.js +18 -18
  2. package/dist/cli/index.js +101 -101
  3. package/dist/cli/merge-scan-results.js +2 -2
  4. package/dist/cli/normalize-update-mode.js +2 -2
  5. package/dist/cli/normalize-update-style.js +2 -2
  6. package/dist/cli/print-mode-warning.js +5 -5
  7. package/dist/cli/print-skipped-warning.js +7 -7
  8. package/dist/cli/resolve-scan-directories.js +8 -8
  9. package/dist/cli/validate-cli-options.js +2 -2
  10. package/dist/core/api/check-updates.js +114 -113
  11. package/dist/core/api/create-github-client.js +26 -26
  12. package/dist/core/api/get-all-releases.js +12 -12
  13. package/dist/core/api/get-all-tags.js +4 -4
  14. package/dist/core/api/get-compatible-update.js +6 -6
  15. package/dist/core/api/get-latest-release.js +15 -15
  16. package/dist/core/api/get-reference-type.js +5 -5
  17. package/dist/core/api/get-tag-info.js +14 -14
  18. package/dist/core/api/get-tag-sha.js +7 -7
  19. package/dist/core/api/internal-rate-limit-error.js +2 -2
  20. package/dist/core/api/make-request.js +4 -4
  21. package/dist/core/api/resolve-github-token-sync.js +7 -7
  22. package/dist/core/api/update-rate-limit-info.js +3 -6
  23. package/dist/core/ast/guards/has-range.js +2 -2
  24. package/dist/core/ast/guards/is-node.js +2 -2
  25. package/dist/core/ast/guards/is-pair.js +2 -2
  26. package/dist/core/ast/guards/is-scalar.js +2 -2
  27. package/dist/core/ast/guards/is-yaml-map.js +2 -2
  28. package/dist/core/ast/guards/is-yaml-sequence.js +2 -2
  29. package/dist/core/ast/scanners/scan-composite-action-ast.js +13 -13
  30. package/dist/core/ast/scanners/scan-workflow-ast.js +21 -21
  31. package/dist/core/ast/update/apply-updates.js +24 -24
  32. package/dist/core/ast/utils/extract-uses-from-steps.js +14 -14
  33. package/dist/core/ast/utils/find-map-pair.js +6 -6
  34. package/dist/core/ast/utils/get-line-number.js +4 -4
  35. package/dist/core/constants.js +2 -2
  36. package/dist/core/filters/parse-exclude-patterns.js +2 -2
  37. package/dist/core/fs/find-yaml-files-recursive.js +9 -9
  38. package/dist/core/fs/is-yaml-file.js +2 -2
  39. package/dist/core/fs/read-yaml-document.js +6 -6
  40. package/dist/core/ignore/should-ignore.js +4 -4
  41. package/dist/core/index.js +5 -5
  42. package/dist/core/interactive/format-version.js +14 -14
  43. package/dist/core/interactive/pad-string.js +4 -4
  44. package/dist/core/interactive/prompt-update-selection.js +153 -138
  45. package/dist/core/interactive/strip-ansi.js +2 -2
  46. package/dist/core/parsing/parse-action-reference.js +2 -2
  47. package/dist/core/scan-action-file.js +6 -6
  48. package/dist/core/scan-github-actions.js +83 -83
  49. package/dist/core/scan-recursive.js +24 -24
  50. package/dist/core/scan-workflow-file.js +6 -6
  51. package/dist/core/schema/composite/is-composite-action-runs.js +2 -2
  52. package/dist/core/schema/composite/is-composite-action-structure.js +2 -2
  53. package/dist/core/schema/workflow/is-workflow-structure.js +2 -2
  54. package/dist/core/updates/resolve-target-reference.js +26 -15
  55. package/dist/core/versions/find-compatible-tag.js +16 -16
  56. package/dist/core/versions/get-update-level.js +8 -8
  57. package/dist/core/versions/is-semver-like.js +2 -2
  58. package/dist/core/versions/is-sha.js +2 -2
  59. package/dist/core/versions/normalize-version.js +4 -4
  60. package/dist/core/versions/preserve-tag-format.d.ts +17 -0
  61. package/dist/core/versions/preserve-tag-format.js +11 -0
  62. package/dist/core/versions/read-inline-version-comment.js +4 -4
  63. package/dist/package.js +2 -2
  64. package/package.json +3 -3
  65. package/readme.md +8 -6
@@ -1,6 +1,6 @@
1
- import { isAbsolute, relative, resolve } from "node:path";
2
- function buildJsonReport(e) {
3
- let n = resolve(e.cwd ?? process.cwd());
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) => serializeDirectoryPath(e, n)),
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) => serializeUpdate(e, n)),
27
- updates: e.outdated.map((e) => serializeUpdate(e, n)),
28
- skipped: e.skipped.map((e) => serializeUpdate(e, n)),
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 serializeUpdate(e, n) {
33
+ function i(e, t) {
34
34
  return {
35
35
  action: {
36
- file: serializePath(e.action.file, n),
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 serializePath(r, i, a = null) {
59
- if (!r) return null;
60
- if (!isAbsolute(r)) return r;
61
- let o = relative(i, r);
62
- return o === "" ? a ?? r : o.startsWith("..") || isAbsolute(o) ? r : o;
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 serializeDirectoryPath(r, i) {
65
- let a = relative(i, r);
66
- return a === "" ? "." : a.startsWith("..") || isAbsolute(a) ? r : a;
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 pc from "picocolors";
27
- import cac from "cac";
28
- function run() {
29
- let T = cac("actions-up");
30
- T.help().version(version).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 (S) => {
31
- let w = S.json ?? !1, T = null, E = resolveScanDirectories({
32
- recursive: S.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: S.dir
35
- }), D = E.map(({ root: e, dir: p }) => resolve(e, p)), O = S.includeBranches ?? !1, k = normalizeUpdateMode(S.mode), A = normalizeUpdateStyle(S.style), j = [];
36
- Array.isArray(S.exclude) ? j.push(...S.exclude) : typeof S.exclude == "string" && j.push(S.exclude);
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
- validateCliOptions({
40
- yes: S.yes,
39
+ f({
40
+ yes: b.yes,
41
41
  json: w
42
- }), w || (console.info(pc.cyan("\n🚀 Actions Up!\n")), T = createSpinner("Scanning GitHub Actions...").start());
43
- function v({ actionsToCheckCount: e, blockedByMode: p = [], outdated: m = [], skipped: h = [], scanResult: g, status: _ }) {
44
- process.stdout.write(`${JSON.stringify(buildJsonReport({
45
- recursive: S.recursive ?? !1,
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: S.minAge,
48
+ minAge: b.minAge,
49
49
  actionsToCheckCount: e,
50
50
  includeBranches: O,
51
- blockedByMode: p,
52
- scanResult: g,
53
- outdated: m,
54
- skipped: h,
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 b = mergeScanResults(S.recursive ? await Promise.all(E.map(({ root: e, dir: p }) => scanRecursive(e, p))) : await Promise.all(E.map(({ root: e, dir: p }) => scanGitHubActions(e, p)))), x = b.actions.length, C = b.workflows.size, j = b.compositeActions.size;
61
- if (T?.success(`Found ${pc.yellow(x)} actions in ${pc.yellow(C)} workflows and ${pc.yellow(j)} composite actions`), x === 0) {
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
- v({
63
+ o({
64
64
  status: "no-actions-found",
65
65
  actionsToCheckCount: 0,
66
- scanResult: b
66
+ scanResult: l
67
67
  });
68
68
  return;
69
69
  }
70
- console.info(pc.green("\n✨ No GitHub Actions found in this repository"));
70
+ console.info(C.green("\n✨ No GitHub Actions found in this repository"));
71
71
  return;
72
72
  }
73
- let N = b.actions;
73
+ let N = l.actions;
74
74
  if (M.length > 0) {
75
- let { parseExcludePatterns: e } = await import("../core/filters/parse-exclude-patterns.js"), p = e(M);
76
- p.length > 0 && (N = N.filter((e) => {
77
- let { name: m } = e;
78
- for (let e of p) if (e.test(m)) return !1;
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 = createSpinner("Checking for updates...").start()), N.length === 0) {
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
- v({
84
+ o({
85
85
  status: "nothing-to-check",
86
86
  actionsToCheckCount: 0,
87
- scanResult: b
87
+ scanResult: l
88
88
  });
89
89
  return;
90
90
  }
91
- console.info(pc.green("\n✨ Nothing to check after excludes\n"));
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 = createGitHubClient(P), I = await checkUpdates(N, P, {
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 shouldIgnore(e.action.file, e.action.line) || L.push(e);
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 = S.minAge * 24 * 60 * 60 * 1e3, V = Date.now();
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 m = /* @__PURE__ */ new Map(), h = /* @__PURE__ */ new Map(), _ = /* @__PURE__ */ new Map(), v = await Promise.all(z.map(async (m) => {
107
- let h = m.currentVersion;
108
- if (isSha(m.currentVersion)) {
109
- let p = await readInlineVersionComment(m.action.file, m.action.line, _);
110
- p && (h = p);
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 g = getUpdateLevel(h, m.latestVersion);
112
+ let i = s(r, n.latestVersion);
113
113
  return {
114
- effectiveCurrentVersion: h,
115
- allowed: k === "minor" ? g === "minor" || g === "patch" || g === "none" : g === "patch" || g === "none",
116
- update: m
114
+ effectiveCurrentVersion: r,
115
+ allowed: k === "minor" ? i === "minor" || i === "patch" || i === "none" : i === "patch" || i === "none",
116
+ update: n
117
117
  };
118
- })), y = [], b = await Promise.all(v.map(async (e) => {
118
+ })), c = [], l = await Promise.all(o.map(async (e) => {
119
119
  if (e.allowed) return { update: e.update };
120
- let p = await getCompatibleUpdate(F, {
120
+ let t = await i(F, {
121
121
  currentVersion: e.effectiveCurrentVersion,
122
122
  actionName: e.update.action.name,
123
- tagsCache: m,
124
- shaCache: h,
123
+ tagsCache: n,
124
+ shaCache: r,
125
125
  mode: k
126
126
  });
127
- return p ? { update: {
127
+ return t ? { update: {
128
128
  ...e.update,
129
- latestVersion: p.version,
130
- latestSha: p.sha,
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 b) {
135
+ for (let e of l) {
136
136
  if (e.update) {
137
- y.push(e.update);
137
+ c.push(e.update);
138
138
  continue;
139
139
  }
140
140
  H.push(e.blocked);
141
141
  }
142
- z = y;
142
+ z = c;
143
143
  }
144
- z = z.map((e) => resolveTargetReference(e, A));
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
- v({
155
+ o({
156
156
  actionsToCheckCount: N.length,
157
157
  status: "up-to-date",
158
158
  blockedByMode: H,
159
- scanResult: b,
159
+ scanResult: l,
160
160
  skipped: R
161
161
  });
162
162
  return;
163
163
  }
164
- R.length > 0 && printSkippedWarning(R, O, A), H.length > 0 && printModeWarning(H, k), console.info(pc.green("\n✨ Everything is already at the latest version!\n"));
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 ${pc.yellow(z.length)} updates available${W.length > 0 ? ` (${pc.redBright(W.length)} breaking)` : ""}`), w) {
168
- v({
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: b,
172
+ scanResult: l,
173
173
  outdated: z,
174
174
  skipped: R
175
175
  });
176
176
  return;
177
177
  }
178
- if (R.length > 0 && printSkippedWarning(R, O, A), H.length > 0 && printModeWarning(H, k), S.dryRun) {
179
- console.info(pc.yellow("\n📋 Dry Run - No changes will be made\n"));
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 p = e.targetRefStyle === "sha" && e.targetRef ? `${e.latestVersion} ${pc.gray(`(${e.targetRef.slice(0, 7)})`)}` : e.targetRef ?? e.latestVersion;
182
- console.info(`${pc.cyan(e.action.file ?? "unknown")}:\n${e.action.name}: ${pc.redBright(e.currentVersion)} → ${pc.green(p)}\n`);
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(pc.gray(`\n${z.length} actions would be updated\n`));
184
+ console.info(C.gray(`\n${z.length} actions would be updated\n`));
185
185
  return;
186
186
  }
187
- if (S.yes) {
187
+ if (b.yes) {
188
188
  let e = z.filter((e) => e.targetRef);
189
189
  if (e.length === 0) {
190
- console.info(pc.yellow("\n⚠️ No actionable updates available\n"));
190
+ console.info(C.yellow("\n⚠️ No actionable updates available\n"));
191
191
  return;
192
192
  }
193
- console.info(pc.yellow(`\n🔄 Updating ${e.length} actions...\n`)), await applyUpdates(e), console.info(pc.green("\n✓ Updates applied successfully!"));
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 promptUpdateSelection(z, { showAge: S.minAge > 0 });
196
+ let e = await n(z, { showAge: b.minAge > 0 });
197
197
  if (!e || e.length === 0) {
198
- console.info(pc.gray("\nNo updates applied"));
198
+ console.info(C.gray("\nNo updates applied"));
199
199
  return;
200
200
  }
201
- console.info(pc.yellow(`\n🔄 Updating ${e.length} selected actions...\n`)), await applyUpdates(e), console.info(pc.green("\n✓ Updates applied successfully!"));
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(pc.yellow("\n⚠️ Rate Limit Exceeded\n")), console.error(e.message), console.error(pc.gray("\nExample: GITHUB_TOKEN=ghp_xxxx actions-up\n"))) : console.error(pc.redBright("\nError:"), e instanceof Error ? e.message : String(e)), process.exit(1);
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 mergeScanResults(e) {
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 normalizeUpdateMode(e) {
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 normalizeUpdateStyle(e) {
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 pc from "picocolors";
2
- function printModeWarning(t, n) {
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(pc.yellow(`\n⚠️ Skipped ${t.length} ${r} due to ${i} updates`));
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(pc.gray(` • ${t}`));
8
+ console.info(e.gray(` • ${t}`));
9
9
  }
10
10
  }
11
- export { printModeWarning };
11
+ export { t as printModeWarning };
@@ -1,14 +1,14 @@
1
- import pc from "picocolors";
2
- function printSkippedWarning(e, t, r) {
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 && printSkippedGroup(i, t ? "pinned to branches" : "pinned to branches (use --include-branches to check them)"), a.length > 0 && printSkippedGroup(a, r === "preserve" ? "whose current ref style could not be preserved" : "that could not be updated with the current style");
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 printSkippedGroup(t, n) {
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(pc.yellow(`\n⚠️ Skipped ${t.length} ${r} ${n}`));
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(pc.gray(` • ${t}`));
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 resolveScanDirectories(o) {
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(GITHUB_DIRECTORY);
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 = resolve(c, e), l = relative(c, o), u = l.startsWith("..") || isAbsolute(l) || resolve(c, l) !== o, p;
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: basename(o),
14
- root: dirname(o)
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 };
@@ -1,4 +1,4 @@
1
- function validateCliOptions(e) {
1
+ function e(e) {
2
2
  if (e.json && e.yes) throw Error("--json cannot be used with --yes");
3
3
  }
4
- export { validateCliOptions };
4
+ export { e as validateCliOptions };