@justanarthur/just-github-actions-n-workflows-cli 0.0.0-beta.13 → 0.0.0-beta.15

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.
@@ -75,7 +75,10 @@ export default class Init extends Command {
75
75
  return "main";
76
76
  const choices = [
77
77
  { name: `main ${ux.colorize("dim", "(latest)")}`, value: "main" },
78
- ...tags.slice(0, 9).map((tag) => ({ name: tag, value: tag })),
78
+ ...tags.slice(0, 9).map((t) => ({
79
+ name: `${t.version} ${ux.colorize("dim", `(${t.tag})`)}`,
80
+ value: t.tag,
81
+ })),
79
82
  ];
80
83
  const ref = await select({
81
84
  message: "Pick a version",
package/dist/github.js CHANGED
@@ -1,11 +1,16 @@
1
1
  import { createRequire } from "node:module";
2
2
  const require = createRequire(import.meta.url);
3
3
  const pkg = require("../package.json");
4
+ const rootPkg = require("../../package.json");
4
5
  const REPO = pkg.repository.url
5
6
  .replace(/^https?:\/\/github\.com\//, "")
6
7
  .replace(/\.git$/, "");
7
8
  const API_BASE = `https://api.github.com/repos/${REPO}`;
8
9
  const RAW_BASE = `https://raw.githubusercontent.com/${REPO}`;
10
+ // --- root package tag prefix ---
11
+ // tags for the root toolkit package follow `<root-name>@<version>`.
12
+ // the CLI only shows these tags as version choices since workflows are part of the root package.
13
+ const TAG_PREFIX = `${rootPkg.name}@`;
9
14
  export { REPO };
10
15
  // --- parse workflow header ---
11
16
  // extracts description and required secrets from the yaml header comment block.
@@ -40,20 +45,26 @@ export function parseWorkflowHeader(content) {
40
45
  }
41
46
  // --- api ---
42
47
  export async function fetchTags() {
43
- const url = `${API_BASE}/tags?per_page=20`;
48
+ const url = `${API_BASE}/tags?per_page=100`;
44
49
  const res = await fetch(url, {
45
50
  headers: { Accept: "application/vnd.github.v3+json" }
46
51
  });
47
52
  if (!res.ok)
48
53
  return [];
49
54
  const tags = await res.json();
50
- return tags.map((t) => t.name);
55
+ return tags
56
+ .map((t) => t.name)
57
+ .filter((name) => name.startsWith(TAG_PREFIX))
58
+ .map((name) => ({
59
+ tag: name,
60
+ version: name.slice(TAG_PREFIX.length)
61
+ }));
51
62
  }
52
63
  // --- fetchLatestTag ---
53
- // returns the most recent tag, or "main" if no tags exist.
64
+ // returns the most recent root toolkit tag, or "main" if none exist.
54
65
  export async function fetchLatestTag() {
55
66
  const tags = await fetchTags();
56
- return tags.length > 0 ? tags[0] : "main";
67
+ return tags.length > 0 ? tags[0].tag : "main";
57
68
  }
58
69
  export async function fetchWorkflowList(gitRef) {
59
70
  const url = `${API_BASE}/contents/workflows?ref=${gitRef}`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@justanarthur/just-github-actions-n-workflows-cli",
3
- "version": "0.0.0-beta.13",
3
+ "version": "0.0.0-beta.15",
4
4
  "description": "Release automation toolkit — version bumping, npm publishing, docker publishing, VPS deployment via GitHub Actions composite actions",
5
5
  "type": "module",
6
6
  "bin": {