Skip to content

release/v3.0.0 - #3

Merged
Shinrai merged 52 commits into
masterfrom
release/v3.0.0
May 20, 2026
Merged

Shinrai merged 52 commits into
masterfrom
release/v3.0.0

Conversation

@Shinrai

@Shinrai Shinrai commented May 20, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@Shinrai Shinrai self-assigned this May 20, 2026
Shinrai added 29 commits May 20, 2026 10:29
Convert calculate-names, commit-gate, build-project, and run-tests from
composite shell actions to `using: node24` actions. Expand the shared
common/common/core.mjs lib with getInput/getBooleanInput, setOutput/
setOutputs, appendSummary, getEventPayload, and exec helpers.

commit-gate now reads the head commit from GITHUB_EVENT_PATH directly
instead of relying on injected `github.event.head_commit.message` env.
Input/output names are unchanged, so callers need no updates.
Convert detect-default-branch, git extract-version, and
generate-version-documentation to `using: node24` actions. Convert the
shell logic of check-version-tags and update-major-version-tags to Node
delegation steps (these keep a composite shell only because they invoke
another action — checkout and upsert-batch respectively).

Behavior and input/output names are preserved. extract-version and
commit-gate-style event reads now use GITHUB_EVENT_PATH instead of
context expressions.
Convert install-dependencies, update-package-version, calculate-version,
npm extract-version, create-package, and create-package-files to
`using: node24` actions. publish-package keeps a thin composite (it
uses checkout/download-artifact/setup-node) with its verify and publish
shell steps moved to Node delegation (verify.mjs, publish.mjs).

Archive creation in create-package-files still shells out to tar/zip
(no Node built-in writer); all surrounding logic is now Node. Input and
output names are unchanged.
Convert the shell logic of build-and-test, publish-npm, and
publish-github-packages to Node delegation steps (these stay composite
because they invoke other actions). The scattered "Update Summary -
*" echo steps are consolidated into one final Node summary step per
action; generate-command and the package-contents extraction are now
Node. Input/output names unchanged.
Convert these two composite shell actions to `using: node24`. GitHub
API calls now go through the shared github/api/_api/core.mjs `api()`
helper (fetch-based) instead of curl + jq. Input/output names unchanged.
Convert github/api/commit (git tree/blob/commit plumbing) and
github/api/pull-requests (create/update PR + labels) from composite
shell actions to `using: node24`. add-success-comment moves from an
inline actions/github-script block to a node24 action.

GitHub API calls route through the shared _api/core.mjs fetch helper.
add-success-comment and pull-requests gain a `github-token` input
(default github.token) since node actions get no implicit token;
pull-requests still prefers the GITHUB_TOKEN env var when set.
…rators to Node

Both stay composite (they invoke other actions) but every inline shell
step is now Node delegation. The many interleaved "Update Summary - *"
echo steps are consolidated into a single Node summary step per action;
the three dry-run output steps in create-release collapse into one
dry-run.mjs. Substantive logic (version detect, branch divergence,
src/ restore, label aliases, release draft enforcement, dry-run
validation) moves into per-step .mjs files. External inputs/outputs
unchanged.
…ions

Add node/steps/generate-matrix (Node.js test-matrix builder) and
workflows/ci-summary (CI job summary renderer), replacing inline shell
in reusable-build-and-test.yml and workflow-ci.yml with `uses:` of the
new Node actions.
…ctions

Replace every inline shell step of workflow-release.yml's
update-existing-pr job with new Node actions: git/steps/find-divergence
and restore-deleted-src, npm/steps/resolve-version, and github/steps/
get-pr-commit-range, update-pr-changelog, compute-label-aliases,
sync-pr-labels. GitHub API calls use the shared _api fetch helper
instead of gh/jq.
The update-version-tags job in reusable-publishing.yml ran
update-major-version-tags with no token, so it silently fell back to
the default Actions GITHUB_TOKEN — which can never hold the `workflows`
scope. Moving a rolling vX/vX.Y tag onto a release commit that touches
.github/workflows/ci.yml was therefore rejected by both `git push` and
the REST refs API (the slothlet v2.2 failure).

- Add a Create App token step to the update-version-tags job and pass
  the token through the new `github_token` input.
- git/jobs/update-major-version-tags: declare a `github_token` input
  instead of relying on an undeclared `env.GITHUB_TOKEN`; all token
  references now resolve `inputs.github_token || env.GITHUB_TOKEN ||
  github.token`, so existing callers (reusable-tag-health) still work.

The token is minted in full mode (no fine-grained permission flags), so
it inherits every permission the CLDMV bot GitHub App holds — including
the Workflows: write scope the App is already granted. No GitHub App
configuration change is required.
… to Node

Replace reusable-tag-health.yml inline shell with Node actions:
github/steps/setup-git-identity (resolves the bot user and configures
git), git/steps/find-latest-semver-tag, and git/steps/
generate-tag-update-summary.

