actions-up 1.13.0 → 1.14.1

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 (71) hide show
  1. package/dist/cli/build-json-report.d.ts +57 -36
  2. package/dist/cli/build-json-report.js +22 -18
  3. package/dist/cli/index.js +137 -122
  4. package/dist/cli/merge-scan-results.js +2 -2
  5. package/dist/cli/normalize-update-mode.js +2 -2
  6. package/dist/cli/normalize-update-style.d.ts +8 -0
  7. package/dist/cli/normalize-update-style.js +6 -0
  8. package/dist/cli/print-mode-warning.js +5 -5
  9. package/dist/cli/print-skipped-warning.d.ts +4 -1
  10. package/dist/cli/print-skipped-warning.js +10 -6
  11. package/dist/cli/resolve-scan-directories.js +8 -8
  12. package/dist/cli/validate-cli-options.js +2 -2
  13. package/dist/core/api/check-updates.d.ts +2 -0
  14. package/dist/core/api/check-updates.js +120 -96
  15. package/dist/core/api/create-github-client.js +26 -26
  16. package/dist/core/api/get-all-releases.js +12 -12
  17. package/dist/core/api/get-all-tags.js +4 -4
  18. package/dist/core/api/get-compatible-update.js +6 -6
  19. package/dist/core/api/get-latest-release.js +15 -15
  20. package/dist/core/api/get-reference-type.js +5 -5
  21. package/dist/core/api/get-tag-info.js +14 -14
  22. package/dist/core/api/get-tag-sha.js +7 -7
  23. package/dist/core/api/internal-rate-limit-error.js +2 -2
  24. package/dist/core/api/make-request.js +4 -4
  25. package/dist/core/api/resolve-github-token-sync.js +7 -7
  26. package/dist/core/api/update-rate-limit-info.js +3 -6
  27. package/dist/core/ast/guards/has-range.js +2 -2
  28. package/dist/core/ast/guards/is-node.js +2 -2
  29. package/dist/core/ast/guards/is-pair.js +2 -2
  30. package/dist/core/ast/guards/is-scalar.js +2 -2
  31. package/dist/core/ast/guards/is-yaml-map.js +2 -2
  32. package/dist/core/ast/guards/is-yaml-sequence.js +2 -2
  33. package/dist/core/ast/scanners/scan-composite-action-ast.js +13 -13
  34. package/dist/core/ast/scanners/scan-workflow-ast.js +21 -21
  35. package/dist/core/ast/update/apply-updates.d.ts +1 -1
  36. package/dist/core/ast/update/apply-updates.js +35 -22
  37. package/dist/core/ast/utils/extract-uses-from-steps.js +14 -14
  38. package/dist/core/ast/utils/find-map-pair.js +6 -6
  39. package/dist/core/ast/utils/get-line-number.js +4 -4
  40. package/dist/core/constants.js +2 -2
  41. package/dist/core/filters/parse-exclude-patterns.js +2 -2
  42. package/dist/core/fs/find-yaml-files-recursive.js +9 -9
  43. package/dist/core/fs/is-yaml-file.js +2 -2
  44. package/dist/core/fs/read-yaml-document.js +6 -6
  45. package/dist/core/ignore/should-ignore.js +4 -4
  46. package/dist/core/index.js +5 -5
  47. package/dist/core/interactive/format-version.js +14 -14
  48. package/dist/core/interactive/pad-string.js +4 -4
  49. package/dist/core/interactive/prompt-update-selection.js +162 -135
  50. package/dist/core/interactive/strip-ansi.js +2 -2
  51. package/dist/core/parsing/parse-action-reference.js +2 -2
  52. package/dist/core/scan-action-file.js +6 -6
  53. package/dist/core/scan-github-actions.js +83 -83
  54. package/dist/core/scan-recursive.js +24 -24
  55. package/dist/core/scan-workflow-file.js +6 -6
  56. package/dist/core/schema/composite/is-composite-action-runs.js +2 -2
  57. package/dist/core/schema/composite/is-composite-action-structure.js +2 -2
  58. package/dist/core/schema/workflow/is-workflow-structure.js +2 -2
  59. package/dist/core/updates/resolve-target-reference.d.ts +10 -0
  60. package/dist/core/updates/resolve-target-reference.js +24 -0
  61. package/dist/core/versions/find-compatible-tag.js +16 -16
  62. package/dist/core/versions/get-update-level.js +8 -8
  63. package/dist/core/versions/is-semver-like.js +2 -2
  64. package/dist/core/versions/is-sha.js +2 -2
  65. package/dist/core/versions/normalize-version.js +4 -4
  66. package/dist/core/versions/read-inline-version-comment.js +4 -4
  67. package/dist/package.js +2 -2
  68. package/dist/types/action-update.d.ts +16 -1
  69. package/dist/types/update-style.d.ts +4 -0
  70. package/package.json +2 -2
  71. package/readme.md +24 -5
