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,46 +1,46 @@
|
|
|
1
|
-
import { isCompositeActionStructure } from "./schema/composite/is-composite-action-structure.js";
|
|
2
|
-
import { scanCompositeActionAst } from "./ast/scanners/scan-composite-action-ast.js";
|
|
3
|
-
import { isWorkflowStructure } from "./schema/workflow/is-workflow-structure.js";
|
|
4
|
-
import { findYamlFilesRecursive } from "./fs/find-yaml-files-recursive.js";
|
|
5
|
-
import { scanWorkflowAst } from "./ast/scanners/scan-workflow-ast.js";
|
|
6
|
-
import { readYamlDocument } from "./fs/read-yaml-document.js";
|
|
7
|
-
import { dirname, relative, resolve } from "node:path";
|
|
8
|
-
async function
|
|
1
|
+
import { isCompositeActionStructure as e } from "./schema/composite/is-composite-action-structure.js";
|
|
2
|
+
import { scanCompositeActionAst as t } from "./ast/scanners/scan-composite-action-ast.js";
|
|
3
|
+
import { isWorkflowStructure as n } from "./schema/workflow/is-workflow-structure.js";
|
|
4
|
+
import { findYamlFilesRecursive as r } from "./fs/find-yaml-files-recursive.js";
|
|
5
|
+
import { scanWorkflowAst as i } from "./ast/scanners/scan-workflow-ast.js";
|
|
6
|
+
import { readYamlDocument as a } from "./fs/read-yaml-document.js";
|
|
7
|
+
import { dirname as o, relative as s, resolve as c } from "node:path";
|
|
8
|
+
async function l(l, d) {
|
|
9
9
|
let f = {
|
|
10
10
|
compositeActions: /* @__PURE__ */ new Map(),
|
|
11
11
|
workflows: /* @__PURE__ */ new Map(),
|
|
12
12
|
actions: []
|
|
13
|
-
}, p =
|
|
13
|
+
}, p = c(l), m = c(p, d), h;
|
|
14
14
|
try {
|
|
15
|
-
h = await
|
|
15
|
+
h = await r(m);
|
|
16
16
|
} catch {
|
|
17
17
|
return f;
|
|
18
18
|
}
|
|
19
|
-
let g = h.map(async (
|
|
20
|
-
let
|
|
19
|
+
let g = h.map(async (r) => {
|
|
20
|
+
let o = s(p, r);
|
|
21
21
|
try {
|
|
22
|
-
let { document:
|
|
23
|
-
if (
|
|
22
|
+
let { document: s, content: c } = await a(r), l = s.toJSON();
|
|
23
|
+
if (n(l) && u(l, "jobs")) return {
|
|
24
24
|
type: "workflow",
|
|
25
|
-
path:
|
|
26
|
-
actions:
|
|
25
|
+
path: o,
|
|
26
|
+
actions: i(s, c, r)
|
|
27
27
|
};
|
|
28
|
-
if (
|
|
28
|
+
if (e(l) && u(l, "runs")) return {
|
|
29
29
|
type: "action",
|
|
30
|
-
path:
|
|
31
|
-
actions:
|
|
30
|
+
path: o,
|
|
31
|
+
actions: t(s, c, r)
|
|
32
32
|
};
|
|
33
33
|
} catch {}
|
|
34
34
|
return null;
|
|
35
35
|
}), _ = await Promise.all(g);
|
|
36
36
|
for (let e of _) if (e) if (e.type === "workflow") f.workflows.set(e.path, e.actions), f.actions.push(...e.actions);
|
|
37
37
|
else {
|
|
38
|
-
let
|
|
39
|
-
f.compositeActions.set(
|
|
38
|
+
let t = o(e.path), n = t === "." || t === "" ? e.path : t;
|
|
39
|
+
f.compositeActions.set(n, e.path), f.actions.push(...e.actions);
|
|
40
40
|
}
|
|
41
41
|
return f;
|
|
42
42
|
}
|
|
43
|
-
function
|
|
44
|
-
return typeof e == "object" && !!e &&
|
|
43
|
+
function u(e, t) {
|
|
44
|
+
return typeof e == "object" && !!e && t in e;
|
|
45
45
|
}
|
|
46
|
-
export { scanRecursive };
|
|
46
|
+
export { l as scanRecursive };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { scanWorkflowAst } from "./ast/scanners/scan-workflow-ast.js";
|
|
2
|
-
import { readYamlDocument } from "./fs/read-yaml-document.js";
|
|
3
|
-
async function
|
|
4
|
-
let { document: r, content: i } = await
|
|
5
|
-
return
|
|
1
|
+
import { scanWorkflowAst as e } from "./ast/scanners/scan-workflow-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 { scanWorkflowFile };
|
|
7
|
+
export { n as scanWorkflowFile };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
function
|
|
1
|
+
function e(e) {
|
|
2
2
|
if (typeof e != "object" || !e || Array.isArray(e)) return !1;
|
|
3
3
|
let t = e;
|
|
4
4
|
return "name" in t || "description" in t || "runs" in t;
|
|
5
5
|
}
|
|
6
|
-
export { isCompositeActionStructure };
|
|
6
|
+
export { e as isCompositeActionStructure };
|
|
@@ -1,24 +1,35 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
targetRefStyle: "sha"
|
|
6
|
-
} : {
|
|
7
|
-
...e,
|
|
1
|
+
import { preserveTagFormat as e } from "../versions/preserve-tag-format.js";
|
|
2
|
+
function t(t, n) {
|
|
3
|
+
if (!t.hasUpdate) return {
|
|
4
|
+
...t,
|
|
8
5
|
targetRefStyle: null,
|
|
9
6
|
targetRef: null
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
7
|
+
};
|
|
8
|
+
if (n === "sha" || t.currentRefType === "sha") return t.latestSha ? {
|
|
9
|
+
...t,
|
|
10
|
+
targetRef: t.latestSha,
|
|
11
|
+
targetRefStyle: "sha"
|
|
14
12
|
} : {
|
|
15
|
-
...
|
|
13
|
+
...t,
|
|
16
14
|
targetRefStyle: null,
|
|
17
15
|
targetRef: null
|
|
18
|
-
}
|
|
19
|
-
|
|
16
|
+
};
|
|
17
|
+
if (t.currentRefType === "tag" && t.latestVersion) {
|
|
18
|
+
let n = e(t.currentVersion, t.latestVersion);
|
|
19
|
+
return n ? {
|
|
20
|
+
...t,
|
|
21
|
+
targetRef: n,
|
|
22
|
+
targetRefStyle: "tag"
|
|
23
|
+
} : {
|
|
24
|
+
...t,
|
|
25
|
+
targetRefStyle: null,
|
|
26
|
+
targetRef: null
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
return {
|
|
30
|
+
...t,
|
|
20
31
|
targetRefStyle: null,
|
|
21
32
|
targetRef: null
|
|
22
33
|
};
|
|
23
34
|
}
|
|
24
|
-
export { resolveTargetReference };
|
|
35
|
+
export { t as resolveTargetReference };
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
function
|
|
5
|
-
if (!a || !
|
|
6
|
-
let s =
|
|
1
|
+
import { isSemverLike as e } from "./is-semver-like.js";
|
|
2
|
+
import { normalizeVersion as t } from "./normalize-version.js";
|
|
3
|
+
import n from "semver";
|
|
4
|
+
function r(r, a, o) {
|
|
5
|
+
if (!a || !e(a) || r.length === 0) return null;
|
|
6
|
+
let s = n.valid(t(a));
|
|
7
7
|
if (!s) return null;
|
|
8
|
-
let c =
|
|
8
|
+
let c = n.major(s), l = n.minor(s), u = [];
|
|
9
9
|
for (let i of r) {
|
|
10
|
-
if (!
|
|
11
|
-
let r =
|
|
12
|
-
r &&
|
|
10
|
+
if (!e(i.tag)) continue;
|
|
11
|
+
let r = n.valid(t(i.tag));
|
|
12
|
+
r && n.gt(r, s) && n.major(r) === c && (o === "patch" && n.minor(r) !== l || u.push({
|
|
13
13
|
tag: i,
|
|
14
14
|
parsed: r
|
|
15
15
|
}));
|
|
16
16
|
}
|
|
17
|
-
return u.length === 0 ? null : (u.sort((e,
|
|
18
|
-
let r =
|
|
17
|
+
return u.length === 0 ? null : (u.sort((e, t) => {
|
|
18
|
+
let r = n.rcompare(e.parsed, t.parsed);
|
|
19
19
|
if (r !== 0) return r;
|
|
20
|
-
let a =
|
|
21
|
-
return
|
|
20
|
+
let a = i(e.tag.tag);
|
|
21
|
+
return i(t.tag.tag) - a;
|
|
22
22
|
}), u[0].tag);
|
|
23
23
|
}
|
|
24
|
-
function
|
|
24
|
+
function i(e) {
|
|
25
25
|
return e.replace(/^v/u, "").split(".").length;
|
|
26
26
|
}
|
|
27
|
-
export { findCompatibleTag };
|
|
27
|
+
export { r as findCompatibleTag };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
function
|
|
1
|
+
import e from "semver";
|
|
2
|
+
function t(t, r) {
|
|
3
3
|
if (!t || !r) return "unknown";
|
|
4
|
-
let i =
|
|
4
|
+
let i = n(t), a = n(r);
|
|
5
5
|
if (!i || !a) return "unknown";
|
|
6
|
-
if (
|
|
7
|
-
let o =
|
|
6
|
+
if (e.eq(i, a)) return "none";
|
|
7
|
+
let o = e.diff(i, a);
|
|
8
8
|
if (!o) return "none";
|
|
9
9
|
switch (o) {
|
|
10
10
|
case "premajor":
|
|
@@ -16,8 +16,8 @@ function getUpdateLevel(t, r) {
|
|
|
16
16
|
default: return "unknown";
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
|
-
function
|
|
20
|
-
let n =
|
|
19
|
+
function n(t) {
|
|
20
|
+
let n = e.coerce(t);
|
|
21
21
|
return n ? n.version : null;
|
|
22
22
|
}
|
|
23
|
-
export { getUpdateLevel };
|
|
23
|
+
export { t as getUpdateLevel };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
function
|
|
1
|
+
import e from "semver";
|
|
2
|
+
function t(t) {
|
|
3
3
|
if (!t) return null;
|
|
4
4
|
let n = t.replace(/^v/u, "");
|
|
5
5
|
if (/^[0-9a-f]{7,40}$/iu.test(n)) return t;
|
|
6
|
-
let r =
|
|
6
|
+
let r = e.coerce(n);
|
|
7
7
|
return r ? r.version : t;
|
|
8
8
|
}
|
|
9
|
-
export { normalizeVersion };
|
|
9
|
+
export { t as normalizeVersion };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Preserve the semver granularity of the current tag when projecting a newer
|
|
3
|
+
* tag reference.
|
|
4
|
+
*
|
|
5
|
+
* Examples:
|
|
6
|
+
*
|
|
7
|
+
* - `v6` + `v7.0.2` -> `v7`
|
|
8
|
+
* - `v6.1` + `v6.2.3` -> `v6.2`
|
|
9
|
+
* - `v6.1.4` + `v6.2.3` -> `v6.2.3`.
|
|
10
|
+
*
|
|
11
|
+
* Returns null when the target tag cannot be preserved safely.
|
|
12
|
+
*
|
|
13
|
+
* @param currentVersion - Current tag reference found in the workflow.
|
|
14
|
+
* @param latestVersion - Latest resolved tag reference.
|
|
15
|
+
* @returns Preserved tag reference or null when preservation is unsafe.
|
|
16
|
+
*/
|
|
17
|
+
export declare function preserveTagFormat(currentVersion: undefined | string | null, latestVersion: undefined | string | null): string | null;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { isSemverLike as e } from "./is-semver-like.js";
|
|
2
|
+
function t(t, n) {
|
|
3
|
+
if (!t || !n) return null;
|
|
4
|
+
let r = t.trim(), i = n.trim();
|
|
5
|
+
if (!e(r) || !e(i)) return null;
|
|
6
|
+
let a = r.startsWith("v");
|
|
7
|
+
if (a !== i.startsWith("v")) return null;
|
|
8
|
+
let o = r.replace(/^v/u, "").split("."), s = i.replace(/^v/u, "").split(".");
|
|
9
|
+
return s.length < o.length ? null : `${a ? "v" : ""}${s.slice(0, o.length).join(".")}`;
|
|
10
|
+
}
|
|
11
|
+
export { t as preserveTagFormat };
|
|
@@ -1,9 +1,9 @@
|
|
|
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, r) {
|
|
3
3
|
try {
|
|
4
4
|
if (!t || !n || n <= 0) return null;
|
|
5
5
|
let i = r?.get(t);
|
|
6
|
-
i === void 0 && (i = await
|
|
6
|
+
i === void 0 && (i = await e(t, "utf8"), r && r.set(t, i));
|
|
7
7
|
let a = i.split("\n"), o = n - 1;
|
|
8
8
|
if (o < 0 || o >= a.length) return null;
|
|
9
9
|
let s = a[o].match(/#\s*(?<version>[Vv]?\d+(?:\.\d+){0,2}(?:[+-][\w\-.]+)?)/u);
|
|
@@ -11,4 +11,4 @@ async function readInlineVersionComment(t, n, r) {
|
|
|
11
11
|
} catch {}
|
|
12
12
|
return null;
|
|
13
13
|
}
|
|
14
|
-
export { readInlineVersionComment };
|
|
14
|
+
export { t as readInlineVersionComment };
|
package/dist/package.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
export { version };
|
|
1
|
+
var e = "1.14.2";
|
|
2
|
+
export { e as version };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "actions-up",
|
|
3
|
-
"version": "1.14.
|
|
3
|
+
"version": "1.14.2",
|
|
4
4
|
"description": "Interactive CLI tool to update GitHub Actions with SHA pinning or preserved refs",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"github-actions",
|
|
@@ -40,8 +40,8 @@
|
|
|
40
40
|
"enquirer": "^2.4.1",
|
|
41
41
|
"nanospinner": "^1.2.2",
|
|
42
42
|
"picocolors": "^1.1.1",
|
|
43
|
-
"semver": "^7.
|
|
44
|
-
"yaml": "^2.
|
|
43
|
+
"semver": "^7.8.0",
|
|
44
|
+
"yaml": "^2.9.0"
|
|
45
45
|
},
|
|
46
46
|
"engines": {
|
|
47
47
|
"node": "^18.0.0 || >=20.0.0"
|
package/readme.md
CHANGED
|
@@ -3,9 +3,8 @@
|
|
|
3
3
|
<img
|
|
4
4
|
src="https://raw.githubusercontent.com/azat-io/actions-up/main/assets/logo.svg"
|
|
5
5
|
alt="Actions Up logo"
|
|
6
|
-
width="160"
|
|
7
|
-
height="160"
|
|
8
6
|
align="right"
|
|
7
|
+
width="160"
|
|
9
8
|
/>
|
|
10
9
|
|
|
11
10
|
[](https://npmjs.com/package/actions-up)
|
|
@@ -102,7 +101,8 @@ Per-project
|
|
|
102
101
|
npm install --save-dev actions-up
|
|
103
102
|
```
|
|
104
103
|
|
|
105
|
-
Alternatively, you can install Actions Up with
|
|
104
|
+
Alternatively, you can install Actions Up with
|
|
105
|
+
[Homebrew](https://formulae.brew.sh/formula/actions-up)
|
|
106
106
|
|
|
107
107
|
```bash
|
|
108
108
|
brew install actions-up
|
|
@@ -214,9 +214,11 @@ Use `--style preserve` to keep the current reference style:
|
|
|
214
214
|
npx actions-up --style preserve
|
|
215
215
|
```
|
|
216
216
|
|
|
217
|
-
`preserve` keeps tag references on tags and SHA references on SHAs.
|
|
218
|
-
`actions/checkout@v5` updates to
|
|
219
|
-
|
|
217
|
+
`preserve` keeps tag references on tags and SHA references on SHAs. Tag refs
|
|
218
|
+
also keep their granularity, so `actions/checkout@v5` updates to
|
|
219
|
+
`actions/checkout@v6`, while `actions/checkout@v5.0` updates to
|
|
220
|
+
`actions/checkout@v6.0`. A SHA-pinned action continues updating to the latest
|
|
221
|
+
resolved SHA.
|
|
220
222
|
|
|
221
223
|
## GitHub Actions Integration
|
|
222
224
|
|