Also fix the same token-wiring bug as the publish path: the "Update
major/minor version tags" step passed the App token via `env:
GITHUB_TOKEN`, but git/steps/update-major-version-tags reads it from
the `github_token` input — so it silently used github.token. Now
passed via `with: github_token`.
Convert the four inline shell steps of the git/jobs/update-major-version-tags
composite (should-run, get-tag, create-semver-tag, summary) to Node
delegation scripts. create-semver-tag now creates the ref through the
shared _api fetch helper (Bearer + application/vnd.github+json) instead
of curl with the deprecated token / v3+json headers.
- _api/core.mjs: X-GitHub-Api-Version 2022-11-28 -> 2026-03-10, matching
  repo-conventions.instructions.md and the rest of the repo.
- workflow-publish.yml: remove the debug-inputs job (three echo lines)
  and the now-needless build-and-test `needs:` on it.
…to Node

- get-node-version: composite shell -> using: node24.
- fix-orphaned-version-tags: move the orphan-detection logic out of the
  `node <<'EOF'` bash heredoc into a proper gather.mjs delegation script.
build-project, calculate-names, commit-gate, and run-tests imported
"../../common/common/core.mjs" — one level short, which resolves to a
non-existent path and would fail at runtime with ERR_MODULE_NOT_FOUND.
Correct to "../../../common/common/core.mjs" (up to actions/, then into
common/common/), matching every other layer's actions.
- create-release-pr now uses the standalone git/steps/restore-deleted-src
  and github/steps/compute-label-aliases actions instead of its own
  duplicate restore-src.mjs / raw-labels.mjs delegation scripts.
- generate-version-documentation: resolve the push target branch from
  the event payload, then origin/HEAD, then GITHUB_REF_NAME; skip the
  push with a warning instead of pushing to an empty "HEAD:" target.
…ture

Both READMEs described a stale layout (a non-existent ci-jobs.yml
orchestrator, a workflow-packages/ directory, composite actions, and
@v2 paths missing the workflow- prefix). Rewrite them to describe the
actual structure: workflow-*.yml entry points, reusable-*.yml run_*
orchestrators, and the .github/actions/ Node-action layers with the
shared core.mjs lib.
package.json carried no version field, so the tag-derivation actions
(get-tag, should-run, calculate-version) fell back to scanning git
tags instead of using package.json as the source of truth. Set it to
2.0.39 — the current latest release tag — so the version is tracked
alongside the rolling tags.
…e bump

Add a "Node Actions" section to repo-conventions.instructions.md (the
node24 + core.mjs lib convention, no-deps rule, composite-only-for-uses)
and add the package.json version bump as step 1 of the Standard release
procedure so package.json stays in sync with the tags.
…e+publish

CI (examples/individual-repo-workflows/ci.yml):
- Make `push` the primary trigger; PR sync no longer re-runs CI on the
  same SHA. Branch protection still works because the status check
  attaches to the commit SHA, not the event type.
- Keep `pull_request` for fork PRs only (push doesn't fire upstream for
  fork commits). Gated on the job with
  `github.event.pull_request.head.repo.fork == true`. The repo-level
  "Require approval to run workflows" setting prevents abuse.
- Add concurrency keyed on `github.ref`; cancel superseded runs on
  feature branches, keep every master/main run as the audit record.
- Push to master/main forces `lts_only_matrix: true` for a fast LTS
  confidence check post-merge (full matrix still runs pre-merge on
  feature branches).
- Gate the `required-check` mirror with the same condition so a skipped
  `ci` job doesn't overwrite the push run's status on the same SHA.

Release (examples/individual-repo-workflows/release.yml):
- Add concurrency keyed on ref with `cancel-in-progress: true` so rapid
  pushes to a release branch don't stack 5+ Create-Release-PR runs.
- Expand `paths-ignore` (LICENSE, .gitignore, .github/workflows/**,
  badges branch) so non-source changes don't spawn release-PR builds.

Publish (examples/individual-repo-workflows/publish.yml):
- Add concurrency with `cancel-in-progress: false` so concurrent
  publishes serialize instead of cancelling — half-published versions
  are nasty to recover.

WORKFLOW-README.md:
- Document the "Require approval for outside collaborators" Actions
  setting; link to GitHub's docs on approving fork-PR workflow runs.
Companion to commit 6909fea (which excluded master/main/badges where
appropriate). Future Batch 6.1 docs-publisher workflow will push built
docs to a gh-pages branch; those pushes carry no source code and
should not trigger CI or release-PR workflows.

- examples/.../ci.yml: change `branches: ["**"]` to
  `branches-ignore: [badges, gh-pages]`. Bot-managed branches don't
  carry buildable code.
- examples/.../release.yml: extend `branches-ignore` from
  `[master, main, badges]` to `[master, main, badges, gh-pages]`.

Plan doc (tmp/plan-future-workflows.md) was already consistent: gh-pages
appears in branch retention exempt list, Rulesets allowed patterns, and
the branch convention table.
P3.1 from tmp/plan-future-workflows.md.

Bug: divergence.mjs and find-divergence/action.mjs both used
`git show <merge-base>:package.json` to read the version that the
bump is calculated against. The merge-base is frozen at the moment
the release branch was created; if master moves forward (a parallel
release lands or a non-release PR merges) while the release branch
sits open, the bump is calculated off stale data.

Concrete failure: parallel `release/3.6.0` and `hotfix/3.5.2`
branches both calculated from [email protected] — each gets a sensible
version (3.6.0 and 3.5.1). `release/3.6.0` merges first → master
is v3.6.0. `hotfix/3.5.2` merges second with its branch still
saying v3.5.1 in package.json → master silently regresses to v3.5.1.

Fix: keep the merge-base SHA (still needed downstream as the
changelog commit-range base), but read `base-version` from
`origin/<defaultBranch>:package.json` (current master state)
instead of the merge-base. The bump always targets the latest
published state on master.

Implications for the linear-release model:
- A patch branch off v3.5.0 will calculate v3.6.1 if master is
  currently v3.6.0, not v3.5.1.
- Maintenance branches (continuing to ship v3.5.x after v3.6.0
  lands) need explicit per-branch base-version override and are
  out of scope for this fix; add when there's a concrete repo
  that needs it.

Combined with P3.2 (auto-update open release PRs on master merge,
forthcoming), this closes the silent-regression bug entirely. P3.1
alone fixes the case where the release branch gets any subsequent
push before merging; P3.2 covers the case where no subsequent push
happens.

Also updates:
- divergence.mjs file-header docstring (reflects new semantics)
- calculate-version action.yml `base-version` input description
Shinrai added 20 commits May 20, 2026 10:29
P3.3 from tmp/plan-future-workflows.md.

Bug: reusable-publishing.yml had no gate that checks whether the
package.json version has actually changed. When a non-release PR
merges to master, the publish workflow fires anyway and runs all
the way to `npm publish`, which fails with "version already
published." Multiple such failures train people to ignore the red
❌ marks on the publish workflow.

Fix: expose extract-version's `npm-latest-version` output at the
detect-version job level, then add `if:` gates on publish-npm,
publish-github-packages, and create-release that compare it against
the version to be published. When equal (and not dry_run), those
jobs skip cleanly. update-version-tags inherits the skip via its
needs: [create-release] dependency.

Also adds a "Report skip-publish status" step to detect-version
that prints either:
- "📦 vX.Y.Z already on NPM — downstream publish/release jobs
  will skip" (with ::notice:: annotation explaining this is
  expected after a non-release PR merge), or
- "🆕 vX.Y.Z is new — proceeding with publish."

So the workflow UI is unambiguous about WHY the downstream jobs
skipped, instead of showing a bunch of mysterious skip states.

GitHub Packages gate uses the NPM-latest as a proxy (assumes both
registries stay in sync, which is the case when both publish from
the same package.json bump in the same workflow run).
… master

P3.2 from tmp/plan-future-workflows.md. Completes the silent-version-
regression fix from P3.1 (commit 238f482).

Bug: After P3.1, calculate-version reads from current master rather
than the merge-base, but that fix only takes effect on the NEXT
push to a release branch. If a release PR sits open and gets no
further pushes between sibling-PR merges, its package.json + PR
title stay frozen at the original calculation. When the stale PR
finally merges, master still regresses.

Fix: New fan-out workflow that fires when any PR merges to master,
enumerates open release PRs, and re-runs the update logic against
each. Re-evaluates version-bump against new master, regenerates
changelog, force-pushes the new version-bump commit, updates PR
title + labels.

New files:

- .github/actions/github/jobs/update-release-pr/action.yml
  Composite action extracting the refresh logic so it can be
  reused by both workflow-release.yml (push to release branch)
  and the new fan-out workflow. Inputs accept head-ref + pr-number
  so the action works for any release PR, not just github.ref_name.

- .github/actions/github/api/list-release-prs/{action.yml,list.mjs}
  REST helper that lists open PRs with title matching a regex
  (default: 'release: vX.Y.Z' shape). Paginated, capped at 10
  pages. Emits stable JSON array of {number, head_ref} for
  matrix-driven fan-out.

- .github/workflows/workflow-sync-open-release-prs.yml
  Reusable workflow with two jobs: enumerate (lists open release
  PRs) and refresh (matrix fan-out, one update job per PR).
  Concurrency keyed on `sync-release-prs-${{ github.repository }}`
  with cancel-in-progress: false so rapid master merges queue
  rather than race.

- examples/individual-repo-workflows/sync-release-prs.yml
  Consumer template. Triggers on `pull_request: closed && merged`
  for master/main; skips bot-authored merges to avoid recursion.

Refactor:

- workflow-release.yml: update-existing-pr job collapses from
  ~120 lines (inline step sequence) to ~20 lines (single call
  to the new update-release-pr action). Net code reduction;
  behavior-equivalent for the existing use case.
Three small changes bundled per the execution order in
tmp/plan-future-workflows.md:

P3.4 — Shared concurrency for publish + tag-update workflows
  - workflow-update-major-version-tags.yml: add workflow-level
    `concurrency: group: tags-${{ github.repository }}`.
  - reusable-publishing.yml: add same group at job-level on the
    update-version-tags job.
  Both with `cancel-in-progress: false` so queued runs serialize
  rather than race. Prevents intermediate-state tag flicker when
  publish and tag-update workflows fire close together.

Batch 1.2 — Untagged-release filter (consumer template)
  - examples/.../update-major-version-tags.yml: add
    `if: github.event_name != 'release' || github.event.release.tag_name != ''`
    on the update-tags job. Guards against legacy / external sources
    of "untagged-<sha>" release events that wasted ~1m50s per run
    in the screenshot the user reported.

Batch 3.1 — Scheduled tag-health cron template (consumer template)
  - examples/.../tag-health.yml: NEW file. Wakes the already-built
    reusable-tag-health.yml on a weekly Sunday 04:04 UTC schedule
    (off-the-hour to dodge GitHub :00-cron stampede). Defaults to
    full unified sweep (validate + fix bot signatures + fix unsigned
    + recover orphaned releases + relocate orphaned tags + update
    rolling major/minor refs). workflow_dispatch toggles for debug,
    create_documentation, use_gpg.

  The reusable already implements all the logic; this template is
  what triggers it on a schedule, closing the gap noted in the
  audit ("reusable exists but nothing wakes it").
Bundles five batches that wrap substantive external systems (per the
'roll our own vs wrap' principle from tmp/plan-future-workflows.md).

Batch 2.1 — CodeQL reusable
  - .github/workflows/reusable-codeql.yml
  - examples/individual-repo-workflows/codeql.yml
  Wraps github/codeql-action. Matrix-expands languages input.
  Defaults to security-extended + security-and-quality queries;
  paths_ignore excludes vendored/test code that produces noise.
  Triggers: push to master/main, PR, weekly Mon 14:37 UTC schedule.

Batch 2.2 — Dependency Review reusable
  - .github/workflows/reusable-dependency-review.yml
  - examples/individual-repo-workflows/dependency-review.yml
  Wraps actions/dependency-review-action. Blocks PR merge on
  moderate-or-higher CVE matches by default. License deny list
  empty (CLDMV is mixed-license; per-repo override expected).

Batch 4.1 — Trivy container scan reusable
  - .github/workflows/reusable-container-scan.yml
  Wraps aquasecurity/trivy-action. Defaults: CRITICAL+HIGH block,
  ignore unfixed (avoids stalling publishes on unactionable vulns),
  SARIF upload to GH Security tab. Wires in via consumer's docker-
  publish flow as needs: [build, scan] gate (consumer must add).

Batch 4.3 — OpenSSF Scorecard template
  - examples/individual-repo-workflows/scorecard.yml
  Wraps ossf/scorecard-action. publish_results: true (public
  scoreboard at securityscorecards.dev). Triggers: weekly Mon
  07:32 UTC + push to default + branch_protection_rule + dispatch.

Batch 4.2 — SBOM generation in publish flow
  - reusable-publishing.yml: new opt-in inputs (generate_sbom,
    attest_sbom, sbom_format). When enabled, adds three steps to
    create-release job: anchore/sbom-action generates CycloneDX,
    actions/attest-sbom signs via Sigstore, curl attaches to release.
  - workflow-publish.yml: forwards new inputs through.

IDE diagnostics on workflow-publish.yml will show 'invalid input,
generate_sbom not defined' because the @v2 tag on reusable-publishing
hasn't moved forward yet. Resolves once dev lands on master and
the v2 rolling tag advances.
Both roll-our-own actions (no third-party deps), consistent with the
'thin wrapper over generic mechanics → roll our own' principle.

Batch 5.1 — Master commit-subject audit
  - .github/actions/git/jobs/audit-commit-subject/{action.yml,action.mjs}
    Reads a commit's subject via REST, tests against allowed-pattern
    list. On miss: filed as a GitHub Issue (deduped by short-SHA in
    title) with the offending commit, expected patterns, and a
    'what to do' section. Workflow exits 0 — the issue IS the alert.
  - examples/individual-repo-workflows/master-commit-audit.yml
    Triggers on push to master/main. Default allowed patterns cover
    release commits, chore commits, and merge commits. Per-repo can
    extend.

Batch 3.2 — Dependabot auto-merge
  - .github/actions/github/jobs/dependabot-auto-merge/{action.yml,action.mjs}
    Parses Dependabot PR title for 'from X.Y.Z to A.B.C', computes
    semver bump type, verifies base branch has CI gating (REST GET
    on /branches/{ref}/protection — refuses if unset, to prevent
    unsafe auto-merge). Approves PR as bot via REST, enables
    auto-merge via GraphQL enablePullRequestAutoMerge mutation
    (REST has no equivalent for 'merge when ready').
  - .github/workflows/reusable-dependabot-auto-merge.yml
    Wraps the action with App-token minting.
  - examples/individual-repo-workflows/dependabot-auto-merge.yml
    Consumer template. Pre-filters at workflow level so it doesn't
    fire for every PR. Default allows patch+minor; major requires
    manual review.

Required consumer setup (documented in template comments):
  - Settings → Pull Requests → 'Allow auto-merge' → ON
  - Branch protection on default branch requires CI status checks
No dependency on actions/stale@v9. Bot-attributed via App token,
fits the existing Node-action conventions, predictable upgrade path.

New files:

- .github/actions/github/jobs/stale-sweep/
  - action.yml — inputs for timers, exempt labels, ops cap, dry_run
  - classifier.mjs — pure per-item state machine (testable in isolation)
    States: SKIP, MARK_STALE, CLOSE, UNSTALE
  - actor.mjs — REST API operations (label, comment, close)
  - action.mjs — entry point: enumerates open items, fetches stale-
    label timestamps via /issues/{n}/events, detects activity-since-
    stale via /issues/{n}/comments?since=, classifies, applies.

- .github/actions/github/api/_api/core.mjs — new `paginate()` helper
  with rate-limit awareness (aborts cleanly at X-RateLimit-Remaining
  < floor, returns what's been collected).

- .github/workflows/reusable-stale.yml — workflow wrapper.
- examples/individual-repo-workflows/stale.yml — daily cron at
  05:13 UTC + workflow_dispatch with dry_run toggle for preview.

Defaults:
- Issues: 60d stale + 14d close (looser; many valid issues wait)
- PRs:    30d stale +  7d close (tighter; open PRs accrue conflicts)
- exempt_issue_labels: pinned,security,help-wanted,good-first-issue,blocked
- exempt_pr_labels:    pinned,work-in-progress,dependencies,blocked
- exempt_all_milestones, exempt_all_assignees: true
- operations_per_run: 100 (stays under rate limits; backlog of 500
  items processes over 5 daily runs)

Idempotency: before posting a stale-warning comment the actor
checks the last 10 comments for our template signature, skips if
already commented. Re-runs on the same day don't double-comment.
Both roll-our-own, both use pull_request_target (API-only, no
checkout, no PR-content execution — explicit safety comment in
each consumer template).

Batch 5.2 — Path-based PR labeler
  Plugs into the existing label infrastructure (data/github-labels.json
  + resolve-labels + sync-pr-labels) rather than duplicating.

  - .github/actions/github/steps/sync-pr-labels: NEW `mode` input
    ('replace' default for backward-compat with create-release-pr;
    'add' for additive labeling that preserves human-added labels).
  - .github/actions/github/steps/compute-path-labels/{action.yml,
    action.mjs}: fetches PR file list (paginated), loads consumer's
    .github/labeler.yml or falls back to org default, glob-matches
    file paths against alias patterns, emits comma-sep alias list.
  - .github/labeler.default.yml: org-default config. Keys are aliases
    (quoted when they contain colons, e.g. 'area:core').
  - .github/workflows/reusable-pr-labeler.yml: stitches
    compute-path-labels → resolve-labels → sync-pr-labels (mode: add).
  - examples/individual-repo-workflows/labeler.yml: pull_request_target
    trigger with security note.

  data/github-labels.json: adds 5 new labels (type: ci, type: config,
  area: core, area: cli, area: tests) so sync-org-labels propagates
  them to every repo with consistent colors.

Batch 5.3 — First-time contributor welcomer
  - .github/templates/welcome-pr.md
  - .github/templates/welcome-issue.md
    Mustache-subset templates with `{{#hasGuidance}}...{{/hasGuidance}}`
    outer block + per-doc inner sections. Empty guidance section
    collapses cleanly (no orphan headers).
  - .github/actions/github/jobs/welcome-contributor/{action.yml,action.mjs}
    Counts prior interactions via search; first-only triggers comment.
    Probes which docs exist (CONTRIBUTING.md, CLA.md, CODE_OF_CONDUCT.md)
    via REST GET /contents and conditionally includes sections.
    ~8-line embedded substitutor handles both `{{var}}` and
    `{{#section}}...{{/section}}` blocks.
  - .github/workflows/reusable-welcome.yml
  - examples/individual-repo-workflows/welcome.yml: triggers on
    issues:opened + pull_request_target:opened.
Both roll-our-own. Both targeted at runtime-library repos (slothlet,
future packages); meta repos won't adopt these.

Batch 5.4 — Bundle-size diff
  - .github/actions/npm/jobs/bundle-size/{action.yml,action.mjs}
    Two-mode action:
      mode=measure → walks dist files via recursive readdir + glob
        regex, computes raw + gzip (zlib) + brotli sizes, emits JSON
      mode=compare → loads two JSON files, computes per-file deltas,
        builds markdown table with ⚠️ markers for growth crossing
        warning_pct or warning_bytes thresholds, posts/updates PR
        comment (deduped via <!-- bundle-size-comment --> marker)
  - .github/workflows/reusable-bundle-size.yml
    Three parallel jobs: build-head, build-base, compare. Head + base
    use the same build_command; compare diffs the artifacts.
  - examples/individual-repo-workflows/bundle-size.yml
    pull_request trigger (NOT pull_request_target — builds PR code).
    Fork PRs: build runs safely, comment posting fails (read-only
    token). Maintainer can dispatch manually after review.

Batch 6.1 — gh-pages docs publisher
  - .github/actions/common/jobs/publish-gh-pages/{action.yml,action.mjs}
    Clones target_branch (or creates orphan if missing) into a temp
    workspace, wipes contents (preserving .git/), copies output_dir
    in, optionally writes CNAME + .nojekyll, commits with bot
    identity, pushes via App token (which has workflows scope so
    publishing .github/workflows/* contents won't 403).
  - .github/workflows/reusable-docs-publish.yml
    Checkout, setup, install, build, then call publish-gh-pages.
    concurrency: docs-publish-${{ github.repository }}, cancel-
    in-progress: false (half-published sites are confusing).
  - examples/individual-repo-workflows/docs.yml
    push to master/main with paths filter (only republish on docs/
    source/markdown changes).
Roll-our-own multi-channel release notifier. Org-default channel config
in .github/templates/release-notifier.default.yml merged with per-repo
override .github/release-notifier.yml by channel `id`. Per-repo can
add new channels or override org defaults (e.g. enabled: false to opt
out).

New files:

- .github/actions/community/jobs/release-notifier/action.yml
- .github/actions/community/jobs/release-notifier/action.mjs
  Entry: parses event, loads + merges configs, fans out to per-channel
  handlers with continue-on-failure semantics. Embedded YAML parser
  for the channels-list shape.
- .github/actions/community/jobs/release-notifier/util.mjs
  Shared truncate() for changelog excerpts.
- .github/actions/community/jobs/release-notifier/channels/
  - discord.mjs — rich embed via webhook
  - slack.mjs   — Block Kit message via webhook
  - webhook.mjs — generic JSON POST with ${VAR} template substitution
- .github/workflows/reusable-release-notifier.yml
  Forwards configured webhook secrets through env.
- .github/templates/release-notifier.default.yml
  Empty default — consumers add their channels. Documented shape.
- examples/individual-repo-workflows/release-notify.yml
  release:[published] trigger with defensive tag_name != '' guard.
Batch 1.3 — Branch retention on PR merge
  - .github/actions/git/jobs/branch-retention/{action.yml,action.mjs}
    On pull_request: closed && merged, the just-merged head branch is:
      - exempt → left alone (master/main/badges/gh-pages defaults)
      - matches a retention rule (release/* keep_last=5, hotfix/*
        keep_last=3 defaults) → KEPT, with older matching branches
        pruned via paginated /pulls?state=closed lookup sorted by
        merged_at descending
      - no rule match → DELETE /git/refs/heads/{ref}
    Treats 404/422 as already-deleted (idempotent on rerun).
  - .github/workflows/reusable-branch-retention.yml
  - examples/individual-repo-workflows/branch-retention.yml

Batch 1.3a — Branch naming convention (Rulesets, not a workflow)
  - scripts/setup-org-rulesets.mjs
    Idempotent installer: `GH_TOKEN=<org-admin> node scripts/...`.
    Creates/updates an org-level Ruleset 'CLDMV branch naming
    convention' that restricts branch creation via fnmatch patterns.
    Bypass for OrganizationAdmin only.
  - docs/conventions/branch-naming.md
    Reference table mapping each prefix to its purpose and triggers.
    Aligned with the label-prefix style (type:, area:, etc.).

The convention covers: release/X.Y.Z, hotfix/X.Y.Z, feat/*, fix/*,
chore/*, docs/*, ci/*, refactor/*, perf/*, test/*, style/*,
dependabot/*, copilot/*, master, main, badges, gh-pages. The
retention defaults align with this list (exempt: master/main/badges/
gh-pages; retain release/* and hotfix/*; everything else delete-on-
merge).
Per-PR signing model. Each commit author must either be in the org
(silent pass), be an exempt bot, or reply on the PR with the exact
required text. The contributor's comment is the legal record. For
same-repo PRs we ALSO push an empty signed commit on the branch
with CLA-Signed-By / CLA-Source-Comment trailers; for fork PRs the
comment alone is the record (bot can't push to forks).

No central signatures repo. Each PR is its own durable legal
artifact, indexed via git log --grep='CLA-Signed-By: @username'
across master histories.

New files:

- CLA.md
  Starting-point contributor agreement text (legal review required).
  Includes the 'under the license of the project to which the
  contribution is made' phrasing so one CLA covers every CLDMV repo
  regardless of its individual LICENSE.

- .github/actions/community/jobs/cla-check/{action.yml,action.mjs}
  On PR events: enumerate commit-authors, check each (exempt bot →
  org member → signed comment), post or update request comment,
  write 'CLA / signature-check' status check (success or failure).
  Exit 0 either way — status check is the alert.

- .github/actions/community/jobs/cla-record/{action.yml,action.mjs}
  On issue_comment:created: validate that the comment matches the
  required text AND is from a PR commit-author, then record:
    - Same-repo PR: git commit --allow-empty with CLA-* trailers,
      push to head branch
    - Fork PR: post an acknowledgment comment (since bot can't push
      to the fork)
  Always posts a thread acknowledgment so the contributor sees
  confirmation.

- .github/workflows/reusable-cla.yml
  Two jobs, both gated by event:
    - check (pull_request / pull_request_target)
    - record (issue_comment)

- examples/individual-repo-workflows/cla.yml
  pull_request_target + issue_comment triggers. Documented
  required setup (bot App needs 'Members: read' org permission).

Required text default: 'I have read and I agree to the CLA v${cla_version}'
where cla_version is the workflow input. Version bumps re-prompt
contributors (their old-version signatures don't satisfy a new
version's check).
…x86\x92@v3

All-in-one v3 release prep commit (no behavior change; mechanical
rename + documentation).

package.json:
  - version 2.1.0 \xe2\x86\x92 3.0.0 (major bump; new surface area)

Mass rename @v2 \xe2\x86\x92 @V3:
  - 256 references rewritten across 71 YAML/Node/Markdown files
  - Skipped: tmp/, node_modules/, .git/
  - Verified: zero @v2 references remain in source; 248 @V3
    refs in YAML alone (rest in Markdown narratives)

Docs:
  - tmp/plan-future-workflows.md: marked all 16 batches \xe2\x9c\x85 Done
    with commit SHAs; added v3 release-plan section
  - .github/instructions/repo-conventions.instructions.md: added
    'roll our own vs wrap' principle as a Node-actions sub-section
  - WORKFLOW-README.md: new '\xf0\x9f\x86\x95 v3 Workflows' table; updated
    repo-structure tree; bumped @v2 \xe2\x86\x92 @V3 in contributing notes
  - .github/actions/README.md: added community/ layer; mentioned new
    actions (audit-commit-subject, branch-retention, bundle-size);
    documented paginate() helper
  - docs/migration/v2-to-v3.md: NEW \xe2\x80\x94 step-by-step guide for
    existing consumer repos, including required org/repo settings
    and roll-back plan

No behavior changes in source code. Verified:
  - All 24 YAML files parse
  - All Node .mjs files pass --check
  - sed-based rename verified word-boundary safe (no accidental
    @v2foo or v2.0 collateral changes)

Next: cut v3.0.0 from master after PR is reviewed; spin up
CLDMV/v3-testbed dummy repo to verify end-to-end scenarios per
the plan doc's test-harness sketch.
Closes #2.

Description on workflow-publish.yml's min_node_version said 'enables
matrix when set,' but every default in the chain was '20' \xe2\x80\x94 so
omitting the input still produced a full matrix. Description and
implementation disagreed; the description wins.

Changes:

- generate-matrix/action.mjs: empty min-node-version is now an
  explicit signal: emit \[max_node_major, lts/*\] (a single
  confidence check, no matrix). Previously this snapped to '20'
  via getInput's default.
- generate-matrix/action.yml: drop the '20' default; description
  now documents the empty-means-no-matrix behavior.
- workflow-publish.yml: min_node_version default '20' \xe2\x86\x92 ''. Publish
  flows no longer run the full per-version matrix unless the
  consumer explicitly opts in. (This also kills a class of false-
  failure noise: the matrix would run \xc3\x974, each instance trying to
  npm-publish the same already-published version.)
- workflow-ci.yml and workflow-release.yml: unchanged. CI and
  release-PR validation legitimately want matrix; keep default '20'.
- reusable-build-and-test.yml: unchanged passthrough; receives
  whatever the entry-point passes.

Smoke-tested:
  min=20, max=22, ltsOnly=false: \[20,21,22,lts/\*\]   \xe2\x9c\x93
  min='', max=22:                 \[22,lts/\*\]         \xe2\x9c\x93
  min=18.4, max=22:               \[18.4,19..22,lts/\*\] \xe2\x9c\x93
  lts-only, min=20, max=23:       \[20,22,lts/\*\]      \xe2\x9c\x93

docs/migration/v2-to-v3.md: added 'Issues resolved' section
documenting how v3 addresses #1 (publish from PR branches \xe2\x80\x94 fixed
by trigger refactor) and #2 (this fix). To re-enable matrix for
a specific repo's publish flow, set min_node_version: '20' (or
desired min) explicitly in the consumer's publish.yml.
Bug: reusable-codeql.yml line 74 used
  \${{ fromJson(format('[\"{0}\"]', join(split(inputs.languages, ','), '\",\"'))) }}
to expand a comma-separated languages input into a matrix, but
GitHub Actions expressions have no split() builtin. Workflow
parse failed with:
  Unrecognized function: 'split'. Located at position 35

Fix: round-trip through a small Node action, same pattern
reusable-build-and-test.yml uses with generate-matrix.

New action:
  .github/actions/common/utilities/parse-csv-list/{action.yml,action.mjs}
  Generic CSV→JSON-array helper. ~30 lines.
  Reusable for any workflow that needs to drive a matrix from a
  comma-separated workflow_call input.

Workflow change:
  reusable-codeql.yml gains a setup job that calls parse-csv-list
  and exposes languages JSON via outputs.languages. The analyze
  job becomes `needs: setup` and uses
  fromJson(needs.setup.outputs.languages) for its matrix.

Smoke-tested:
  csv='javascript-typescript'           → ["javascript-typescript"]   ✓
  csv='javascript-typescript, python, go' → 3-item array              ✓

The IDE will continue to flag the @V3 reference as unresolved
until dev lands on master and the v3 rolling tag is cut — same
known false-positive as the SBOM inputs and every other internal
@V3 reference added in this branch.
Three things bundled. Net code: -1500 lines (dead workflow + backup
trees removed).

1) Add 8 new local-*.yml workflows so this repo dogfoods its own
reusables. They use relative `uses: ./.github/workflows/reusable-X.yml`
references so PRs test against the PR's version of the reusable —
not the published @V3 tag.

  - local-ci.yml — validates every .mjs (node --check), parses every
    .yml, runs actionlint (would have caught the split() bug from
    commit 4548870), checks no stale @v2 references remain
  - local-tag-health.yml — weekly Sunday cron + dispatch
  - local-master-commit-audit.yml — post-merge audit on default branch
  - local-codeql.yml — direct github/codeql-action call (skips the
    reusable to avoid chicken-and-egg with @v3-pinned internal actions)
  - local-stale.yml — daily cron
  - local-labeler.yml — pull_request_target, uses .github/labeler.yml
  - local-welcome.yml — first-time issue/PR
  - local-branch-retention.yml — PR-merged; `dev` added to exempt list

Also adds .github/labeler.yml — per-repo labeler override with
patterns tailored to THIS repo's structure (.github/actions/**, not
src/**). Falls through to .github/labeler.default.yml for consumers
that don't have their own.

2) Workflow naming convention documented in WORKFLOW-README.md and
.github/instructions/repo-conventions.instructions.md:

  - local-*.yml   → runs on this repo's events; dogfood
  - workflow-*.yml → org entry point for consumer repos (@V3 ref)
  - reusable-*.yml → lower-level building block called by others

The naming is convention, not enforced; the `on:` block is what
GitHub actually uses to decide whether a file runs.

3) Cleanup:

  - .github/workflows/backup/ → .archive/workflows-backup/
    Out of the workflows dir (still in git history). GitHub doesn't
    load subdirs so they weren't running, but they were clutter.
  - DELETED debug-tag-creation.yml + test-tag-creation.yml (formerly
    reusable-test-tag-creation.yml after a brief detour). Both were
    development-time diagnostic artifacts; the test action they
    referenced (.github/actions/testing/steps/test-tag-creation-methods/)
    is now orphaned and also deleted.
  - DELETED examples/individual-repo-workflows/debug-tag-creation.{yml,md}

4) examples/README.md rewritten with a complete v3 template catalog
grouped by purpose (core CI/CD, release-flow companions, security
baseline, automation, packaging/docs). The old README only documented
5 templates; the new one covers all 18.

YAML validated: 151 files parse clean.
… release flow

Two issues addressed:

1) Node.js 20 deprecation (effective June 2nd, 2026)

GitHub is deprecating Node 20 runners. `actions/setup-node@v4` and
friends run on Node 20 and produced the warning visible on the
recent Actions run. Bumps across 5 files:

  - actions/checkout@v4        → @v6  (Node 24)
  - actions/setup-node@v4      → @v6  (Node 24)
  - actions/upload-artifact@v4 → @v6  (Node 24)
  - actions/download-artifact@v4 → @v7  (matches existing usage)

Files updated:
  - .github/workflows/local-ci.yml
  - .github/workflows/workflow-docker-publish.yml
  - .github/workflows/reusable-coverage-badge.yml
  - .github/workflows/reusable-coverage-pr-comment.yml
  - .github/workflows/reusable-bundle-size.yml

`actions/dependency-review-action@v4` is left at v4 — that's the
current stable for that action; no v5 released yet. Will revisit
if/when GitHub starts forcing the runtime.

2) Missing release-flow dogfood for THIS repo

The repo had local-ci/codeql/stale/labeler/welcome/etc. but no
automated release-PR creation. Cutting v3.1.0 manually would mean
not eating our own dog food. Two new workflows close the gap:

  - .github/workflows/local-release.yml
    On push to non-default branches: detects `release:` /
    `release!:` commits and creates/updates the release PR via
    `./.github/workflows/workflow-release.yml` (relative path
    so PRs test against the PR's reusable, not the published @V3).

    This repo has no `npm test` or `npm run build:ci` — we're
    a workflows + actions package, not a buildable library. So
    we pass stub commands and `skip_matrix_tests: true` to keep
    the build-and-test phase happy. local-ci.yml is the real gate.

    NPM_TOKEN intentionally not forwarded — this repo isn't
    published to npm (`@cldmv/.github` is not on the registry).

  - .github/workflows/local-sync-release-prs.yml
    On PR merge to master: fans out to refresh every open release
    PR's version + changelog. Companion to P3.1's
    calculate-version-from-master fix; without this, parallel
    release PRs can still produce out-of-sync version bumps.

Final local-*.yml count: 11 files. Repo now fully dogfoods its own
workflows (CI, security, hygiene, AND release-flow).
…etup guide

Polish the examples/ tree for v3:

- Move 21 templates from a flat individual-repo-workflows/ into five
  category subfolders (core-cicd, release-companions, security,
  automation, packaging-docs) mirroring the README's grouping.
- Move WORKFLOW-SETUP-GUIDE, DRY-RUN-GUIDE, UPDATE-MAJOR-VERSION-TAGS-GUIDE
  into examples/guides/ so the examples/ root only holds the README
  and the templates folder.
- Normalize headers across all 21 templates to the unified v3 banner;
  add the new subfolder to each @filename.
- Replace the lingering @cldmv/slothlet placeholder with
  @your-org/your-package in the four templates that carried it as a
  literal package_name input.
- Expand WORKFLOW-SETUP-GUIDE.md from the original 5-workflow reference
  to per-template sections covering all 21 templates plus a
  secrets-summary matrix and a common-prerequisites checklist.
- Update cross-links: examples/README.md, WORKFLOW-README.md tree,
  docs/migration/v2-to-v3.md, docs/conventions/branch-naming.md, and
  the local-ci.yml YAML-parse glob (now recursive).
Refactor the Validate workflow so failures land on the GitHub run summary
(rendered markdown at the top of the run page) instead of being buried in
individual step logs.

Each check now:
- Uses `continue-on-error: true` + `if: always()` so a single run reports
  every failing check, not just the first one to fail.
- Appends a per-check markdown section to $GITHUB_STEP_SUMMARY with the
  exact failing files / lines / messages.
- Sets a `count` step output for the final overall pass/fail tally.

The trailing Summary step renders a pass/fail table for all four checks
(Node syntax, YAML parse, actionlint, @v2 references) and exits 1 if any
failed, keeping the required-check job's red/green semantics.

Side change: actionlint moves from the docker action to a downloaded
pinned-v1.7.7 binary so its stdout can be tee'd into the summary block.
Annotations still parse from the default `file:line:col:` output format.
…factor

Four pre-existing classes of failure that the prior actionlint version
(1.7.7, in a docker action) had been catching but burying inside the
step log. Now that the Local CI summary surfaces them on the run page,
they're worth fixing rather than ignoring.

- reusable-tag-health.yml: workflow outputs referenced `jobs.update-version-tags.*`
  and `jobs.fix-bot-signatures.*` job IDs that no longer exist (the jobs
  were consolidated under the `unified-*` prefix). The `|| jobs.unified-*`
  fallback halves never fired because the first half was a static expression
  error. Drop the dead halves; keep only the `unified-*` side.

- local-codeql.yml + reusable-codeql.yml: `paths-ignore` (and `paths`)
  aren't direct inputs to `github/codeql-action/init@v3`; they belong in
  a codeql-config.yml referenced via `config-file:`. The reusable now
  writes a generated config from its `paths` / `paths_ignore` CSV inputs
  to /tmp before init; the dogfood workflow ships a static one inline.

- local-ci.yml: bump actionlint pin from 1.7.7 to 1.7.12. 1.7.12 is the
  first release that recognizes `using: node24`, which silences the false
  positive on every Node action in this repo. Also add a documented
  `-ignore 'actions/create-github-app-token@v3'` because 1.7.12's bundled
  metadata for that action is stale (it lists `app-id` as required and
  `client-id` as undefined, but the upstream action.yml marks `app-id`
  deprecated and treats `client-id` as canonical).

- local-ci.yml: the `@v2` self-grep matched its own file (step name, error
  message, and grep pattern all contain literal "@v2" strings). Exclude
  this workflow from the grep.

Full local actionlint sweep + python yaml parse now both exit 0.
Roll package.json back to the last published 2.x baseline (v2.0.39) and
mark this commit as an explicit major release. When local-release.yml
fires from a non-default, non-`dev` branch, it will detect this `release!`
prefix + the explicit "v3.0.0" target and open a release PR proposing
the cut.

This is the formal v3 release commit. All v3 batches (CLA bot, branch
retention, release notifier, bundle-size + docs publisher, PR labeler,
welcomer, stale, dependabot auto-merge, CodeQL / dependency-review /
scorecard / container scan, naming Ruleset + branch convention, the
local-* dogfood workflows, and the examples/ reorganization) land
under this single major bump.
Manual one-time bump for the v3 bootstrap. The normal release-flow bot
(`reusable-release-management.yml@v3`) is the usual source of this commit,
but the @V3 tag doesn't exist yet — this is the cut that creates it.
v3.0.1+ will go through the bot via the dogfood release-PR flow.
Shinrai added 2 commits May 20, 2026 11:02
Start a curated long-form changelog folder, one file per minor version.
v3.0.0 is the primary entry (the cut we're about to ship); v2.0.0 and
v1.0.0 are backdated stubs for the prior major cuts.

Scope rules in README:
- One file per minor (vX.Y.0). Patches inside a minor (vX.Y.1, …) are
  summarized in the parent minor's trailing section, not their own files.
- Changes ship in their own minor's file — v2 work does not roll forward
  into v3.0.0.md.
- A vX.Y.0.md covers commits between the previous minor and itself.

v1.1.0 → v1.12.0 don't have dedicated files yet (deferred — see the
GitHub Releases page for those).
Strip internal-milestone references (P3.1, P3.2, P3.3, P3.4) and the
"new consumer-facing actions worth knowing about" section that was
describing extracted-helper minutiae (paginate() in _api/core.mjs, the
sync-pr-labels mode input, the update-release-pr action extraction).
None of those help a consumer who just calls workflow-*.yml@v3.

What stays/improves:
- Behavior-change bullets reframed as features (no milestone IDs).
- Adoption table at step 4 — quick "want X? copy Y" lookup matching the
  new examples/individual-repo-workflows/ subfolder layout.
- Cross-link to examples/guides/WORKFLOW-SETUP-GUIDE.md for per-workflow
  scripts / secrets / prereqs.
- Updated template paths (examples/.../security/codeql.yml, etc.) since
  the v2 doc still referenced the flat layout.
@Shinrai
Shinrai merged commit a890324 into master May 20, 2026
3 checks passed
Shinrai added a commit that referenced this pull request May 25, 2026
1. scripts/validate-action-refs.mjs: `require("node:fs")` in ESM scope
   crashed Node 24 (the script is .mjs, so CJS require is undefined).
   Switched to `import { appendFileSync }` at the top.

2. .github/workflows/local-ci.yml (stale-refs step):
   `out=$(git grep ...)` with Actions' default `set -eo pipefail` exits
   the script when grep finds zero matches (git grep exits 1 on
   no-matches, and `set -e` propagates the failure through the
   substitution-assignment). Added `|| true` to squash the exit code
   so the absence of matches doesn't masquerade as a failure.

3. .github/workflows/local-feature-pr.yml + the matching consumer
   template: shellcheck SC2129 — three consecutive `>> file`
   redirects coalesced into a single `{ ...; } >> file` block.

The CI failure on 25988b7 surfaced #1 and #2 (validate-action-refs
crashed, stale-refs returned no matches and got killed by set -e).
#3 was a separate lint finding actionlint flagged in the new
feature-pr workflow.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Min version not set in publish causes multiple tests to run Fix Workflow publish

1 participant