@cldmv/gh-broker 0.0.0-stage → 0.7.0

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 (107) hide show
  1. package/.configs/fix-headers.json +3 -0
  2. package/.configs/vitest.config.mjs +44 -0
  3. package/.github/dependabot.yml +111 -0
  4. package/.github/workflows/branch-retention.yml +44 -0
  5. package/.github/workflows/bundle-size.yml +52 -0
  6. package/.github/workflows/ci.yml +389 -0
  7. package/.github/workflows/cla.yml +66 -0
  8. package/.github/workflows/codeql.yml +87 -0
  9. package/.github/workflows/dependabot-auto-merge.yml +62 -0
  10. package/.github/workflows/dependabot-recreate.yml +67 -0
  11. package/.github/workflows/dependency-review.yml +46 -0
  12. package/.github/workflows/feature-pr.yml +75 -0
  13. package/.github/workflows/hotfix-redirector.yml +67 -0
  14. package/.github/workflows/hotfixes-release.yml +70 -0
  15. package/.github/workflows/labeler.yml +48 -0
  16. package/.github/workflows/master-commit-audit.yml +56 -0
  17. package/.github/workflows/member-auto-merge.yml +75 -0
  18. package/.github/workflows/next-release.yml +76 -0
  19. package/.github/workflows/next-reset.yml +50 -0
  20. package/.github/workflows/pr-notify.yml +44 -0
  21. package/.github/workflows/pr-title-normalizer.yml +52 -0
  22. package/.github/workflows/provenance.yml +51 -0
  23. package/.github/workflows/publish.yml +146 -0
  24. package/.github/workflows/release-merge.yml +104 -0
  25. package/.github/workflows/release-notify.yml +41 -0
  26. package/.github/workflows/scorecard.yml +64 -0
  27. package/.github/workflows/stale.yml +50 -0
  28. package/.github/workflows/tag-health.yml +70 -0
  29. package/.github/workflows/update-major-version-tags.yml +94 -0
  30. package/.github/workflows/v4-bootstrap.yml +115 -0
  31. package/.github/workflows/welcome.yml +42 -0
  32. package/LICENSE +202 -0
  33. package/README.md +185 -2
  34. package/config.example.json +281 -0
  35. package/deploy/README.md +92 -0
  36. package/deploy/gh-broker.service +57 -0
  37. package/deploy/install.mjs +344 -0
  38. package/deploy/install.sh +29 -0
  39. package/deploy/lib/config-merge.mjs +56 -0
  40. package/deploy/lib/prompt.mjs +98 -0
  41. package/deploy/lib/secret-store.mjs +114 -0
  42. package/deploy/lib/smoke.mjs +137 -0
  43. package/deploy/lib/system.mjs +222 -0
  44. package/dist/index.mjs +22970 -0
  45. package/dist/index.mjs.map +7 -0
  46. package/docs/TOOLS.md +347 -0
  47. package/docs/agent-user-model.md +89 -0
  48. package/docs/changelog/v0/v0.2.0.md +26 -0
  49. package/docs/changelog/v0/v0.2.1.md +23 -0
  50. package/docs/changelog/v0/v0.2.2.md +23 -0
  51. package/docs/changelog/v0/v0.2.3.md +33 -0
  52. package/docs/changelog/v0/v0.2.4.md +25 -0
  53. package/docs/changelog/v0/v0.2.5.md +29 -0
  54. package/docs/changelog/v0/v0.3.0.md +84 -0
  55. package/docs/changelog/v0/v0.3.1.md +30 -0
  56. package/docs/changelog/v0/v0.3.2.md +24 -0
  57. package/docs/changelog/v0/v0.3.3.md +28 -0
  58. package/docs/changelog/v0/v0.4.0.md +58 -0
  59. package/docs/changelog/v0/v0.4.1.md +33 -0
  60. package/docs/changelog/v0/v0.4.2.md +45 -0
  61. package/docs/changelog/v0/v0.5.0.md +39 -0
  62. package/docs/changelog/v0/v0.5.1.md +28 -0
  63. package/docs/changelog/v0/v0.6.0.md +52 -0
  64. package/docs/changelog/v0/v0.6.1.md +48 -0
  65. package/docs/changelog/v0/v0.7.0.md +71 -0
  66. package/docs/deploy-architecture.md +82 -0
  67. package/package.json +71 -5
  68. package/src/appauth.ts +56 -0
  69. package/src/audit.ts +34 -0
  70. package/src/catalog.ts +165 -0
  71. package/src/config.ts +130 -0
  72. package/src/index.ts +107 -0
  73. package/src/paths.ts +60 -0
  74. package/src/router.ts +258 -0
  75. package/src/secrets.ts +137 -0
  76. package/src/server.ts +91 -0
  77. package/src/types.ts +104 -0
  78. package/src/upstream.ts +85 -0
  79. package/src/verbs/issue_labels.ts +329 -0
  80. package/src/verbs/link_issue.ts +84 -0
  81. package/src/verbs/release-analysis.ts +210 -0
  82. package/src/verbs/repo-tier.ts +90 -0
  83. package/src/verbs/report_ci_status.ts +358 -0
  84. package/src/verbs/report_release_prs.ts +238 -0
  85. package/src/verbs/report_security_alerts.ts +442 -0
  86. package/src/verbs/report_unlabeled.ts +194 -0
  87. package/src/verbs/rest-client.ts +181 -0
  88. package/src/verbs/review_thread.ts +138 -0
  89. package/tests/appauth.test.vitest.mts +76 -0
  90. package/tests/audit.test.vitest.mts +48 -0
  91. package/tests/catalog.test.vitest.mts +180 -0
  92. package/tests/config-merge.test.vitest.mts +58 -0
  93. package/tests/config.test.vitest.mts +314 -0
  94. package/tests/issue-labels.test.vitest.mts +347 -0
  95. package/tests/paths.test.vitest.mts +52 -0
  96. package/tests/release-prs.test.vitest.mts +237 -0
  97. package/tests/rest-client.test.vitest.mts +115 -0
  98. package/tests/router.test.vitest.mts +399 -0
  99. package/tests/run-vitest.mjs +51 -0
  100. package/tests/secret-store.test.vitest.mts +106 -0
  101. package/tests/secrets.test.vitest.mts +155 -0
  102. package/tests/security-alerts.test.vitest.mts +328 -0
  103. package/tests/server.test.vitest.mts +20 -0
  104. package/tests/upstream.test.vitest.mts +91 -0
  105. package/tests/verb-helpers.test.vitest.mts +331 -0
  106. package/tests/verbs.test.vitest.mts +624 -0
  107. package/tsconfig.json +21 -0
