@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,66 @@
1
+ #
2
+ # @Project: @cldmv/gh-broker
3
+ # @Filename: /.github/workflows/cla.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/cla.yml
15
+ #
16
+ # Per-CLA-version signing with per-repo override support. Each commit author
17
+ # must either:
18
+ # - Be in the org (silent pass via /orgs/CLDMV/members lookup)
19
+ # - Be in the exempt-bots list
20
+ # - Already have a signature record at the active (scope, version) in the
21
+ # central ledger repo (default: CLDMV/.cla-signatures)
22
+ # - Reply on this PR with the exact required text
23
+ #
24
+ # Default vs. override scope:
25
+ # - DEFAULT (this repo has NO root-level CLA.md): the bot uses the org-wide
26
+ # CLA at cla-versions/v<X.Y>.md in the ledger. Signing once covers every
27
+ # CLDMV repo that uses the default until the major.minor is bumped.
28
+ # - OVERRIDE (this repo HAS a root-level CLA.md): the bot enforces the
29
+ # consumer-repo text and reads the version from its header. Signatures
30
+ # live under signatures/<platform>/overrides/<owner>/<repo>/v<X.Y>/ and
31
+ # are scoped to this repo only.
32
+ #
33
+ # Required setup:
34
+ # - Bot App must have `Organization permissions → Members: read` for the
35
+ # org-member exemption.
36
+ # - Bot App must have `Repository contents: write` on the ledger repo.
37
+ # - Optional `CLDMV_CLA_BOT_APP_CLIENT_ID` / `CLDMV_CLA_BOT_APP_PRIVATE_KEY`
38
+ # org secrets override the general bot identity for CLA actions only.
39
+ name: 📜 CLA
40
+
41
+ on:
42
+ pull_request_target:
43
+ types: [opened, synchronize, reopened, ready_for_review]
44
+ issue_comment:
45
+ types: [created]
46
+
47
+ permissions:
48
+ contents: read
49
+
50
+ jobs:
51
+ cla:
52
+ permissions:
53
+ contents: read
54
+ pull-requests: write
55
+ statuses: write
56
+ issues: write
57
+ uses: CLDMV/.github/.github/workflows/reusable-cla.yml@v4
58
+ with:
59
+ cla_version: "1.0"
60
+ secrets:
61
+ BOT_APP_CLIENT_ID: ${{ secrets.CLDMV_BOT_APP_CLIENT_ID }}
62
+ BOT_APP_PRIVATE_KEY: ${{ secrets.CLDMV_BOT_APP_PRIVATE_KEY }}
63
+ CLA_BOT_APP_CLIENT_ID: ${{ secrets.CLDMV_CLA_BOT_APP_CLIENT_ID }}
64
+ CLA_BOT_APP_PRIVATE_KEY: ${{ secrets.CLDMV_CLA_BOT_APP_PRIVATE_KEY }}
65
+ TAGGER_NAME: ${{ secrets.CLDMV_BOT_NAME }}
66
+ TAGGER_EMAIL: ${{ secrets.CLDMV_BOT_EMAIL }}
@@ -0,0 +1,87 @@
1
+ #
2
+ # @Project: @cldmv/gh-broker
3
+ # @Filename: /.github/workflows/codeql.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/codeql.yml
15
+ #
16
+ # PRIVATE REPOS are skipped by DEFAULT: the bootstrap's `variables` phase
17
+ # sets CLDMV_SKIP_CODE_SCANNING (this workflow then uploads an empty 0-alert
18
+ # SARIF instead of analyzing) on every private repo not opted in, since Code
19
+ # Security bills per active committer there. To actually scan a private
20
+ # repo: pay for GitHub Code Security and add the repo to the `scan` list in
21
+ # data/code-scanning-skips.json in CLDMV/.github. Public repos scan by
22
+ # default (free); a public repo with nothing to analyze goes in that file's
23
+ # `skip` section. Consumers outside CLDMV can pass `skip_code_scanning:
24
+ # true` below instead. Do NOT just delete this file on a repo whose ruleset
25
+ # requires code_scanning — the gate then waits forever.
26
+ #
27
+ # REQUIRED REPO SETTING — CodeQL must be in "Advanced" mode for this workflow
28
+ # to upload SARIF. If the repo has CodeQL "Default setup" enabled (the
29
+ # GitHub-managed alternative), upload runs fail with:
30
+ #
31
+ # "Code Scanning could not process the submitted SARIF file: CodeQL
32
+ # analyses from advanced configurations cannot be processed when the
33
+ # default setup is enabled"
34
+ #
35
+ # The org-bootstrap-repo action automatically disables default setup
36
+ # (overwrite-with-warn) on every fanout run, so a freshly-bootstrapped
37
+ # repo lands in the right state by default. If you want to KEEP default
38
+ # setup (the GitHub-managed config) instead of this workflow, DELETE
39
+ # this codeql.yml file — with the conflict gone, the bootstrap leaves
40
+ # default setup alone on subsequent runs.
41
+ #
42
+ # Manual fix when running outside the bootstrap:
43
+ # Settings → Code security and analysis → Code scanning → CodeQL
44
+ # analysis → ⚙️ → Switch to advanced.
45
+ name: 🔍 CodeQL
46
+
47
+ on:
48
+ push:
49
+ branches: [master, main]
50
+ # Same fork-PR consideration as ci.yml: pull_request fires for forks; SARIF
51
+ # upload to base-repo Security tab fails with read-only token. Acceptable —
52
+ # push-to-master analysis after merge catches anything missed. DO NOT use
53
+ # pull_request_target (runs base-repo workflow with secrets against fork
54
+ # code; dangerous).
55
+ pull_request:
56
+ types: [opened, synchronize, reopened, ready_for_review]
57
+ # Include the v4 integration branches (`next`, `hotfixes`) so feature
58
+ # and hotfix PRs trigger CodeQL. Without these, branch protection
59
+ # rulesets that require the CodeQL check on `next`/`hotfixes` will
60
+ # sit on "waiting for results" indefinitely. Branches that don't
61
+ # exist in a given repo simply never trigger the workflow — harmless
62
+ # for repos that haven't adopted the v4 staging-branch flow.
63
+ branches: [master, main, next, hotfixes]
64
+ schedule:
65
+ - cron: "37 14 * * 1" # weekly Monday 14:37 UTC; GitHub updates queries over time
66
+
67
+ permissions:
68
+ contents: read
69
+
70
+ concurrency:
71
+ group: codeql-${{ github.workflow }}-${{ github.ref }}
72
+ cancel-in-progress: ${{ github.ref != 'refs/heads/master' && github.ref != 'refs/heads/main' }}
73
+
74
+ jobs:
75
+ analyze:
76
+ permissions:
77
+ security-events: write
78
+ contents: read
79
+ actions: read
80
+ uses: CLDMV/.github/.github/workflows/reusable-codeql.yml@v4
81
+ with:
82
+ languages: "javascript-typescript"
83
+ # Override defaults if needed:
84
+ # queries: "security-extended,security-and-quality"
85
+ # paths_ignore: "node_modules/,dist/,coverage/,**/test/**"
86
+ # config_file: ".github/codeql-config.yml"
87
+ # build_mode: "autobuild"
@@ -0,0 +1,62 @@
1
+ #
2
+ # @Project: @cldmv/gh-broker
3
+ # @Filename: /.github/workflows/dependabot-auto-merge.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/dependabot-auto-merge.yml
15
+ #
16
+ # Auto-approves + queues auto-merge for Dependabot patch/minor bumps after
17
+ # CI passes. Major bumps are left for a human.
18
+ #
19
+ # Default in v4: ON. To opt out, delete this file — Dependabot PRs still
20
+ # flow into `next` (via dependabot.yml) but require a manual merge click.
21
+ #
22
+ # How v4 routing works:
23
+ # - dependabot.yml sets `target-branch: next`, so Dependabot opens PRs
24
+ # against `next`. This workflow auto-merges those PRs into `next` after
25
+ # CI; they batch into the next release like every other change.
26
+ # - For security advisories, hotfix-redirector.yml (release-flow-v4/)
27
+ # detects GHSA references in the PR body and retargets the PR from
28
+ # `next` → `hotfixes` *before* this workflow runs, so security updates
29
+ # auto-merge into the hotfix lane instead of waiting for the next batch.
30
+ #
31
+ # Required setup (one-time per repo):
32
+ # 1. Settings → Pull Requests → "Allow auto-merge" → ON
33
+ # (enabled automatically by `release-flow-v4/v4-bootstrap.yml`)
34
+ # 2. Branch protection on `next` and `hotfixes` with required CI status
35
+ # checks — the action refuses to merge into an unprotected branch.
36
+ # Both are validated by the action; the workflow fails loudly if missing.
37
+ name: 🤖 Dependabot Auto-Merge
38
+
39
+ on:
40
+ pull_request:
41
+ types: [opened, reopened, synchronize, ready_for_review]
42
+
43
+ permissions:
44
+ contents: read
45
+
46
+ jobs:
47
+ automerge:
48
+ permissions:
49
+ contents: write
50
+ pull-requests: write
51
+ # Pre-filter at workflow level so this doesn't spin up for every PR.
52
+ if: github.event.pull_request.user.login == 'dependabot[bot]'
53
+ uses: CLDMV/.github/.github/workflows/reusable-dependabot-auto-merge.yml@v4
54
+ with:
55
+ bump_types: "patch,minor"
56
+ # merge_method defaults to "merge" — Dependabot PRs target next / hotfixes,
57
+ # whose rulesets are merge-only. Override only if your branches differ.
58
+ # merge_method: "merge"
59
+ # also_for_actors: "renovate[bot]" # extend if you adopt Renovate
60
+ secrets:
61
+ BOT_APP_CLIENT_ID: ${{ secrets.CLDMV_BOT_APP_CLIENT_ID }}
62
+ BOT_APP_PRIVATE_KEY: ${{ secrets.CLDMV_BOT_APP_PRIVATE_KEY }}
@@ -0,0 +1,67 @@
1
+ #
2
+ # @Project: @cldmv/gh-broker
3
+ # @Filename: /.github/workflows/dependabot-recreate.yml
4
+ # @Date: 2026-07-31T00:00:00-07:00 (1785481200)
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/dependabot-recreate.yml
15
+ #
16
+ # Auto-fires `@dependabot recreate` when a Dependabot PR gets stuck in the
17
+ # "edited by someone other than Dependabot" state. That state breaks
18
+ # `@dependabot rebase` and — under a required-signed-commits ruleset — blocks
19
+ # the PR with an unsigned commit. `recreate` rebuilds it as a fresh, signed
20
+ # Dependabot commit that dependabot-auto-merge.yml then merges. See
21
+ # reusable-dependabot-recreate.yml for the mechanics + the command-actor caveat.
22
+ #
23
+ # Default in v4: ON. Delete this file to opt out entirely; add a `no-recreate`
24
+ # label to a specific PR to exempt just that one (e.g. one you've hand-edited
25
+ # on purpose and don't want overwritten).
26
+ #
27
+ # Triggers:
28
+ # - issue_comment: catches Dependabot's own "can't rebase, use recreate" reply
29
+ # (Dependabot only comments back when a rebase FAILS — success is a silent
30
+ # 👍 + force-push).
31
+ # - pull_request_target: proactive net for a Dependabot PR whose head commit
32
+ # is unverified. pull_request_target (not pull_request) is required so the
33
+ # job can read the bot-App secrets — Dependabot-triggered `pull_request`
34
+ # runs get a read-only token and no secrets. It is SAFE here: Dependabot PRs
35
+ # are same-repo branches (not forks), and this workflow never checks out or
36
+ # runs PR code — it only reads the PR and posts a comment via the API.
37
+ name: 🔁 Dependabot Auto-Recreate
38
+
39
+ on:
40
+ issue_comment:
41
+ types: [created]
42
+ pull_request_target:
43
+ types: [opened, synchronize, reopened]
44
+
45
+ permissions:
46
+ contents: read
47
+ pull-requests: write
48
+ issues: write
49
+
50
+ jobs:
51
+ recreate:
52
+ # A) Dependabot replied that it can't rebase (the PR was edited), or
53
+ # B) a Dependabot PR opened/updated — the reusable then checks whether
54
+ # its head commit is actually unverified before doing anything.
55
+ if: >-
56
+ (github.event_name == 'issue_comment'
57
+ && github.event.issue.pull_request
58
+ && github.event.comment.user.login == 'dependabot[bot]'
59
+ && contains(github.event.comment.body, 'edited by someone other than Dependabot'))
60
+ || (github.event_name == 'pull_request_target'
61
+ && github.event.pull_request.user.login == 'dependabot[bot]')
62
+ uses: CLDMV/.github/.github/workflows/reusable-dependabot-recreate.yml@v4
63
+ with:
64
+ skip_label: "no-recreate"
65
+ secrets:
66
+ BOT_APP_CLIENT_ID: ${{ secrets.CLDMV_BOT_APP_CLIENT_ID }}
67
+ BOT_APP_PRIVATE_KEY: ${{ secrets.CLDMV_BOT_APP_PRIVATE_KEY }}
@@ -0,0 +1,46 @@
1
+ #
2
+ # @Project: @cldmv/gh-broker
3
+ # @Filename: /.github/workflows/dependency-review.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/dependency-review.yml
15
+ #
16
+ # PRIVATE REPOS are skipped by DEFAULT (the dependency-review API needs
17
+ # GitHub Advanced Security there): the bootstrap's `variables` phase sets
18
+ # CLDMV_SKIP_DEPENDENCY_REVIEW on every private repo not opted into the
19
+ # `scan` list in data/code-scanning-skips.json in CLDMV/.github. To run the
20
+ # review on a private repo, pay for Code Security and add it to that list.
21
+ # Consumers outside CLDMV can pass `skip_dependency_review: true` below
22
+ # instead.
23
+ name: 🔒 Dependency Review
24
+
25
+ on:
26
+ pull_request:
27
+ types: [opened, synchronize, reopened, ready_for_review]
28
+ branches: [master, main]
29
+
30
+ permissions:
31
+ contents: read
32
+ pull-requests: write
33
+
34
+ jobs:
35
+ review:
36
+ uses: CLDMV/.github/.github/workflows/reusable-dependency-review.yml@v4
37
+ with:
38
+ fail_on_severity: "moderate"
39
+ # Per-repo license policy override:
40
+ # deny_licenses: "AGPL-3.0,LGPL-3.0" # block copyleft for an Apache-2.0 repo
41
+ # Bot App credentials. When set, the dependency-review PR comment is
42
+ # posted by the consumer's bot App instead of github-actions[bot].
43
+ # Both lines are optional; remove them to fall back to GITHUB_TOKEN.
44
+ secrets:
45
+ BOT_APP_CLIENT_ID: ${{ secrets.CLDMV_BOT_APP_CLIENT_ID }}
46
+ BOT_APP_PRIVATE_KEY: ${{ secrets.CLDMV_BOT_APP_PRIVATE_KEY }}
@@ -0,0 +1,75 @@
1
+ #
2
+ # @Project: @cldmv/gh-broker
3
+ # @Filename: /.github/workflows/feature-pr.yml
4
+ # @Date: 2026-08-02T16:55:52-07:00 (1785714952)
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/feature-pr.yml
15
+ #
16
+ # v4 ergonomics: auto-opens (and refreshes) a PR from a code-side branch to the
17
+ # right integration branch on every push.
18
+ #
19
+ # Mapping (matches CLDMV/.github docs/conventions/branch-naming.md):
20
+ # feat/*, feature/*, fix/*, release/*, chore/*, deps/*, refactor/*,
21
+ # docs/*, ci/*, perf/*, test/*, style/* → next
22
+ # hotfix/* → hotfixes
23
+ #
24
+ # Reserved branches NOT auto-PR'd: dependabot/* and copilot/* (they manage their
25
+ # own PRs); badges, gh-pages (bot-only); master/main (the target).
26
+ #
27
+ # Thin caller: all job logic (target detection, changelog body, PR create/
28
+ # refresh) lives in the reusable, pinned at @v4. Bumping the pin carries fixes
29
+ # without editing this file. The `push` trigger and its branch-prefix list stay
30
+ # here (GitHub requires the trigger local, and the list is per-repo config).
31
+ name: 🔀 Feature PR (v4)
32
+
33
+ on:
34
+ push:
35
+ branches:
36
+ # CUSTOMIZE: prune this list to whichever branch prefixes your
37
+ # repo uses. Must align with the `case` statement in the reusable.
38
+ - 'feat/**'
39
+ - 'feature/**'
40
+ - 'fix/**'
41
+ - 'release/**'
42
+ - 'chore/**'
43
+ - 'deps/**'
44
+ - 'refactor/**'
45
+ - 'docs/**'
46
+ - 'ci/**'
47
+ - 'perf/**'
48
+ - 'test/**'
49
+ - 'style/**'
50
+ - 'hotfix/**'
51
+
52
+ concurrency:
53
+ group: feature-pr-${{ github.repository }}-${{ github.ref }}
54
+ cancel-in-progress: false
55
+
56
+ permissions:
57
+ contents: read
58
+
59
+ jobs:
60
+ open-pr:
61
+ permissions:
62
+ contents: read
63
+ pull-requests: write
64
+ uses: CLDMV/.github/.github/workflows/workflow-feature-pr.yml@v4
65
+ secrets:
66
+ # Map your repo/org secrets to the expected names.
67
+ BOT_APP_CLIENT_ID: ${{ secrets.CLDMV_BOT_APP_CLIENT_ID }}
68
+ BOT_APP_PRIVATE_KEY: ${{ secrets.CLDMV_BOT_APP_PRIVATE_KEY }}
69
+ # Optional: only needed if you also use reusable-lint-format.yml /
70
+ # reusable-coverage-badge.yml (or otherwise sign a commit locally as
71
+ # this identity). Passed through so this PR's changelog body
72
+ # recognizes that identity as a bot instead of listing it as a
73
+ # contributor.
74
+ BOT_NAME: ${{ secrets.CLDMV_BOT_NAME }}
75
+ BOT_EMAIL: ${{ secrets.CLDMV_BOT_EMAIL }}
@@ -0,0 +1,67 @@
1
+ #
2
+ # @Project: @cldmv/gh-broker
3
+ # @Filename: /.github/workflows/hotfix-redirector.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/hotfix-redirector.yml
15
+ #
16
+ # v4 hotfix lane: retarget hotfix/security PRs to the `hotfixes` branch.
17
+ #
18
+ # Two paths trigger a redirect (CLDMV/.github docs/conventions/release-flow-v4.md §5.2, §6.5):
19
+ # 1. Head branch matches `hotfix/*` or `security/*` (human-driven hotfix flow).
20
+ # 2. Author is `dependabot[bot]` AND its base isn't Dependabot's routine
21
+ # target-branch (default "next") — GitHub always overrides dependabot.yml's
22
+ # target-branch for security updates, so a base landing on the default
23
+ # branch instead of "next" is itself the signal. Routine version bumps stay
24
+ # on "next".
25
+ #
26
+ # Thin caller: all job logic (token, checkout, git identity, redirect action)
27
+ # lives in the reusable, pinned at @v4. Bumping the pin carries new requirements
28
+ # (e.g. the checkout + git identity the cherry-pick path needs) without editing
29
+ # this file.
30
+ name: 🔀 Hotfix PR Redirector (v4)
31
+
32
+ # SECURITY NOTE: pull_request_target runs in the BASE repo's context with WRITE
33
+ # permissions + secrets. The reusable checks out `hotfixes` (a trusted base-repo
34
+ # branch, NOT the PR head/fork) and only cherry-picks/pushes against it.
35
+ #
36
+ # `opened` only (NOT `edited`): if a maintainer manually re-targets the PR, we
37
+ # must not fight them by redirecting again.
38
+ on:
39
+ pull_request_target:
40
+ types: [opened]
41
+
42
+ concurrency:
43
+ group: hotfix-redirector-${{ github.event.pull_request.number }}
44
+ cancel-in-progress: true
45
+
46
+ permissions:
47
+ contents: read
48
+
49
+ jobs:
50
+ redirect:
51
+ permissions:
52
+ contents: write
53
+ pull-requests: write
54
+ uses: CLDMV/.github/.github/workflows/workflow-hotfix-redirector.yml@v4
55
+ secrets:
56
+ # Map your repo/org secrets to the expected names.
57
+ BOT_APP_CLIENT_ID: ${{ secrets.CLDMV_BOT_APP_CLIENT_ID }}
58
+ BOT_APP_PRIVATE_KEY: ${{ secrets.CLDMV_BOT_APP_PRIVATE_KEY }}
59
+ # GPG signing identity — REQUIRED if this repo redirects Dependabot
60
+ # SECURITY PRs: that path cherry-picks a commit onto `hotfixes`, and
61
+ # an unsigned commit is silently blocked by required-signatures (no
62
+ # failing check names the cause). The commit is signed and authored as
63
+ # this real-user bot account (the GPG key's owner), not the App bot.
64
+ BOT_NAME: ${{ secrets.CLDMV_BOT_NAME }}
65
+ BOT_EMAIL: ${{ secrets.CLDMV_BOT_EMAIL }}
66
+ BOT_GPG_PRIVATE_KEY: ${{ secrets.CLDMV_BOT_GPG_PRIVATE_KEY }}
67
+ BOT_GPG_PASSPHRASE: ${{ secrets.CLDMV_BOT_GPG_PASSPHRASE }}
@@ -0,0 +1,70 @@
1
+ #
2
+ # @Project: @cldmv/gh-broker
3
+ # @Filename: /.github/workflows/hotfixes-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/hotfixes-release.yml
15
+ #
16
+ # v4 hotfix lane: maintain the ONE persistent `hotfixes → master` release PR.
17
+ #
18
+ # Mirror of next-release.yml but for the `hotfixes` integration branch
19
+ # (CLDMV/.github docs/conventions/release-flow-v4.md §5.4, §6.2). Fires on every
20
+ # push to `hotfixes` (hotfix/security PR squash-merges land here), and
21
+ # resolves-or-creates the persistent `hotfixes → master` release PR.
22
+ #
23
+ # Thin caller: all job logic (plan / create / refresh) lives in the reusable,
24
+ # pinned at @v4. Bumping the pin carries fixes without editing this file.
25
+ # CUSTOMIZE `package_name` / `build_command` to match your package (same values
26
+ # as your next-release.yml).
27
+ name: 🚑 Hotfixes Release (v4)
28
+
29
+ on:
30
+ push:
31
+ branches: [hotfixes]
32
+ workflow_dispatch: # manual kick — e.g. to open/refresh the PR for content already on `hotfixes`
33
+
34
+ concurrency:
35
+ group: hotfixes-release-${{ github.repository }}
36
+ cancel-in-progress: false
37
+
38
+ permissions:
39
+ contents: read
40
+
41
+ jobs:
42
+ release:
43
+ permissions:
44
+ contents: write
45
+ pull-requests: write
46
+ uses: CLDMV/.github/.github/workflows/workflow-hotfixes-release.yml@v4
47
+ with:
48
+ package_name: "@cldmv/gh-broker"
49
+ build_command: "npm run build:ci"
50
+ secrets:
51
+ # Map your repo/org secrets to the expected names.
52
+ BOT_APP_CLIENT_ID: ${{ secrets.CLDMV_BOT_APP_CLIENT_ID }}
53
+ BOT_APP_PRIVATE_KEY: ${{ secrets.CLDMV_BOT_APP_PRIVATE_KEY }}
54
+ # Optional: only needed if you also use reusable-lint-format.yml /
55
+ # reusable-coverage-badge.yml (or otherwise sign a commit locally as
56
+ # this identity). Passed through so the release-PR changelog
57
+ # recognizes that identity as a bot instead of listing it as a
58
+ # contributor — see CLDMV_BOT_NAME/CLDMV_BOT_EMAIL in your other
59
+ # workflows for the same values.
60
+ BOT_NAME: ${{ secrets.CLDMV_BOT_NAME }}
61
+ BOT_EMAIL: ${{ secrets.CLDMV_BOT_EMAIL }}
62
+ # Optional release-PR notifier webhooks — each is independently
63
+ # opt-in: leave one unset and that channel is silently skipped.
64
+ # Delete the lines you don't use.
65
+ DISCORD_RELEASE_PR_PUBLIC_WEBHOOK: ${{ secrets.DISCORD_RELEASE_PR_PUBLIC_WEBHOOK }}
66
+ DISCORD_RELEASE_PR_PRIVATE_WEBHOOK: ${{ secrets.DISCORD_RELEASE_PR_PRIVATE_WEBHOOK }}
67
+ SLACK_RELEASE_PR_PUBLIC_WEBHOOK: ${{ secrets.SLACK_RELEASE_PR_PUBLIC_WEBHOOK }}
68
+ SLACK_RELEASE_PR_PRIVATE_WEBHOOK: ${{ secrets.SLACK_RELEASE_PR_PRIVATE_WEBHOOK }}
69
+ GENERIC_RELEASE_PR_PUBLIC_WEBHOOK: ${{ secrets.GENERIC_RELEASE_PR_PUBLIC_WEBHOOK }}
70
+ GENERIC_RELEASE_PR_PRIVATE_WEBHOOK: ${{ secrets.GENERIC_RELEASE_PR_PRIVATE_WEBHOOK }}
@@ -0,0 +1,48 @@
1
+ #
2
+ # @Project: @cldmv/gh-broker
3
+ # @Filename: /.github/workflows/labeler.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/labeler.yml
15
+ #
16
+ # Path-based PR auto-labeler. Uses CLDMV's org-default labeler.default.yml;
17
+ # override per-repo by adding .github/labeler.yml in this repo (same shape).
18
+ #
19
+ # Labels applied additively — never removes labels added by humans or other
20
+ # automation.
21
+ #
22
+ # Batch 5.2 from tmp/plan-future-workflows.md.
23
+ name: 🏷️ PR Labeler
24
+
25
+ # SECURITY NOTE: This workflow uses pull_request_target so it can apply labels
26
+ # to fork PRs. pull_request_target runs in the BASE repo's context with WRITE
27
+ # permissions and access to secrets. This is SAFE for THIS workflow because:
28
+ # - We never checkout the PR head ref
29
+ # - We never run code from the PR (no `run:` step uses PR data)
30
+ # - We only call REST APIs to read the file list and post labels
31
+ # DO NOT add a checkout step or any step that executes PR-supplied content
32
+ # (build commands, scripts, test runs, etc.) to this workflow.
33
+ on:
34
+ pull_request_target:
35
+ types: [opened, synchronize, reopened, ready_for_review]
36
+
37
+ permissions:
38
+ contents: read
39
+ pull-requests: write
40
+
41
+ jobs:
42
+ label:
43
+ uses: CLDMV/.github/.github/workflows/reusable-pr-labeler.yml@v4
44
+ # Optional. Without these, labels are attributed to github-actions[bot].
45
+ # With these, they're attributed to your CLDMV bot App.
46
+ secrets:
47
+ BOT_APP_CLIENT_ID: ${{ secrets.CLDMV_BOT_APP_CLIENT_ID }}
48
+ BOT_APP_PRIVATE_KEY: ${{ secrets.CLDMV_BOT_APP_PRIVATE_KEY }}
@@ -0,0 +1,56 @@
1
+ #
2
+ # @Project: @cldmv/gh-broker
3
+ # @Filename: /.github/workflows/master-commit-audit.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/master-commit-audit.yml
15
+ #
16
+ # Post-merge safety net: when any commit lands on the default branch, verify
17
+ # its subject matches the expected release-flow patterns. On miss, auto-file a
18
+ # GitHub Issue (deduped by SHA) so the alert is persistent and assignable —
19
+ # not just a red ❌ that dies in inbox.
20
+ #
21
+ # Catches: release-workflow title-generation regressions, branch-protection
22
+ # bypasses, unexpected bot commits, direct emergency pushes.
23
+ #
24
+ # Thin caller: steps, the action ref, and the canonical commit-subject pattern
25
+ # set all live in reusable-master-commit-audit.yml@v4 (the patterns come from
26
+ # the audit-commit-subject action's default). Nothing here can drift.
27
+ name: 🧾 Master Commit Audit
28
+
29
+ on:
30
+ push:
31
+ branches: [master, main]
32
+
33
+ permissions:
34
+ contents: read
35
+ issues: write
36
+
37
+ jobs:
38
+ audit:
39
+ uses: CLDMV/.github/.github/workflows/reusable-master-commit-audit.yml@v4
40
+ with:
41
+ # allowed_patterns omitted → inherit the canonical default
42
+ # (release + chore + merge). Uncomment ONLY if this repo lands other
43
+ # commit shapes directly on the default branch:
44
+ # allowed_patterns: |
45
+ # ^release: v\d+\.\d+\.\d+( - .+?)?( \(#\d+\))?$
46
+ # ^chore(\([^)]+\))?: .+
47
+ # ^Merge pull request #\d+ from .+
48
+ # ^feat(\([^)]+\))?: .+
49
+ issue_labels: "type: ci,priority: high"
50
+ # issue_assignee: "shinrai" # uncomment to auto-assign
51
+ # Optional bot App credentials — when set, the audit issue is filed by
52
+ # the consumer's bot App instead of github-actions[bot]. Remove both
53
+ # lines to fall back to GITHUB_TOKEN.
54
+ secrets:
55
+ BOT_APP_CLIENT_ID: ${{ secrets.CLDMV_BOT_APP_CLIENT_ID }}
56
+ BOT_APP_PRIVATE_KEY: ${{ secrets.CLDMV_BOT_APP_PRIVATE_KEY }}