@cldmv/gh-broker 0.7.0 → 0.9.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/README.md +165 -41
  2. package/config.example.json +38 -9
  3. package/config.sample.json +45 -0
  4. package/deploy/README.md +76 -17
  5. package/deploy/install.mjs +171 -104
  6. package/deploy/install.sh +0 -0
  7. package/deploy/lib/config-merge.mjs +174 -16
  8. package/deploy/lib/credentials.mjs +143 -0
  9. package/deploy/lib/install-args.mjs +144 -0
  10. package/deploy/lib/npm-setup.mjs +164 -0
  11. package/deploy/lib/secret-store.mjs +20 -2
  12. package/deploy/lib/system.mjs +26 -2
  13. package/dist/index.mjs +5864 -1809
  14. package/dist/index.mjs.map +4 -4
  15. package/package.json +18 -8
  16. package/.configs/fix-headers.json +0 -3
  17. package/.configs/vitest.config.mjs +0 -44
  18. package/.github/dependabot.yml +0 -111
  19. package/.github/workflows/branch-retention.yml +0 -44
  20. package/.github/workflows/bundle-size.yml +0 -52
  21. package/.github/workflows/ci.yml +0 -389
  22. package/.github/workflows/cla.yml +0 -66
  23. package/.github/workflows/codeql.yml +0 -87
  24. package/.github/workflows/dependabot-auto-merge.yml +0 -62
  25. package/.github/workflows/dependabot-recreate.yml +0 -67
  26. package/.github/workflows/dependency-review.yml +0 -46
  27. package/.github/workflows/feature-pr.yml +0 -75
  28. package/.github/workflows/hotfix-redirector.yml +0 -67
  29. package/.github/workflows/hotfixes-release.yml +0 -70
  30. package/.github/workflows/labeler.yml +0 -48
  31. package/.github/workflows/master-commit-audit.yml +0 -56
  32. package/.github/workflows/member-auto-merge.yml +0 -75
  33. package/.github/workflows/next-release.yml +0 -76
  34. package/.github/workflows/next-reset.yml +0 -50
  35. package/.github/workflows/pr-notify.yml +0 -44
  36. package/.github/workflows/pr-title-normalizer.yml +0 -52
  37. package/.github/workflows/provenance.yml +0 -51
  38. package/.github/workflows/publish.yml +0 -146
  39. package/.github/workflows/release-merge.yml +0 -104
  40. package/.github/workflows/release-notify.yml +0 -41
  41. package/.github/workflows/scorecard.yml +0 -64
  42. package/.github/workflows/stale.yml +0 -50
  43. package/.github/workflows/tag-health.yml +0 -70
  44. package/.github/workflows/update-major-version-tags.yml +0 -94
  45. package/.github/workflows/v4-bootstrap.yml +0 -115
  46. package/.github/workflows/welcome.yml +0 -42
  47. package/docs/TOOLS.md +0 -347
  48. package/docs/agent-user-model.md +0 -89
  49. package/docs/changelog/v0/v0.2.0.md +0 -26
  50. package/docs/changelog/v0/v0.2.1.md +0 -23
  51. package/docs/changelog/v0/v0.2.2.md +0 -23
  52. package/docs/changelog/v0/v0.2.3.md +0 -33
  53. package/docs/changelog/v0/v0.2.4.md +0 -25
  54. package/docs/changelog/v0/v0.2.5.md +0 -29
  55. package/docs/changelog/v0/v0.3.0.md +0 -84
  56. package/docs/changelog/v0/v0.3.1.md +0 -30
  57. package/docs/changelog/v0/v0.3.2.md +0 -24
  58. package/docs/changelog/v0/v0.3.3.md +0 -28
  59. package/docs/changelog/v0/v0.4.0.md +0 -58
  60. package/docs/changelog/v0/v0.4.1.md +0 -33
  61. package/docs/changelog/v0/v0.4.2.md +0 -45
  62. package/docs/changelog/v0/v0.5.0.md +0 -39
  63. package/docs/changelog/v0/v0.5.1.md +0 -28
  64. package/docs/changelog/v0/v0.6.0.md +0 -52
  65. package/docs/changelog/v0/v0.6.1.md +0 -48
  66. package/docs/changelog/v0/v0.7.0.md +0 -71
  67. package/docs/deploy-architecture.md +0 -82
  68. package/src/appauth.ts +0 -56
  69. package/src/audit.ts +0 -34
  70. package/src/catalog.ts +0 -165
  71. package/src/config.ts +0 -130
  72. package/src/index.ts +0 -107
  73. package/src/paths.ts +0 -60
  74. package/src/router.ts +0 -258
  75. package/src/secrets.ts +0 -137
  76. package/src/server.ts +0 -91
  77. package/src/types.ts +0 -104
  78. package/src/upstream.ts +0 -85
  79. package/src/verbs/issue_labels.ts +0 -329
  80. package/src/verbs/link_issue.ts +0 -84
  81. package/src/verbs/release-analysis.ts +0 -210
  82. package/src/verbs/repo-tier.ts +0 -90
  83. package/src/verbs/report_ci_status.ts +0 -358
  84. package/src/verbs/report_release_prs.ts +0 -238
  85. package/src/verbs/report_security_alerts.ts +0 -442
  86. package/src/verbs/report_unlabeled.ts +0 -194
  87. package/src/verbs/rest-client.ts +0 -181
  88. package/src/verbs/review_thread.ts +0 -138
  89. package/tests/appauth.test.vitest.mts +0 -76
  90. package/tests/audit.test.vitest.mts +0 -48
  91. package/tests/catalog.test.vitest.mts +0 -180
  92. package/tests/config-merge.test.vitest.mts +0 -58
  93. package/tests/config.test.vitest.mts +0 -314
  94. package/tests/issue-labels.test.vitest.mts +0 -347
  95. package/tests/paths.test.vitest.mts +0 -52
  96. package/tests/release-prs.test.vitest.mts +0 -237
  97. package/tests/rest-client.test.vitest.mts +0 -115
  98. package/tests/router.test.vitest.mts +0 -399
  99. package/tests/run-vitest.mjs +0 -51
  100. package/tests/secret-store.test.vitest.mts +0 -106
  101. package/tests/secrets.test.vitest.mts +0 -155
  102. package/tests/security-alerts.test.vitest.mts +0 -328
  103. package/tests/server.test.vitest.mts +0 -20
  104. package/tests/upstream.test.vitest.mts +0 -91
  105. package/tests/verb-helpers.test.vitest.mts +0 -331
  106. package/tests/verbs.test.vitest.mts +0 -624
  107. package/tsconfig.json +0 -21
