@theholocron/cli 2.0.0-alpha.22 → 2.0.0-alpha.24

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.
@@ -100,6 +100,12 @@ interface Source extends ProviderIdentity {
100
100
  * Triggers a new analysis run; returns the run id.
101
101
  */
102
102
  enableCodeScanning(): Promise<string>;
103
+ /**
104
+ * Disables CodeQL default setup. Required when the repo uses an advanced
105
+ * CodeQL workflow instead — GitHub rejects SARIF from advanced workflows
106
+ * while default setup is active.
107
+ */
108
+ disableDefaultCodeScanning(): Promise<void>;
103
109
  listWorkflowFiles(): Promise<string[]>;
104
110
  readWorkflowFile(name: string): Promise<string | null>;
105
111
  writeWorkflowFile(name: string, contents: string): Promise<void>;
package/dist/cli.mjs CHANGED
@@ -1938,6 +1938,19 @@ jobs:
1938
1938
  };
1939
1939
  const KNOWN_WORKFLOWS = new Set(Object.keys(WORKFLOW_TEMPLATES));
1940
1940
  /**
1941
+ * GitHub check context name each CI workflow produces on a PR.
1942
+ *
1943
+ * The format is "{caller-workflow-name} / {reusable-job-name}". The caller
1944
+ * job's own `name:` field does NOT appear in the external check name — only
1945
+ * the calling workflow's top-level `name:` and the inner reusable-workflow
1946
+ * job name matter. Only workflows that gate merges are listed here.
1947
+ */
1948
+ const WORKFLOW_CHECK_CONTEXTS = {
1949
+ lint: "Lint / Lint entire codebase",
1950
+ test: "Test / Run tests and collect coverage",
1951
+ typecheck: "Typecheck / tsc --noEmit"
1952
+ };
1953
+ /**
1941
1954
  * Generate the thin caller content for a workflow, optionally injecting
1942
1955
  * `with:` inputs before `secrets: inherit` in the jobs block.
1943
1956
  */
@@ -3752,8 +3765,10 @@ async function runSetup(input) {
3752
3765
  }));
3753
3766
  print(formatStep(steps[steps.length - 1]));
3754
3767
  }
3755
- steps.push(await runStep("source", "enableCodeScanning", dryRun, async () => {
3756
- return await source.enableCodeScanning();
3768
+ const usesAdvancedCodeQL = (config.project.workflows ?? []).map((e) => typeof e === "string" ? e : e.name).includes("codeql");
3769
+ steps.push(await runStep("source", usesAdvancedCodeQL ? "disableDefaultCodeScanning" : "enableCodeScanning", dryRun, async () => {
3770
+ if (usesAdvancedCodeQL) await source.disableDefaultCodeScanning();
3771
+ else return await source.enableCodeScanning();
3757
3772
  }));
3758
3773
  print(formatStep(steps[steps.length - 1]));
3759
3774
  const policy = config.project.repoPolicy;
@@ -3763,7 +3778,15 @@ async function runSetup(input) {
3763
3778
  await source.updateRepoSettings(BALANCED_REPO_SETTINGS);
3764
3779
  }));
3765
3780
  print(formatStep(steps[steps.length - 1]));
3766
- const requiredChecks = preset === "strict" ? policy.requiredChecks ?? [] : [];
3781
+ const configuredWorkflowNames = (config.project.workflows ?? []).map((entry) => typeof entry === "string" ? entry : entry.name);
3782
+ const requiredChecks = preset === "strict" ? [
3783
+ "DCO",
3784
+ ...configuredWorkflowNames.flatMap((name) => {
3785
+ const ctx = WORKFLOW_CHECK_CONTEXTS[name];
3786
+ return ctx ? [ctx] : [];
3787
+ }),
3788
+ ...policy.requiredChecks ?? []
3789
+ ] : [];
3767
3790
  steps.push(await upsertBranchProtection(source, dryRun, requiredChecks));
3768
3791
  print(formatStep(steps[steps.length - 1]));
3769
3792
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@theholocron/cli",
3
- "version": "2.0.0-alpha.22",
3
+ "version": "2.0.0-alpha.24",
4
4
  "description": "The Holocron CLI — a pluggable, capability-based orchestrator for spinning up and operating software projects.",
5
5
  "homepage": "https://github.com/theholocron/holocron/tree/main/packages/cli#readme",
6
6
  "bugs": "https://github.com/theholocron/holocron/issues",