@@ -0,0 +1,75 @@
1
+ #
2
+ # @Project: @cldmv/gh-broker
3
+ # @Filename: /.github/workflows/member-auto-merge.yml
4
+ # @Date: 2026-05-28T00:00:00-07:00 (1779951600)
5
+ # @Author: Nate Corcoran <CLDMV>
6
+ # @Email: <Shinrai@users.noreply.github.com>
7
+ # -----
8
+ # @Last modified by: Nate Corcoran <CLDMV> (Shinrai@users.noreply.github.com)
9
+ # @Last modified time: 2026-10-02T11:30:57-07:00 (1790965857)
10
+ # -----
11
+ # @Copyright: Copyright (c) 2013-2026 Catalyzed Motivation Inc. All rights reserved.
12
+ #
13
+
14
+ # Individual repo: .github/workflows/member-auto-merge.yml
15
+ #
16
+ # Auto-enables GitHub's "auto-merge" flag on PRs opened by org members
17
+ # against `next` or `hotfixes`, scoped to the standard branch-prefix
18
+ # conventions (feat/, fix/, hotfix/, chore/, …). Removes the per-PR
19
+ # friction of clicking "Enable auto-merge" — the merge still waits for
20
+ # the ruleset's prerequisites (required approvals + CI green).
21
+ #
22
+ # This does NOT approve the PR. The human-review gate stays intact —
23
+ # unlike `dependabot-auto-merge.yml` which bot-approves Dependabot bumps.
24
+ #
25
+ # Default in v4: ON. To opt out, delete this file — member PRs still
26
+ # require a manual "Enable auto-merge" click but otherwise work normally.
27
+ #
28
+ # Required setup (one-time per repo, both done by `v4-bootstrap.yml`):
29
+ # 1. Settings → Pull Requests → "Allow auto-merge" → ON
30
+ # 2. A ruleset on next/hotfixes with required status checks AND a
31
+ # required-approving-review count ≥ 1 (the default v4 rulesets do
32
+ # both). The action refuses to enable auto-merge on a branch
33
+ # without required checks; the ruleset's approval requirement is
34
+ # what keeps a human in the loop after auto-merge is enabled.
35
+ name: 🚀 Member Auto-Enable Auto-Merge
36
+
37
+ on:
38
+ pull_request_target:
39
+ types: [opened, reopened, synchronize, ready_for_review]
40
+
41
+ permissions:
42
+ contents: read
43
+ pull-requests: write
44
+
45
+ # Collapse a burst of pushes to one run per PR; the latest state always wins.
46
+ concurrency:
47
+ group: member-auto-merge-${{ github.event.pull_request.number }}
48
+ cancel-in-progress: true
49
+
50
+ jobs:
51
+ enable:
52
+ # Pre-filter at workflow level so this doesn't spin up for every PR.
53
+ # The action repeats these checks for defense in depth (and clearer
54
+ # skip-reason logging), so trimming this `if` is fine; widening it
55
+ # is fine too — the action will skip anything that doesn't match.
56
+ if: |
57
+ github.event.pull_request.draft == false &&
58
+ (
59
+ github.event.pull_request.author_association == 'MEMBER' ||
60
+ github.event.pull_request.author_association == 'OWNER' ||
61
+ github.event.pull_request.author_association == 'COLLABORATOR'
62
+ ) &&
63
+ (
64
+ github.event.pull_request.base.ref == 'next' ||
65
+ github.event.pull_request.base.ref == 'hotfixes'
66
+ )
67
+ uses: CLDMV/.github/.github/workflows/reusable-member-auto-merge.yml@v4
68
+ with:
69
+ merge_method: "MERGE"
70
+ # CUSTOMIZE: tighten or widen as your repo requires.
71
+ # allowed_associations: "MEMBER,OWNER,COLLABORATOR"
72
+ # branch_prefixes: "feat,feature,fix,hotfix,chore,refactor,docs,ci,perf,test,style"
73
+ secrets:
74
+ BOT_APP_CLIENT_ID: ${{ secrets.CLDMV_BOT_APP_CLIENT_ID }}
75
+ BOT_APP_PRIVATE_KEY: ${{ secrets.CLDMV_BOT_APP_PRIVATE_KEY }}
@@ -0,0 +1,76 @@
1
+ #
2
+ # @Project: @cldmv/gh-broker
3
+ # @Filename: /.github/workflows/next-release.yml
4
+ # @Date: 2026-05-22T00:00:00-07:00 (1779433200)
5
+ # @Author: Nate Corcoran <CLDMV>
6
+ # @Email: <Shinrai@users.noreply.github.com>
7
+ # -----
8
+ # @Last modified by: Nate Corcoran <CLDMV> (Shinrai@users.noreply.github.com)
9
+ # @Last modified time: 2026-10-02T11:30:57-07:00 (1790965857)
10
+ # -----
11
+ # @Copyright: Copyright (c) 2013-2026 Catalyzed Motivation Inc. All rights reserved.
12
+ #
13
+
14
+ # Individual repo: .github/workflows/next-release.yml
15
+ #
16
+ # v4 core: maintain the ONE persistent `next → master` release PR for this repo.
17
+ #
18
+ # Fires on every push to `next` (contributor PR squash-merges land here).
19
+ # Resolves the existing release PR and refreshes it, or creates it the first
20
+ # time `next` diverges from master. The release PR batches all accumulated
21
+ # feature commits into a single release — that batching is v4's whole point
22
+ # (see CLDMV/.github docs/conventions/release-flow-v4.md §5.3, §6.1).
23
+ #
24
+ # Thin caller: all job logic (plan / create / refresh) lives in the reusable,
25
+ # pinned at @v4. Bumping the pin carries fixes without editing this file.
26
+ # CUSTOMIZE:
27
+ # - `package_name` → your npm package (or any unique identifier)
28
+ # - `build_command` → your build script, or a stub like
29
+ # `echo '✓ no build step'` for a meta package (optional;
30
+ # defaults to `npm run build:ci`)
31
+ name: 🚀 Next Release (v4)
32
+
33
+ on:
34
+ push:
35
+ branches: [next]
36
+ workflow_dispatch: # manual kick — e.g. to open/refresh the PR for content already on `next`
37
+
38
+ # Serialize: each run re-resolves the current PR state, so queueing (not
39
+ # cancelling) avoids a create/refresh race when pushes land back-to-back.
40
+ concurrency:
41
+ group: next-release-${{ github.repository }}
42
+ cancel-in-progress: false
43
+
44
+ permissions:
45
+ contents: read
46
+
47
+ jobs:
48
+ release:
49
+ permissions:
50
+ contents: write
51
+ pull-requests: write
52
+ uses: CLDMV/.github/.github/workflows/workflow-next-release.yml@v4
53
+ with:
54
+ package_name: "@cldmv/gh-broker"
55
+ build_command: "npm run build:ci"
56
+ secrets:
57
+ # Map your repo/org secrets to the expected names.
58
+ BOT_APP_CLIENT_ID: ${{ secrets.CLDMV_BOT_APP_CLIENT_ID }}
59
+ BOT_APP_PRIVATE_KEY: ${{ secrets.CLDMV_BOT_APP_PRIVATE_KEY }}
60
+ # Optional: only needed if you also use reusable-lint-format.yml /
61
+ # reusable-coverage-badge.yml (or otherwise sign a commit locally as
62
+ # this identity). Passed through so the release-PR changelog
63
+ # recognizes that identity as a bot instead of listing it as a
64
+ # contributor — see CLDMV_BOT_NAME/CLDMV_BOT_EMAIL in your other
65
+ # workflows for the same values.
66
+ BOT_NAME: ${{ secrets.CLDMV_BOT_NAME }}
67
+ BOT_EMAIL: ${{ secrets.CLDMV_BOT_EMAIL }}
68
+ # Optional release-PR notifier webhooks — each is independently
69
+ # opt-in: leave one unset and that channel is silently skipped.
70
+ # Delete the lines you don't use.
71
+ DISCORD_RELEASE_PR_PUBLIC_WEBHOOK: ${{ secrets.DISCORD_RELEASE_PR_PUBLIC_WEBHOOK }}
72
+ DISCORD_RELEASE_PR_PRIVATE_WEBHOOK: ${{ secrets.DISCORD_RELEASE_PR_PRIVATE_WEBHOOK }}
73
+ SLACK_RELEASE_PR_PUBLIC_WEBHOOK: ${{ secrets.SLACK_RELEASE_PR_PUBLIC_WEBHOOK }}
74
+ SLACK_RELEASE_PR_PRIVATE_WEBHOOK: ${{ secrets.SLACK_RELEASE_PR_PRIVATE_WEBHOOK }}
75
+ GENERIC_RELEASE_PR_PUBLIC_WEBHOOK: ${{ secrets.GENERIC_RELEASE_PR_PUBLIC_WEBHOOK }}
76
+ GENERIC_RELEASE_PR_PRIVATE_WEBHOOK: ${{ secrets.GENERIC_RELEASE_PR_PRIVATE_WEBHOOK }}
@@ -0,0 +1,50 @@
1
+ #
2
+ # @Project: @cldmv/gh-broker
3
+ # @Filename: /.github/workflows/next-reset.yml
4
+ # @Date: 2026-05-22T00:00:00-07:00 (1779433200)
5
+ # @Author: Nate Corcoran <CLDMV>
6
+ # @Email: <Shinrai@users.noreply.github.com>
7
+ # -----
8
+ # @Last modified by: Nate Corcoran <CLDMV> (Shinrai@users.noreply.github.com)
9
+ # @Last modified time: 2026-10-02T11:30:57-07:00 (1790965857)
10
+ # -----
11
+ # @Copyright: Copyright (c) 2013-2026 Catalyzed Motivation Inc. All rights reserved.
12
+ #
13
+
14
+ # Individual repo: .github/workflows/next-reset.yml
15
+ #
16
+ # v4 core: after a release lands on master, re-sync the integration branches
17
+ # (CLDMV/.github docs/conventions/release-flow-v4.md §6.3, §7).
18
+ #
19
+ # - `hotfixes` is ALWAYS force-reset to master HEAD after any release.
20
+ # - `next` depends on which lane released:
21
+ # * normal release (next → master, or a v3-style feat → master):
22
+ # force-reset `next` to master HEAD (§7.1).
23
+ # * hotfix release (hotfixes → master): MERGE master into `next` instead,
24
+ # so next's accumulated feature work is preserved (§7.2, option B).
25
+ #
26
+ # Thin caller: all job logic (the wait-for-tags gate + the branch sync) lives in
27
+ # the reusable, pinned at @v4. Bumping the pin carries fixes without editing
28
+ # this file.
29
+ name: ♻️ Next/Hotfixes Reset (v4)
30
+
31
+ on:
32
+ push:
33
+ branches: [master, main]
34
+
35
+ concurrency:
36
+ group: next-reset-${{ github.repository }}
37
+ cancel-in-progress: false
38
+
39
+ permissions:
40
+ contents: read
41
+
42
+ jobs:
43
+ sync:
44
+ permissions:
45
+ contents: write
46
+ uses: CLDMV/.github/.github/workflows/workflow-next-reset.yml@v4
47
+ secrets:
48
+ # Map your repo/org secrets to the expected names.
49
+ BOT_APP_CLIENT_ID: ${{ secrets.CLDMV_BOT_APP_CLIENT_ID }}
50
+ BOT_APP_PRIVATE_KEY: ${{ secrets.CLDMV_BOT_APP_PRIVATE_KEY }}
@@ -0,0 +1,44 @@
1
+ #
2
+ # @Project: @cldmv/gh-broker
3
+ # @Filename: /.github/workflows/pr-notify.yml
4
+ # @Date: 2026-05-26T00:00:00-07:00 (1779778800)
5
+ # @Author: Nate Corcoran <CLDMV>
6
+ # @Email: <Shinrai@users.noreply.github.com>
7
+ # -----
8
+ # @Last modified by: Nate Corcoran <CLDMV> (Shinrai@users.noreply.github.com)
9
+ # @Last modified time: 2026-10-02T11:30:57-07:00 (1790965857)
10
+ # -----
11
+ # @Copyright: Copyright (c) 2013-2026 Catalyzed Motivation Inc. All rights reserved.
12
+ #
13
+
14
+ # Individual repo: .github/workflows/pr-notify.yml
15
+ #
16
+ # Fires once per PR open. Targets ALL PRs in the repo (including the release
17
+ # PRs opened by the release-flow workflows) — exactly one notification per
18
+ # PR-open event.
19
+ #
20
+ # Channels are addressed by secret name; no config file. Set the secret to
21
+ # enable the channel, leave it unset to skip:
22
+ #
23
+ # DISCORD_PR_PUBLIC_WEBHOOK / DISCORD_PR_PRIVATE_WEBHOOK
24
+ # SLACK_PR_PUBLIC_WEBHOOK / SLACK_PR_PRIVATE_WEBHOOK
25
+ # GENERIC_PR_PUBLIC_WEBHOOK / GENERIC_PR_PRIVATE_WEBHOOK
26
+ #
27
+ # Visibility is determined automatically from the repo: GitHub `public` →
28
+ # PUBLIC, `private` or `internal` → PRIVATE. Set the org-level secret in
29
+ # CLDMV for the default URL; set a repo-level secret with the same name to
30
+ # override (or to an empty string to mute that channel for this repo).
31
+ name: 📥 PR Notify
32
+
33
+ on:
34
+ pull_request:
35
+ types: [opened]
36
+
37
+ permissions:
38
+ contents: read
39
+ pull-requests: read
40
+
41
+ jobs:
42
+ notify:
43
+ uses: CLDMV/.github/.github/workflows/reusable-pr-notifier.yml@v4
44
+ secrets: inherit
@@ -0,0 +1,52 @@
1
+ #
2
+ # @Project: @cldmv/gh-broker
3
+ # @Filename: /.github/workflows/pr-title-normalizer.yml
4
+ # @Date: 2026-05-22T00:00:00-07:00 (1779433200)
5
+ # @Author: Nate Corcoran <CLDMV>
6
+ # @Email: <Shinrai@users.noreply.github.com>
7
+ # -----
8
+ # @Last modified by: Nate Corcoran <CLDMV> (Shinrai@users.noreply.github.com)
9
+ # @Last modified time: 2026-10-02T11:30:57-07:00 (1790965857)
10
+ # -----
11
+ # @Copyright: Copyright (c) 2013-2026 Catalyzed Motivation Inc. All rights reserved.
12
+ #
13
+
14
+ # Individual repo: .github/workflows/pr-title-normalizer.yml
15
+ #
16
+ # Normalize contributor PR titles to Conventional Commits format, derived from
17
+ # the highest-priority commit in the PR. The release flow expects this shape, so
18
+ # a v4 repo wants this enabled. (Also backportable to v3 repos — the underlying
19
+ # action shipped in v3.3.0; it owns all skip logic: bot authors, the
20
+ # long-running release PRs, titles already starting with `release:`, and titles
21
+ # that already conform.)
22
+ #
23
+ # Thin caller: all job logic lives in the reusable, pinned at @v4. Bumping the
24
+ # pin carries fixes without editing this file.
25
+ name: 🏷️ PR Title Normalizer
26
+
27
+ # SECURITY NOTE: pull_request_target runs in the BASE repo's context with WRITE
28
+ # permissions and access to secrets. SAFE — the reusable's path is API-only (it
29
+ # never checks out or executes PR content). Triggers on opened + synchronize
30
+ # only (NOT edited): a maintainer hand-editing the title must not kick off a
31
+ # re-normalize loop.
32
+ on:
33
+ pull_request_target:
34
+ types: [opened, synchronize]
35
+
36
+ concurrency:
37
+ group: pr-title-normalizer-${{ github.event.pull_request.number }}
38
+ cancel-in-progress: true
39
+
40
+ permissions:
41
+ contents: read
42
+
43
+ jobs:
44
+ normalize:
45
+ permissions:
46
+ contents: read
47
+ pull-requests: write
48
+ uses: CLDMV/.github/.github/workflows/workflow-pr-title-normalizer.yml@v4
49
+ secrets:
50
+ # Map your repo/org secrets to the expected names.
51
+ BOT_APP_CLIENT_ID: ${{ secrets.CLDMV_BOT_APP_CLIENT_ID }}
52
+ BOT_APP_PRIVATE_KEY: ${{ secrets.CLDMV_BOT_APP_PRIVATE_KEY }}
@@ -0,0 +1,51 @@
1
+ #
2
+ # @Project: @cldmv/gh-broker
3
+ # @Filename: /.github/workflows/provenance.yml
4
+ # @Date: 2026-09-05T00:00:00-07:00 (1788591600)
5
+ # @Author: Nate Corcoran <CLDMV>
6
+ # @Email: <Shinrai@users.noreply.github.com>
7
+ # -----
8
+ # @Last modified by: Nate Corcoran <CLDMV> (Shinrai@users.noreply.github.com)
9
+ # @Last modified time: 2026-10-02T11:30:57-07:00 (1790965857)
10
+ # -----
11
+ # @Copyright: Copyright (c) 2013-2026 Catalyzed Motivation Inc. All rights reserved.
12
+ #
13
+
14
+ # SLSA build provenance (.intoto.jsonl) for this repo's published releases.
15
+ # Decoupled from the publish workflow on purpose (see reusable-provenance.yml):
16
+ # the SLSA generator is a reusable-workflow call and cannot carry
17
+ # `continue-on-error`, so running it here — on its own `release: published`
18
+ # trigger — keeps a provenance failure from ever turning a release run red
19
+ # (issue #268). It re-packs the SAME build artifact the publish run uploaded, so
20
+ # the signed subjects are byte-identical to what was published.
21
+ #
22
+ # Prereq: the org's allowed actions/reusable-workflows policy must permit
23
+ # slsa-framework/*.
24
+ name: 🔏 SLSA Provenance
25
+
26
+ on:
27
+ release:
28
+ types: [published]
29
+
30
+ jobs:
31
+ provenance:
32
+ # Public, real releases only — SLSA provenance is recorded in the public
33
+ # Rekor transparency log. Skip drafts, prereleases, and private repos.
34
+ if: |
35
+ !github.event.repository.private &&
36
+ !github.event.release.draft &&
37
+ !github.event.release.prerelease
38
+ permissions:
39
+ actions: read # look up the publish run's build artifact
40
+ id-token: write # provenance signing (OIDC)
41
+ contents: write # upload the .intoto.jsonl release asset
42
+ uses: CLDMV/.github/.github/workflows/reusable-provenance.yml@v4
43
+ with:
44
+ tag: ${{ github.event.release.tag_name }}
45
+ # CUSTOMIZE: these MUST match your publish.yml so the re-packed
46
+ # tarballs are byte-identical to what was published.
47
+ package_name: "@cldmv/gh-broker"
48
+ node_version: "lts/*"
49
+ # Satellite packages (same value as publish.yml's extra_packages);
50
+ # empty disables. See docs/conventions/satellite-packages.md.
51
+ extra_packages: ""
@@ -0,0 +1,146 @@
1
+ #
2
+ # @Project: @cldmv/gh-broker
3
+ # @Filename: /.github/workflows/publish.yml
4
+ # @Date: 2026-05-20T00:00:00-07:00 (1779260400)
5
+ # @Author: Nate Corcoran <CLDMV>
6
+ # @Email: <Shinrai@users.noreply.github.com>
7
+ # -----
8
+ # @Last modified by: Nate Corcoran <CLDMV> (Shinrai@users.noreply.github.com)
9
+ # @Last modified time: 2026-10-02T11:30:57-07:00 (1790965857)
10
+ # -----
11
+ # @Copyright: Copyright (c) 2013-2026 Catalyzed Motivation Inc. All rights reserved.
12
+ #
13
+
14
+ # Individual repo: .github/workflows/publish.yml
15
+ name: 📦 Release and Publish
16
+
17
+ on:
18
+ push:
19
+ branches: [master, main]
20
+ paths-ignore:
21
+ - "**.md"
22
+ - ".github/ISSUE_TEMPLATE/**"
23
+ - ".github/PULL_REQUEST_TEMPLATE/**"
24
+ workflow_dispatch:
25
+ inputs:
26
+ debug:
27
+ description: "Enable debug logging for troubleshooting"
28
+ type: boolean
29
+ required: false
30
+ default: false
31
+ dry_run:
32
+ description: "Dry run mode - validate everything but don't publish or create releases"
33
+ type: boolean
34
+ required: false
35
+ default: false
36
+ node_version:
37
+ description: "Node.js version to use (default: lts/*)"
38
+ type: string
39
+ required: false
40
+ default: "lts/*"
41
+ package_manager:
42
+ description: "Package manager (npm or yarn)"
43
+ type: string
44
+ required: false
45
+ default: "npm"
46
+ test_environment:
47
+ description: "Environment for tests (affects NODE_ENV and NODE_OPTIONS --conditions flag)"
48
+ type: string
49
+ required: false
50
+ default: "development"
51
+ version:
52
+ description: "Version to publish (auto-detected from package.json if not provided)"
53
+ type: string
54
+ required: false
55
+ default: ""
56
+ publish_to_npm:
57
+ description: "Publish to NPM registry"
58
+ type: boolean
59
+ required: false
60
+ default: true
61
+ publish_to_github_packages:
62
+ description: "Publish to GitHub Packages registry"
63
+ type: boolean
64
+ required: false
65
+ default: true
66
+ min_node_version:
67
+ description: "Minimum Node.js version for matrix testing (enables matrix when set; default: 22.12.0 — the floor vitest 5 actually runs on)"
68
+ type: string
69
+ required: false
70
+ default: "22.12.0"
71
+ max_node_major:
72
+ description: "Max Node.js major version for the test matrix. Leave blank (the default) to inherit the CLDMV/.github reusable workflow's default; set a value only to pin/override for a specific run."
73
+ type: string
74
+ required: false
75
+ default: ""
76
+ use_gpg:
77
+ description: "Enable GPG signing (if GPG secrets provided)"
78
+ type: boolean
79
+ required: false
80
+ default: false
81
+
82
+ # NEVER cancel an in-flight publish — half-published versions are nasty to
83
+ # clean up. Concurrent publishes for the same ref queue instead so they
84
+ # serialize naturally.
85
+ concurrency:
86
+ group: publish-${{ github.workflow }}-${{ github.ref }}
87
+ cancel-in-progress: false
88
+
89
+ permissions:
90
+ contents: read
91
+
92
+ jobs:
93
+ publish-package:
94
+ if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
95
+ permissions:
96
+ contents: write
97
+ packages: write
98
+ id-token: write
99
+ uses: CLDMV/.github/.github/workflows/workflow-publish.yml@v4
100
+ with:
101
+ package_name: "@cldmv/gh-broker" # Required: replace with your NPM package name
102
+ debug: ${{ github.event.inputs.debug == 'true' }}
103
+ dry_run: ${{ github.event.inputs.dry_run == 'true' }}
104
+ node_version: ${{ github.event.inputs.node_version || 'lts/*' }}
105
+ package_manager: ${{ github.event.inputs.package_manager || 'npm' }}
106
+ version: ${{ github.event.inputs.version || '' }}
107
+ publish_to_npm: ${{ github.event.inputs.publish_to_npm != 'false' }}
108
+ publish_to_github_packages: ${{ github.event.inputs.publish_to_github_packages != 'false' }}
109
+ publish_command: ""
110
+ github_packages_publish_command: ""
111
+ min_node_version: ${{ github.event.inputs.min_node_version || '22.12.0' }}
112
+ max_node_major: ${{ github.event.inputs.max_node_major || '' }} # blank ⇒ inherit the CLDMV/.github reusable default
113
+ test_command: "npm test" # Use defaults: NODE_ENV=development, NODE_OPTIONS=--conditions=development
114
+ # test_command: "NODE_OPTIONS='--conditions=slothlet-dev' npm test" # Override NODE_OPTIONS only
115
+ # test_command: "NODE_ENV=test npm test" # Override NODE_ENV only
116
+ # test_command: "NODE_ENV=test NODE_OPTIONS='--conditions=slothlet-dev' npm test" # Override both
117
+ test_environment: ${{ github.event.inputs.test_environment || 'development' }} # Alternative to setting in test_command
118
+ build_command: "npm run build:ci"
119
+ # --- Satellite packages (optional) ----------------------------------------
120
+ # Publish extra packages carved from this build's output (e.g. locale JSON,
121
+ # generated types) at the SAME version/commit as the core, each with its own
122
+ # @scope/name@version tag + GitHub Release. Uncomment to opt in.
123
+ # extra_packages: a JSON [{ name, dir }] array, OR a glob (single '*' in the
124
+ # final path segment, e.g. "dist-packages/*"). Empty = disabled.
125
+ # build_subpackages_command: runs after build_command to produce
126
+ # dist-packages/<name>/ — omit if build_command already does the carve.
127
+ # First publish of each new @scope/name needs a one-time token publish +
128
+ # trusted-publisher setup. Full details + the contract:
129
+ # docs/conventions/satellite-packages.md
130
+ # extra_packages: "dist-packages/*"
131
+ # build_subpackages_command: "npm run build:subpackages"
132
+ # --------------------------------------------------------------------------
133
+ is_prerelease: false
134
+ release_source_only: false
135
+ create_documentation: true
136
+ skip_performance_tests: false
137
+ skip_matrix_tests: false
138
+ use_gpg: ${{ github.event.inputs.use_gpg == 'true' }}
139
+ secrets:
140
+ NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
141
+ BOT_APP_CLIENT_ID: ${{ secrets.CLDMV_BOT_APP_CLIENT_ID }}
142
+ BOT_APP_PRIVATE_KEY: ${{ secrets.CLDMV_BOT_APP_PRIVATE_KEY }}
143
+ TAGGER_NAME: ${{ secrets.CLDMV_BOT_NAME }}
144
+ TAGGER_EMAIL: ${{ secrets.CLDMV_BOT_EMAIL }}
145
+ GPG_PRIVATE_KEY: ${{ secrets.CLDMV_BOT_GPG_PRIVATE_KEY }}
146
+ GPG_PASSPHRASE: ${{ secrets.CLDMV_BOT_GPG_PASSPHRASE }}
@@ -0,0 +1,104 @@
1
+ #
2
+ # @Project: @cldmv/gh-broker
3
+ # @Filename: /.github/workflows/release-merge.yml
4
+ # @Date: 2026-09-29T02:39:40+00:00 (1790649580)
5
+ # @Author: Nate Corcoran <CLDMV>
6
+ # @Email: <Shinrai@users.noreply.github.com>
7
+ # -----
8
+ # @Last modified by: Nate Corcoran <CLDMV> (Shinrai@users.noreply.github.com)
9
+ # @Last modified time: 2026-10-02T11:30:57-07:00 (1790965857)
10
+ # -----
11
+ # @Copyright: Copyright (c) 2013-2026 Catalyzed Motivation Inc. All rights reserved.
12
+ #
13
+
14
+ # Individual repo: .github/workflows/release-merge.yml
15
+ #
16
+ # v4 core (optional): squash-merge the persistent `next → master` release PR on
17
+ # YOUR APPROVAL, via the REST merge API with the PR body as the commit message.
18
+ #
19
+ # Why not just click "Squash and merge"? The mobile Default path can land a
20
+ # title-only commit (dropping the curated changelog + coverage), and the web/
21
+ # mobile squash UI auto-appends its own `Co-authored-by:` list (not deduped, not
22
+ # bot-stripped). An explicit-message API merge avoids both — the release commit
23
+ # is exactly the curated PR body. It also merges only once EVERY check (required
24
+ # AND non-required, e.g. the coverage badge and the release-PR body refresh) has
25
+ # finished and passed, so the body it captures is never stale.
26
+ #
27
+ # How you use it: approve the release PR as you normally do. The merge fires when
28
+ # CI is green — if you approve before CI finishes, it re-evaluates once CI
29
+ # actually finishes and merges once the last check passes. Nothing auto-merges
30
+ # without your approval.
31
+ #
32
+ # Re-evaluation uses `workflow_run`, not `check_suite` — GitHub does not send
33
+ # `check_suite: completed` for a suite created by GitHub Actions itself, which
34
+ # is every check your own ci.yml produces; it only fires for a suite created
35
+ # by a third-party App. See CLDMV/.github#318: an approval given before CI
36
+ # finished left a release PR stuck fully green with nothing re-firing the
37
+ # merge check, because check_suite silently never fired for that case at all.
38
+ # `workflow_run` is GitHub's documented replacement for exactly this pattern.
39
+ #
40
+ # IMPORTANT: the merge gate waits on EVERY check-run on the release PR's head
41
+ # commit, from any workflow — so `workflows:` below must name every workflow in
42
+ # your repo that puts a check on that commit, not just ci.yml. Only the one that
43
+ # finishes LAST can see a fully green head; if it isn't listed, nothing re-fires
44
+ # and the PR sits approved + green until you dispatch this workflow by hand.
45
+ # CodeQL in particular routinely outlasts ci.yml (CLDMV/.github PR #322 stuck
46
+ # exactly this way). The list below covers the standard v4 template set by their
47
+ # template `name:`s — names are matched literally (not by filename), so fix any
48
+ # you renamed, and add any extra PR-triggered workflow your repo has. Listing a
49
+ # workflow your repo doesn't have is harmless. `branches:` limits re-fires to
50
+ # runs on the integration branches, so feature-branch CI doesn't wake this up.
51
+ #
52
+ # Thin caller: all logic lives in the reusable, pinned at @v4.
53
+ # NOTE: pull_request_review / workflow_run events run the copy of this file on
54
+ # the DEFAULT branch, so it takes effect once it ships to master with a release.
55
+ name: 🚦 Release Merge (v4)
56
+
57
+ on:
58
+ pull_request_review:
59
+ types: [submitted] # your approval arms it
60
+ workflow_run: # re-evaluate as each check-producing workflow finishes — see #318
61
+ workflows: # ← must match your workflows' `name:`s — see IMPORTANT above
62
+ - "🧪 CI Tests & Build"
63
+ - "🔍 CodeQL"
64
+ - "🔒 Dependency Review"
65
+ - "📊 Bundle Size"
66
+ - "🚀 Next Release (v4)"
67
+ - "🚑 Hotfixes Release (v4)"
68
+ - "🌿 Branch Retention"
69
+ - "🏷️ PR Labeler"
70
+ - "🏷️ PR Title Normalizer"
71
+ - "👋 Welcome Contributor"
72
+ - "🔀 Hotfix PR Redirector (v4)"
73
+ - "🚀 Member Auto-Enable Auto-Merge"
74
+ - "🤖 Dependabot Auto-Merge"
75
+ - "🔁 Dependabot Auto-Recreate"
76
+ - "📜 CLA"
77
+ - "📥 PR Notify"
78
+ types: [completed]
79
+ branches: [next, hotfixes]
80
+ workflow_dispatch: # manual re-evaluation
81
+
82
+ # Serialize per repo: each run re-resolves the release PR + re-gates the head,
83
+ # so queue (don't cancel) to avoid racing a merge that's already in flight.
84
+ # GitHub keeps one pending run per group and a newer arrival replaces it — that
85
+ # is harmless, since every run re-reads approval + check state from the API.
86
+ concurrency:
87
+ group: release-merge-${{ github.repository }}
88
+ cancel-in-progress: false
89
+
90
+ permissions:
91
+ contents: read
92
+
93
+ jobs:
94
+ merge:
95
+ permissions:
96
+ contents: write
97
+ pull-requests: write
98
+ checks: read
99
+ statuses: read
100
+ uses: CLDMV/.github/.github/workflows/workflow-release-merge.yml@v4
101
+ secrets:
102
+ # Map your repo/org secrets to the expected names.
103
+ BOT_APP_CLIENT_ID: ${{ secrets.CLDMV_BOT_APP_CLIENT_ID }}
104
+ BOT_APP_PRIVATE_KEY: ${{ secrets.CLDMV_BOT_APP_PRIVATE_KEY }}
@@ -0,0 +1,41 @@
1
+ #
2
+ # @Project: @cldmv/gh-broker
3
+ # @Filename: /.github/workflows/release-notify.yml
4
+ # @Date: 2026-07-19T00:00:00-07:00 (1784444400)
5
+ # @Author: Nate Corcoran <CLDMV>
6
+ # @Email: <Shinrai@users.noreply.github.com>
7
+ # -----
8
+ # @Last modified by: Nate Corcoran <CLDMV> (Shinrai@users.noreply.github.com)
9
+ # @Last modified time: 2026-10-02T11:30:57-07:00 (1790965857)
10
+ # -----
11
+ # @Copyright: Copyright (c) 2013-2026 Catalyzed Motivation Inc. All rights reserved.
12
+ #
13
+
14
+ # Individual repo: .github/workflows/release-notify.yml
15
+ #
16
+ # Fires on `release: published` and dispatches the release announcement to
17
+ # any enabled webhook. No config file — each channel is just a secret:
18
+ #
19
+ # DISCORD_RELEASES_PUBLIC_WEBHOOK / DISCORD_RELEASES_PRIVATE_WEBHOOK
20
+ # SLACK_RELEASES_PUBLIC_WEBHOOK / SLACK_RELEASES_PRIVATE_WEBHOOK
21
+ # GENERIC_RELEASES_PUBLIC_WEBHOOK / GENERIC_RELEASES_PRIVATE_WEBHOOK
22
+ #
23
+ # Visibility is determined automatically from the repo: GitHub `public` →
24
+ # PUBLIC, `private` or `internal` → PRIVATE. Set the org-level secret in
25
+ # CLDMV for the default URL; set a repo-level secret with the same name to
26
+ # override (or to an empty string to mute that channel for this repo).
27
+ name: 📣 Release Notify
28
+
29
+ on:
30
+ release:
31
+ types: [published]
32
+
33
+ permissions:
34
+ contents: read
35
+
36
+ jobs:
37
+ notify:
38
+ # Defensive: skip untagged releases (mirrors Batch 1.2's filter)
39
+ if: github.event.release.tag_name != ''
40
+ uses: CLDMV/.github/.github/workflows/reusable-release-notifier.yml@v4
41
+ secrets: inherit