@@ -1,22 +1,22 @@
1
- import pc from "picocolors";
2
- import semver from "semver";
3
- function formatVersion(i, a) {
4
- if (!i) return pc.gray("unknown");
5
- let o = semver.parse(i), s = a ? semver.parse(normalizeVersion(a)) : null;
6
- if (!s || !o) return i;
7
- let c = semver.diff(normalizeVersion(a), i), l = s.major === 0 ? pc.yellowBright : pc.gray, u = [
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((r, i) => c === "major" ? pc.redBright : c === "minor" && i >= 1 || c === "patch" && i === 2 ? l : identity), f = d[0](String(u[0]));
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 normalizeVersion(e) {
15
- let r = e.replace(/^v/u, "").split(".");
16
- for (; r.length < 3;) r.push("0");
17
- return r.slice(0, 3).join(".");
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 identity(e) {
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 padString(t, n) {
3
- let r = n - stripAnsi(t).length;
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 };
@@ -1,63 +1,63 @@
1
- import { readInlineVersionComment } from "../versions/read-inline-version-comment.js";
2
- import { formatVersion } from "./format-version.js";
3
- import { GITHUB_DIRECTORY } from "../constants.js";
4
- import { isSha } from "../versions/is-sha.js";
5
- import { stripAnsi } from "./strip-ansi.js";
6
- import { padString } from "./pad-string.js";
7
- import path from "node:path";
1
+ import { readInlineVersionComment as e } from "../versions/read-inline-version-comment.js";
2
+ import { formatVersion as t } from "./format-version.js";
3
+ import { GITHUB_DIRECTORY as n } from "../constants.js";
4
+ import { isSha as r } from "../versions/is-sha.js";
5
+ import { stripAnsi as i } from "./strip-ansi.js";
6
+ import { padString as a } from "./pad-string.js";
7
+ import o from "node:path";
8
8
  import "node:worker_threads";
9
- import pc from "picocolors";
10
- import enquirer from "enquirer";
11
- var MIN_ACTION_WIDTH = 40, MIN_JOB_WIDTH = 4, MIN_CURRENT_WIDTH = 16, MAX_VERSION_WIDTH = 7;
12
- async function promptUpdateSelection(g, v = {}) {
13
- let { showAge: y = !1 } = v;
14
- if (g.length === 0) return null;
15
- let b = g.filter((t) => t.hasUpdate);
16
- if (b.length === 0) return console.info(pc.green("✓ All actions are up to date!")), null;
17
- let x = /* @__PURE__ */ new Map();
18
- for (let [t, i] of b.entries()) {
19
- let o = i.action.file ?? "unknown file", s = path.relative(path.join(process.cwd(), GITHUB_DIRECTORY), o);
20
- s === "" && (s = o);
21
- let c = x.get(s) ?? [];
22
- c.push({
23
- update: i,
24
- index: t
25
- }), x.set(s, c);
9
+ import s from "picocolors";
10
+ import c from "enquirer";
11
+ var l = 40, u = 4, d = 16, f = 7;
12
+ async function p(p, T = {}) {
13
+ let { showAge: E = !1 } = T;
14
+ if (p.length === 0) return null;
15
+ let D = p.filter((e) => e.hasUpdate);
16
+ if (D.length === 0) return console.info(s.green("✓ All actions are up to date!")), null;
17
+ let O = /* @__PURE__ */ new Map();
18
+ for (let [e, t] of D.entries()) {
19
+ let r = t.action.file ?? "unknown file", i = o.relative(o.join(process.cwd(), n), r);
20
+ i === "" && (i = r);
21
+ let a = O.get(i) ?? [];
22
+ a.push({
23
+ update: t,
24
+ index: e
25
+ }), O.set(i, a);
26
26
  }
27
- let S = await Promise.all(b.map(async (i) => {
28
- let a = formatVersionOrSha(i.currentVersion), s = i.currentVersion ?? void 0, c = null, l = null;
29
- if (!i.currentVersion || !isSha(i.currentVersion)) return {
30
- versionForPadding: c,
31
- effectiveForDiff: s,
32
- shortSha: l,
33
- display: a
27
+ let k = await Promise.all(D.map(async (t) => {
28
+ let n = v(t.currentVersion), i = t.currentVersion ?? void 0, a = null, o = null;
29
+ if (!t.currentVersion || !r(t.currentVersion)) return {
30
+ versionForPadding: a,
31
+ effectiveForDiff: i,
32
+ shortSha: o,
33
+ display: n
34
34
  };
35
- let u = await readInlineVersionComment(i.action.file, i.action.line);
36
- return u && (l = i.currentVersion.slice(0, 7), c = formatVersionOrSha(u), a = c, s = u), {
37
- versionForPadding: c,
38
- effectiveForDiff: s,
39
- shortSha: l,
40
- display: a
35
+ let s = await e(t.action.file, t.action.line);
36
+ return s && (o = t.currentVersion.slice(0, 7), a = v(s), n = a, i = s), {
37
+ versionForPadding: a,
38
+ effectiveForDiff: i,
39
+ shortSha: o,
40
+ display: n
41
41
  };
42
- })), C = [], w = stripAnsi("Action").length, T = stripAnsi("Current").length, E = stripAnsi("Job").length, D = 0, O = !1;
43
- for (let [t, a] of b.entries()) {
44
- let o = a.action.name, l = S[t], d = l.display, f = a.action.job ?? "–";
45
- if (w = Math.max(w, o.length), T = Math.max(T, stripAnsi(d).length, l.versionForPadding && l.shortSha ? stripAnsi(`${padString(l.versionForPadding, D + 1)}${pc.gray(`(${l.shortSha})`)}`).length : 0), E = Math.max(E, f.length), a.latestVersion) {
46
- let o = formatVersion(a.latestVersion, S[t]?.effectiveForDiff ?? a.currentVersion);
47
- D = Math.max(D, stripAnsi(o).length);
42
+ })), A = [], j = i("Action").length, M = i("Current").length, N = i("Job").length, P = 0, F = !1;
43
+ for (let [e, n] of D.entries()) {
44
+ let r = n.action.name, o = k[e], c = o.display, l = n.action.job ?? "–";
45
+ if (j = Math.max(j, r.length), M = Math.max(M, i(c).length, o.versionForPadding && o.shortSha ? i(`${a(o.versionForPadding, P + 1)}${s.gray(`(${o.shortSha})`)}`).length : 0), N = Math.max(N, l.length), n.latestVersion) {
46
+ let r = t(n.targetRefStyle === "tag" && n.targetRef ? n.targetRef : n.latestVersion, k[e]?.effectiveForDiff ?? n.currentVersion);
47
+ P = Math.max(P, i(r).length);
48
48
  }
49
- let p = S[t]?.versionForPadding;
50
- p && (D = Math.max(D, stripAnsi(p).length)), a.publishedAt && (O = !0);
49
+ let u = k[e]?.versionForPadding;
50
+ u && (P = Math.max(P, i(u).length)), n.publishedAt && (F = !0);
51
51
  }
52
- let k = Math.max(w, MIN_ACTION_WIDTH), A = Math.max(T, MIN_CURRENT_WIDTH), j = Math.max(E, MIN_JOB_WIDTH), M = Math.min(D, MAX_VERSION_WIDTH), N = M + 1 + 9, P = y && O ? 6 : 0, F = [...x.keys()].toSorted();
53
- for (let [t, a] of F.entries()) {
54
- let o = x.get(a);
55
- if (!o) {
56
- console.warn(`Unexpected missing group for file: ${a}`);
52
+ let I = Math.max(j, l), L = Math.max(M, d), R = Math.max(N, u), z = Math.min(P, f), B = z + 1 + 9, V = E && F ? 6 : 0, H = [...O.keys()].toSorted();
53
+ for (let [e, n] of H.entries()) {
54
+ let r = O.get(n);
55
+ if (!r) {
56
+ console.warn(`Unexpected missing group for file: ${n}`);
57
57
  continue;
58
58
  }
59
- let s = [], l = o;
60
- s.push({
59
+ let i = [], o = r;
60
+ i.push({
61
61
  current: "Current",
62
62
  action: "Action",
63
63
  target: "Target",
@@ -65,83 +65,88 @@ async function promptUpdateSelection(g, v = {}) {
65
65
  job: "Job",
66
66
  age: "Age"
67
67
  });
68
- for (let { update: t, index: a } of l) {
69
- let o = !!t.latestSha, l = S[a], d = l.display;
70
- l.versionForPadding && l.shortSha && (d = `${padString(l.versionForPadding, M + 1)}${pc.gray(`(${l.shortSha})`)}`);
71
- let f = l.effectiveForDiff ?? t.currentVersion, p = formatVersion(t.latestVersion, f), m = t.action.name;
72
- if (t.latestSha) {
73
- let i = t.latestSha.slice(0, 7);
74
- p = `${padString(p, M + 1)}${pc.gray(`(${i})`)}`;
68
+ for (let { update: e, index: n } of o) {
69
+ let r = w(e), o = k[n], c = o.display;
70
+ o.versionForPadding && o.shortSha && (c = `${a(o.versionForPadding, z + 1)}${s.gray(`(${o.shortSha})`)}`);
71
+ let l = o.effectiveForDiff ?? e.currentVersion, u = t(y(e), l), d = e.action.name;
72
+ if (b(e) === "sha" && S(e)) {
73
+ let t = S(e).slice(0, 7);
74
+ u = `${a(u, z + 1)}${s.gray(`(${t})`)}`;
75
75
  }
76
- o || (p = pc.gray(p), d = pc.gray(d), m = pc.gray(m));
77
- let h = t.action.job ?? "–", g = formatAge(t.publishedAt);
78
- s.push({
79
- job: o ? h : pc.gray(h),
80
- age: o ? g : pc.gray(g),
81
- action: m,
82
- target: p,
76
+ r || (u = s.gray(u), c = s.gray(c), d = s.gray(d));
77
+ let f = e.action.job ?? "–", p = h(e.publishedAt);
78
+ i.push({
79
+ job: r ? f : s.gray(f),
80
+ age: r ? p : s.gray(p),
81
+ action: d,
82
+ target: u,
83
83
  arrow: "❯",
84
- current: d
84
+ current: c
85
85
  });
86
86
  }
87
- let d = Math.max(k, MIN_ACTION_WIDTH), h = Math.max(A, MIN_CURRENT_WIDTH), g = Math.max(j, MIN_JOB_WIDTH), _ = [];
88
- for (let [t, i] of s.entries()) {
89
- let a = t === 0, o = formatTableRow({
90
- targetWidth: N,
91
- currentWidth: h,
92
- actionWidth: d,
93
- ageWidth: P,
94
- jobWidth: g,
95
- row: i
87
+ let c = Math.max(I, l), f = Math.max(L, d), p = Math.max(R, u), m = [];
88
+ for (let [e, t] of i.entries()) {
89
+ let n = e === 0, r = g({
90
+ targetWidth: B,
91
+ currentWidth: f,
92
+ actionWidth: c,
93
+ ageWidth: V,
94
+ jobWidth: p,
95
+ row: t
96
96
  });
97
- if (a) _.push({
98
- message: pc.gray(` ○ ${o}`),
97
+ if (n) m.push({
98
+ message: s.gray(` ○ ${r}`),
99
99
  role: "separator",
100
100
  indent: "",
101
101
  name: ""
102
102
  });
103
103
  else {
104
- let { update: i, index: a } = l[t - 1], s = !!i.latestSha, c = s && !i.isBreaking;
105
- _.push({
106
- message: o,
107
- value: String(a),
108
- name: String(a),
109
- disabled: !s,
104
+ let { update: t, index: n } = o[e - 1], i = w(t), a = i && !t.isBreaking;
105
+ m.push({
106
+ message: r,
107
+ value: String(n),
108
+ disabled: !i,
109
+ name: String(n),
110
110
  indent: "",
111
- enabled: c
111
+ enabled: a
112
112
  });
113
113
  }
114
114
  }
115
- C.push({
116
- message: pc.gray(a),
117
- value: `label|${a}`,
118
- choices: _,
119
- name: `label|${a}`,
115
+ A.push({
116
+ message: s.gray(n),
117
+ value: `label|${n}`,
118
+ choices: m,
119
+ name: `label|${n}`,
120
120
  isGroupLabel: !0,
121
121
  enabled: !1
122
- }), t < F.length - 1 && C.push({
122
+ }), e < H.length - 1 && A.push({
123
123
  role: "separator",
124
124
  message: " ",
125
125
  name: ""
126
126
  });
127
127
  }
128
128
  try {
129
- let t = {
130
- indicator(t, i) {
131
- if (i.isGroupLabel) {
132
- let t = (i.choices ?? []).filter((t) => !("role" in t)), a = t.length, o = t.filter((t) => !!t.enabled).length === a ? "●" : "○";
133
- return ` ${pc.gray(o)}`;
129
+ let e = {
130
+ indicator(e, t) {
131
+ if (t.isGroupLabel) {
132
+ let e = (t.choices ?? []).filter((e) => !("role" in e)), n = e.length, r = e.filter((e) => !!e.enabled).length === n ? "●" : "○";
133
+ return ` ${s.gray(r)}`;
134
134
  }
135
- return ` ${i.enabled ? "●" : "○"}`;
135
+ return ` ${t.enabled ? "●" : "○"}`;
136
136
  },
137
- message: `Choose which actions to update (Press ${pc.cyan("<space>")} to select, ${pc.cyan("<a>")} to toggle all, ${pc.cyan("<i>")} to invert selection)`,
137
+ format() {
138
+ if (this.state?.submitted !== !0 || this.state.cancelled === !0) return "";
139
+ let e = _(D, m(Array.isArray(this.value) ? this.value : [], O)).length;
140
+ return e === 0 ? "" : x(e);
141
+ },
142
+ message: `Choose which actions to update (Press ${s.cyan("<space>")} to select, ${s.cyan("<a>")} to toggle all, ${s.cyan("<i>")} to invert selection)`,
138
143
  styles: {
139
- success: pc.reset,
140
- em: pc.bgBlack,
141
- dark: pc.reset
144
+ success: s.reset,
145
+ em: s.bgBlack,
146
+ dark: s.reset
142
147
  },
143
148
  cancel() {
144
- return logSelectionCancelled(), null;
149
+ return C(), null;
145
150
  },
146
151
  j() {
147
152
  return this.down?.() ?? Promise.resolve([]);
@@ -153,44 +158,66 @@ async function promptUpdateSelection(g, v = {}) {
153
158
  type: "multiselect",
154
159
  name: "selected",
155
160
  pointer: "❯",
156
- choices: C
157
- }, { selected: i } = await enquirer.prompt(t), a = /* @__PURE__ */ new Set();
158
- for (let t of i) {
159
- if (t.startsWith("label|")) {
160
- let i = t.slice(6), o = x.get(i) ?? [];
161
- for (let { update: t, index: i } of o) t.latestSha && a.add(i);
162
- continue;
163
- }
164
- let i = Number.parseInt(t, 10);
165
- Number.isFinite(i) && a.add(i);
161
+ choices: A
162
+ }, { selected: t } = await c.prompt(e), n = _(D, m(t, O));
163
+ return n.length === 0 ? (console.info(s.yellow("\nNo actions selected")), null) : n;
164
+ } catch (e) {
165
+ if (e instanceof Error && (e.message.includes("cancelled") || e.message.includes("ESC") || e.name === "ExitPromptError")) return C(), null;
166
+ throw console.error(s.red("Unexpected error during selection:"), e), e;
167
+ }
168
+ }
169
+ function m(e, t) {
170
+ let n = /* @__PURE__ */ new Set();
171
+ for (let r of e) {
172
+ if (r.startsWith("label|")) {
173
+ let e = r.slice(6), i = t.get(e) ?? [];
174
+ for (let { update: e, index: t } of i) w(e) && n.add(t);
175
+ continue;
166
176
  }
167
- let o = [];
168
- for (let [t, i] of b.entries()) a.has(t) && i.latestSha && o.push(i);
169
- return o.length === 0 ? (console.info(pc.yellow("\nNo actions selected")), null) : o;
170
- } catch (t) {
171
- if (t instanceof Error && (t.message.includes("cancelled") || t.message.includes("ESC") || t.name === "ExitPromptError")) return logSelectionCancelled(), null;
172
- throw console.error(pc.red("Unexpected error during selection:"), t), t;
177
+ let e = Number.parseInt(r, 10);
178
+ Number.isFinite(e) && n.add(e);
173
179
  }
180
+ return n;
174
181
  }
175
- function formatAge(t) {
176
- if (!t) return "";
177
- let i = Date.now() - t.getTime(), a = Math.floor(i / (1e3 * 60 * 60)), o = Math.floor(a / 24), s = Math.floor(o / 7), c = o % 7;
178
- return s >= 1 ? c > 0 ? `${s}w ${c}d` : `${s}w` : o >= 1 ? `${o}d` : `${a}h`;
182
+ function h(e) {
183
+ if (!e) return "";
184
+ let t = Date.now() - e.getTime(), n = Math.floor(t / (1e3 * 60 * 60)), r = Math.floor(n / 24), i = Math.floor(r / 7), a = r % 7;
185
+ return i >= 1 ? a > 0 ? `${i}w ${a}d` : `${i}w` : r >= 1 ? `${r}d` : `${n}h`;
179
186
  }
180
- function formatTableRow(t) {
181
- let { currentWidth: i, actionWidth: a, targetWidth: o, jobWidth: s, ageWidth: l, row: u } = t, d = [
182
- padString(u.action, a),
183
- padString(u.job, s),
184
- padString(u.current, i),
185
- u.arrow,
186
- padString(u.target, o)
187
+ function g(e) {
188
+ let { currentWidth: t, actionWidth: n, targetWidth: r, jobWidth: i, ageWidth: o, row: s } = e, c = [
189
+ a(s.action, n),
190
+ a(s.job, i),
191
+ a(s.current, t),
192
+ s.arrow,
193
+ a(s.target, r)
187
194
  ];
188
- return l > 0 && d.push(u.age), d.join(" ").replace(/\s+$/u, "");
195
+ return o > 0 && c.push(s.age), c.join(" ").replace(/\s+$/u, "");
196
+ }
197
+ function _(e, t) {
198
+ let n = [];
199
+ for (let [r, i] of e.entries()) t.has(r) && w(i) && n.push(i);
200
+ return n;
201
+ }
202
+ function v(e) {
203
+ return e ? r(e) ? e.slice(0, 7) : e.replace(/^v/u, "") : s.gray("unknown");
204
+ }
205
+ function y(e) {
206
+ return b(e) === "tag" && S(e) ? S(e) : e.latestVersion;
207
+ }
208
+ function b(e) {
209
+ return e.targetRefStyle ? e.targetRefStyle : e.latestSha ? "sha" : null;
210
+ }
211
+ function x(e) {
212
+ return `${e} ${e === 1 ? "action" : "actions"} selected`;
213
+ }
214
+ function S(e) {
215
+ return e.targetRef ? e.targetRef : e.latestSha;
189
216
  }
190
- function formatVersionOrSha(t) {
191
- return t ? isSha(t) ? t.slice(0, 7) : t.replace(/^v/u, "") : pc.gray("unknown");
217
+ function C() {
218
+ console.info(`\r\u001B[K${s.yellow("Selection cancelled")}`);
192
219
  }
193
- function logSelectionCancelled() {
194
- console.info(`\r\u001B[K${pc.yellow("Selection cancelled")}`);
220
+ function w(e) {
221
+ return !!S(e);
195
222
  }
196
- export { promptUpdateSelection };
223
+ export { p as promptUpdateSelection };
@@ -1,4 +1,4 @@
1
- function stripAnsi(e) {
1
+ function e(e) {
2
2
  let t = "", n = 0;
3
3
  for (; n < e.length;) if (e.charCodeAt(n) === 27 && n + 1 < e.length && e[n + 1] === "[") for (n += 2; n < e.length;) {
4
4
  let r = e[n];
@@ -11,4 +11,4 @@ function stripAnsi(e) {
11
11
  else t += e[n], n++;
12
12
  return t;
13
13
  }
14
- export { stripAnsi };
14
+ export { e as stripAnsi };
@@ -1,4 +1,4 @@
1
- function parseActionReference(e, t, n) {
1
+ function e(e, t, n) {
2
2
  if (!e || e.trim() === "") return null;
3
3
  if (e.startsWith("docker://")) return {
4
4
  version: void 0,
@@ -31,4 +31,4 @@ function parseActionReference(e, t, n) {
31
31
  line: n
32
32
  };
33
33
  }
34
- export { parseActionReference };
34
+ export { e as parseActionReference };
@@ -1,7 +1,7 @@
1
- import { scanCompositeActionAst } from "./ast/scanners/scan-composite-action-ast.js";
2
- import { readYamlDocument } from "./fs/read-yaml-document.js";
3
- async function scanActionFile(n) {
4
- let { document: r, content: i } = await readYamlDocument(n);
5
- return scanCompositeActionAst(r, i, n);
1
+ import { scanCompositeActionAst as e } from "./ast/scanners/scan-composite-action-ast.js";
2
+ import { readYamlDocument as t } from "./fs/read-yaml-document.js";
3
+ async function n(n) {
4
+ let { document: r, content: i } = await t(n);
5
+ return e(r, i, n);
6
6
  }
7
- export { scanActionFile };
7
+ export { n as scanActionFile };