@@ -1,389 +0,0 @@
1
- #
2
- # @Project: @cldmv/gh-broker
3
- # @Filename: /.github/workflows/ci.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/ci.yml
15
- name: 🧪 CI Tests & Build
16
-
17
- on:
18
- # Note: do NOT add `paths:` / `paths-ignore:` at the trigger level. Doing
19
- # that makes GitHub skip the workflow entirely for docs-only changes, which
20
- # means `Required PR Check` never posts and the ruleset blocks the merge.
21
- # The reusable workflow's `paths-gate` job does the same job from inside,
22
- # and exposes a `docs_only` output so this workflow can still green-light
23
- # the required check for docs-only PRs (see `required-check` below). The
24
- # ignore globs themselves are passed via the `paths_ignore:` input below
25
- # — override there if your repo needs different rules.
26
- #
27
- # `push` fires for branches in this repo only (forks push to their own remote,
28
- # not ours). Branch protection on the PR reads the status check from the
29
- # commit SHA, so this single trigger covers both pre-PR pushes and PR head
30
- # updates without duplicating runs.
31
- push:
32
- # Bot-managed branches (badges, gh-pages) carry no source to test.
33
- branches-ignore: [badges, gh-pages]
34
- # `pull_request` covers two cases:
35
- # - Fork PRs (push doesn't fire upstream for fork commits).
36
- # - Release PRs from `next` / `hotfixes` → `master`. Their head SHA is
37
- # a bot `chore: bump version` commit that workflow-ci.yml's
38
- # `commit-gate` job filters out on the push path, so without the
39
- # pull_request fallback the release PR's `Required PR Check`
40
- # status never gets posted and the ruleset blocks the merge.
41
- # `branches:` includes the v4 integration branches so PRs targeting
42
- # `next` / `hotfixes` get CI too — feature PRs from forks would
43
- # otherwise get nothing. Non-fork feature PRs still skip the
44
- # pull_request `ci` job (push covers them); see the `if:` on the job.
45
- pull_request:
46
- types: [opened, synchronize, reopened, ready_for_review]
47
- branches: [master, main, next, hotfixes]
48
- workflow_dispatch:
49
- inputs:
50
- debug:
51
- description: "Enable debug logging for troubleshooting"
52
- type: boolean
53
- required: false
54
- default: false
55
- node_version:
56
- description: "Node.js version to use (default: lts/*)"
57
- type: string
58
- required: false
59
- default: "lts/*"
60
- min_node_version:
61
- description: "Minimum Node.js version for matrix testing (default: 22.12.0 — the floor vitest 5 actually runs on)"
62
- type: string
63
- required: false
64
- default: "22.12.0"
65
- max_node_major:
66
- 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."
67
- type: string
68
- required: false
69
- default: ""
70
- lts_only_matrix:
71
- description: "Only include even-numbered (LTS) Node.js major versions in the test matrix"
72
- type: boolean
73
- required: false
74
- default: true
75
- package_manager:
76
- description: "Package manager (npm or yarn)"
77
- type: string
78
- required: false
79
- default: "npm"
80
- test_environment:
81
- description: "Environment for tests (affects NODE_ENV and NODE_OPTIONS --conditions flag)"
82
- type: string
83
- required: false
84
- default: "development"
85
- # ── Lint & format (autofix) — all default to `--if-present` (no-op when absent)
86
- format_command:
87
- description: "Formatter that writes fixes (prettier --write)"
88
- type: string
89
- required: false
90
- default: "npm run format --if-present"
91
- lint_fix_command:
92
- description: "Linter that writes safe fixes (eslint --fix)"
93
- type: string
94
- required: false
95
- default: "npm run lint:fix --if-present"
96
- lint_command:
97
- description: "Lint check (no writes) — the authoritative lint gate"
98
- type: string
99
- required: false
100
- default: "npm run lint --if-present"
101
- format_check_command:
102
- description: "Format check (no writes) — used on fork / integration branches"
103
- type: string
104
- required: false
105
- default: "npm run format:check --if-present"
106
- # ── Coverage badge ───────────────────────────────────────────────
107
- enable_coverage_badge:
108
- description: "Run the coverage + badge-push job after CI passes"
109
- type: boolean
110
- required: false
111
- default: true
112
- coverage_command:
113
- description: "Command to run tests and generate coverage data"
114
- type: string
115
- required: false
116
- default: "npm run ci:coverage"
117
- coverage_summary_path:
118
- description: "Path to the coverage-summary.json produced by Jest / c8"
119
- type: string
120
- required: false
121
- default: "coverage/coverage-summary.json"
122
- badges_branch:
123
- description: "Branch where the badge JSON is published"
124
- type: string
125
- required: false
126
- default: "badges"
127
- badge_filename:
128
- description: "Filename for the badge JSON committed to the badges branch"
129
- type: string
130
- required: false
131
- default: "coverage.json"
132
- upload_coverage_artifact:
133
- description: "Upload the full coverage/ directory as a workflow artifact"
134
- type: boolean
135
- required: false
136
- default: true
137
- # ── Type check ──────────────────────────────────────────────────
138
- type_check_command:
139
- description: "Command to run type checking"
140
- type: string
141
- required: false
142
- default: "npm run test:types"
143
- skip_type_check:
144
- description: "Skip the type-check step in the coverage-badge job"
145
- type: boolean
146
- required: false
147
- default: false
148
- default_branch:
149
- description: "Default branch name — badge is only pushed on pushes to this branch"
150
- type: string
151
- required: false
152
- default: "master"
153
- enable_coverage_pr_comment:
154
- description: "Inject a coverage badge into the PR description on pull request events"
155
- type: boolean
156
- required: false
157
- default: true
158
-
159
- # Concurrency policy, by context:
160
- # - FEATURE branches / feature PRs → cancel superseded runs (per-ref group +
161
- # cancel-in-progress): a newer push makes the older run redundant.
162
- # - RELEASE-relevant contexts → NEVER superseded. Pushes to the release base
163
- # branch (derived: the CLDMV_RELEASE_BASE var → the repo's default branch),
164
- # to next/hotfixes, and the next/hotfixes → base release PRs each get a
165
- # UNIQUE group per run (run_id appended), so nothing cancels them. During
166
- # the burst of pushes a release makes to next/hotfixes (the feature squash,
167
- # the post-hotfix base→next sync merge, the bot's `chore: bump version`),
168
- # every run completes and posts a GREEN check instead of the earlier one
169
- # being cancelled into a red X on the release PR. A bare
170
- # `cancel-in-progress: false` is NOT enough — GitHub still cancels the
171
- # middle PENDING run when a newer one queues; a unique group avoids it.
172
- # The base is NOT hardcoded to master/main — it derives the same way
173
- # resolve-release-base does (CLDMV_RELEASE_BASE override → default_branch).
174
- # next/hotfixes are the flow's fixed integration-branch names. github.head_ref
175
- # is set only on pull_request (the release PR's head → next/hotfixes);
176
- # github.ref carries the branch on push.
177
- concurrency:
178
- group: ci-${{ github.workflow }}-${{ github.ref }}${{ (github.ref == format('refs/heads/{0}', vars.CLDMV_RELEASE_BASE != '' && vars.CLDMV_RELEASE_BASE || github.event.repository.default_branch) || github.ref == 'refs/heads/next' || github.ref == 'refs/heads/hotfixes' || github.head_ref == 'next' || github.head_ref == 'hotfixes') && format('-{0}', github.run_id) || '' }}
179
- cancel-in-progress: true
180
-
181
- # Workflow-level: matches the broadest write surface the called
182
- # `workflow-ci.yml` reaches across its branches:
183
- # - coverage-badge: contents:write (push to `badges` branch)
184
- # - coverage-pr-comment: pull-requests:write (edit PR description body)
185
- # Jobs that don't need write (CI matrix, commit-gate, the mirror below)
186
- # inherit but never exercise the surface. The mirror job overrides to
187
- # `permissions: {}` since it's pure shell.
188
- permissions:
189
- contents: read
190
-
191
- jobs:
192
- ci:
193
- permissions:
194
- contents: write
195
- pull-requests: write
196
- name: 🏗️ Continuous Integration
197
- # Run on pull_request when:
198
- # - The PR is from a fork (push doesn't fire upstream for fork commits).
199
- # - The PR is a v4 release PR — head ref is `next` or `hotfixes`
200
- # targeting `master`/`main`. Push-event CI on the head SHA is
201
- # unreliable for these because workflow-ci.yml's `commit-gate`
202
- # filters out the bot's `chore: bump version` commit, so without
203
- # this fallback the release PR's `Required PR Check` never posts.
204
- # Other (in-repo, non-release) PRs skip — the push event on the head
205
- # branch already ran CI and posted status to the SHA.
206
- if: |
207
- github.event_name != 'pull_request' ||
208
- github.event.pull_request.head.repo.fork == true ||
209
- github.event.pull_request.head.ref == 'next' ||
210
- github.event.pull_request.head.ref == 'hotfixes'
211
- uses: CLDMV/.github/.github/workflows/workflow-ci.yml@v4
212
- with:
213
- package_name: "@cldmv/gh-broker" # Required: replace with your NPM package name
214
- # Globs that should NOT trigger the heavy CI matrix. When every changed
215
- # file matches one of these, `docs_only=true` flows out of the reusable
216
- # and `required-check` below posts a green Required PR Check without
217
- # running CI. The default in the reusable matches these — override only
218
- # if your repo needs different rules.
219
- paths_ignore: |
220
- **.md
221
- docs/**
222
- *.md
223
- LICENSE
224
- .gitignore
225
- debug: ${{ github.event.inputs.debug == 'true' }}
226
- node_version: ${{ github.event.inputs.node_version || 'lts/*' }}
227
- min_node_version: ${{ github.event.inputs.min_node_version || '22.12.0' }}
228
- max_node_major: ${{ github.event.inputs.max_node_major || '' }} # blank ⇒ inherit the CLDMV/.github reusable default
229
- # LTS-only matrix (even majors: 20, 22, 24, …) on every event. Odd majors
230
- # (21, 23, …) are non-LTS interim releases, and the native-binding test
231
- # toolchain (vitest 4 / rolldown / vite 8) excludes them via `engines`
232
- # (`^20.19.0 || >=22.12.0`), so a "full matrix" on them only re-discovers a
233
- # known toolchain gap ("Cannot find native binding") rather than a real
234
- # per-version regression. workflow_dispatch can still opt out (set false).
235
- lts_only_matrix: ${{ github.event.inputs.lts_only_matrix != 'false' }}
236
- package_manager: ${{ github.event.inputs.package_manager || 'npm' }}
237
- test_command: "npm test" # Use defaults: NODE_ENV=development, NODE_OPTIONS=--conditions=development
238
- # test_command: "NODE_OPTIONS='--conditions=slothlet-dev' npm test" # Override NODE_OPTIONS only
239
- # test_command: "NODE_ENV=test npm test" # Override NODE_ENV only
240
- # test_command: "NODE_ENV=test NODE_OPTIONS='--conditions=slothlet-dev' npm test" # Override both
241
- test_environment: ${{ github.event.inputs.test_environment || 'development' }} # Alternative to setting in test_command
242
- # ── Lint & format (autofix gate) ──────────────────────────────────
243
- # The lint-format job applies safe fixes (prettier --write, eslint --fix)
244
- # and commits them back on internal branches; on fork PRs / integration
245
- # branches it runs the check variants and fails with a fix hint. Every
246
- # command uses `--if-present`, so a repo with no such script is a graceful
247
- # no-op. Add the scripts to package.json to opt in; override a command for
248
- # a monorepo-aware invocation; or set empty ("") to disable that phase.
249
- format_command: ${{ github.event.inputs.format_command || 'npm run format --if-present' }}
250
- lint_fix_command: ${{ github.event.inputs.lint_fix_command || 'npm run lint:fix --if-present' }}
251
- lint_command: ${{ github.event.inputs.lint_command || 'npm run lint --if-present' }}
252
- format_check_command: ${{ github.event.inputs.format_check_command || 'npm run format:check --if-present' }}
253
- build_command: "npm run build:ci"
254
- skip_performance_tests: false
255
- skip_matrix_tests: false
256
-
257
- # ── Coverage badge ─────────────────────────────────────────────────────
258
- # Runs after a successful CI build; pushes a Shields.io-compatible badge
259
- # JSON to the `badges` branch (signed commit via bot GPG).
260
- # Only runs on direct pushes to default_branch — PRs and feature branches
261
- # are automatically skipped so coverage always reflects merged master code.
262
- # Requires: the coverage_command produces coverage/coverage-summary.json
263
- enable_coverage_badge: ${{ github.event.inputs.enable_coverage_badge != 'false' }}
264
- default_branch: ${{ github.event.inputs.default_branch || 'master' }} # Badge only pushed when a push lands on this branch
265
- coverage_command: ${{ github.event.inputs.coverage_command || 'npm run ci:coverage' }}
266
- coverage_summary_path: ${{ github.event.inputs.coverage_summary_path || 'coverage/coverage-summary.json' }}
267
- badges_branch: ${{ github.event.inputs.badges_branch || 'badges' }}
268
- badge_filename: ${{ github.event.inputs.badge_filename || 'coverage.json' }}
269
- upload_coverage_artifact: ${{ github.event.inputs.upload_coverage_artifact != 'false' }}
270
-
271
- # ── Type check (runs inside the coverage-badge job) ────────────────────
272
- # gh-broker is a TypeScript project, so the type-check runs. `test:types`
273
- # is `tsc -p tsconfig.json --noEmit` — the same check `npm run build` runs
274
- # before esbuild bundles.
275
- type_check_command: ${{ github.event.inputs.type_check_command || 'npm run test:types' }}
276
- skip_type_check: ${{ github.event.inputs.skip_type_check == 'true' }}
277
-
278
- # ── PR coverage badge ─────────────────────────────────────────────────
279
- # Injects a Shields.io badge + breakdown table directly into the PR body
280
- # on every push to the PR branch. Only fires on pull_request events;
281
- # skipped automatically on push and workflow_dispatch. No files committed.
282
- enable_coverage_pr_comment: ${{ github.event.inputs.enable_coverage_pr_comment != 'false' }}
283
-
284
- # Authentication & Bot Configuration
285
- # The workflow supports automatic App token detection for enhanced permissions and proper attribution:
286
- # - WITH App secrets: Operations attributed to CLDMV bot, enhanced permissions for workflow repositories
287
- # - WITHOUT App secrets: Falls back to GitHub Actions bot with standard permissions
288
- # Note: CI workflow currently only runs build/test jobs, but App secrets are included for consistency
289
- # To set up App authentication, add these secrets to your repository settings:
290
- secrets:
291
- NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
292
- # Optional: CLDMV Bot credentials for enhanced permissions and proper attribution
293
- # If not provided, will use default GITHUB_TOKEN with GitHub Actions bot attribution
294
- BOT_APP_CLIENT_ID: ${{ secrets.CLDMV_BOT_APP_CLIENT_ID }}
295
- BOT_APP_PRIVATE_KEY: ${{ secrets.CLDMV_BOT_APP_PRIVATE_KEY }}
296
- # Required when enable_coverage_badge: true
297
- BOT_NAME: ${{ secrets.CLDMV_BOT_NAME }}
298
- BOT_EMAIL: ${{ secrets.CLDMV_BOT_EMAIL }}
299
- BOT_GPG_PRIVATE_KEY: ${{ secrets.CLDMV_BOT_GPG_PRIVATE_KEY }}
300
- BOT_GPG_PASSPHRASE: ${{ secrets.CLDMV_BOT_GPG_PASSPHRASE }}
301
-
302
- # ✅ Stable check that mirrors the `ci` result so branch protection has a
303
- # single, predictable status name to require. The push event runs on the
304
- # same SHA that becomes the PR head, so the status attaches to the PR
305
- # automatically — no `pull_request` round-trip needed for non-fork
306
- # non-release PRs.
307
- required-check:
308
- # Which name this job reports under is the whole point of it.
309
- #
310
- # The ruleset gates merges on `✅ Required PR Check`, so a check with that
311
- # name must only ever exist on a head SHA after the full test matrix for
312
- # that SHA has finished, mirroring its result. `needs: ci` guarantees the
313
- # timing: the job is only created once every Build & Test leg and the
314
- # coverage job are done.
315
- #
316
- # On an in-repo feature PR the `pull_request` run does not own the status
317
- # (the push run on the head branch does), so it must not post
318
- # `✅ Required PR Check` at all. Two traps rule out the obvious shapes:
319
- # - A job SKIPPED by `if:` still posts a check run under its name, and
320
- # GitHub treats a skipped required check as satisfied. Under the real
321
- # name that let PRs merge mid-test (CLDMV/slothlet#553).
322
- # - GitHub does not evaluate the `name:` of a skipped job, so a
323
- # conditional name on a skippable job shows up as the raw expression
324
- # text (#350).
325
- # So the job never skips: it runs on every path, the name expression is
326
- # always evaluated, and the in-repo PR path lands on a readable,
327
- # non-required name and passes as a no-op. The condition below is
328
- # repeated in the step's OWNS_STATUS and must stay identical. The paths
329
- # that own the status:
330
- # 1. push events (job needs CI run)
331
- # 2. fork PRs (push doesn't cover forks)
332
- # 3. release PRs from `next` → master/main (push covers SHA but commit-gate skips chore-bump)
333
- # 4. release PRs from `hotfixes` → master/main (same reason)
334
- name: ${{ (github.event_name != 'pull_request' || github.event.pull_request.head.repo.fork == true || github.event.pull_request.head.ref == 'next' || github.event.pull_request.head.ref == 'hotfixes') && '✅ Required PR Check' || '⏭️ Required PR Check (reported by the push run)' }}
335
- needs: ci
336
- # always(): run even when `ci` is skipped (the in-repo PR path) or failed
337
- # (so the mirror can report red).
338
- if: always()
339
- # Match the reusable's runner routing (workflow-ci.yml): private CLDMV
340
- # repos run on self-hosted cldmv-runners (GitHub-hosted Actions budget is
341
- # private-metered and exhausted), public repos use free GitHub-hosted, and
342
- # RUNS_ON_DEFAULT overrides. Hardcoding ubuntu-latest here made this
343
- # required check fail to provision a runner on private repos once the
344
- # reusable moved its own jobs to cldmv-runners in v4.19.1 (see #208).
345
- runs-on: ${{ vars.RUNS_ON_DEFAULT != '' && vars.RUNS_ON_DEFAULT || ((github.repository_owner == 'CLDMV' && github.event.repository.private) && 'cldmv-runners' || 'ubuntu-latest') }}
346
- # Pure shell mirror — no GitHub API access. Strip the workflow's
347
- # write defaults to zero for this job.
348
- permissions: {}
349
- steps:
350
- - name: Mirror reusable result
351
- env:
352
- OWNS_STATUS: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.fork == true || github.event.pull_request.head.ref == 'next' || github.event.pull_request.head.ref == 'hotfixes' }}
353
- IS_MASTER_SYNC: ${{ needs.ci.outputs.is_master_sync }}
354
- DOCS_ONLY: ${{ needs.ci.outputs.docs_only }}
355
- CI_RESULT: ${{ needs.ci.result }}
356
- run: |
357
- # In-repo feature PR: the push run on the head branch reports
358
- # `✅ Required PR Check`. This job runs under the
359
- # `⏭️ Required PR Check (reported by the push run)` name and
360
- # must not gate anything.
361
- if [ "$OWNS_STATUS" != "true" ]; then
362
- echo "In-repo PR event — the push run reports ✅ Required PR Check for this SHA."
363
- exit 0
364
- fi
365
- echo "ci.result=$CI_RESULT docs_only=$DOCS_ONLY is_master_sync=$IS_MASTER_SYNC"
366
- # next/hotfixes was force-synced to master — head SHA matches the
367
- # default branch, nothing new to test, green-light without running CI.
368
- if [ "$IS_MASTER_SYNC" = "true" ]; then
369
- echo "Branch tip matches master — Required PR Check passes without running CI."
370
- exit 0
371
- fi
372
- # Docs-only PR — the reusable skipped the heavy chain and exported
373
- # docs_only=true. Green-light Required PR Check so the ruleset
374
- # doesn't block a docs change.
375
- if [ "$DOCS_ONLY" = "true" ]; then
376
- echo "Docs-only change — Required PR Check passes without running CI."
377
- exit 0
378
- fi
379
- if [ "$CI_RESULT" = "success" ]; then
380
- echo "Reusable CI passed."
381
- exit 0
382
- elif [ "$CI_RESULT" = "failure" ] || [ "$CI_RESULT" = "cancelled" ]; then
383
- echo "Reusable CI did not pass."
384
- exit 1
385
- else
386
- # covers 'skipped' or undefined; force red to avoid silent green
387
- echo "Reusable CI produced no pass/fail; treating as failure."
388
- exit 1
389
- fi
@@ -1,66 +0,0 @@
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 }}
@@ -1,87 +0,0 @@
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"
@@ -1,62 +0,0 @@
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 }}