@avi2dg/checks 0.67.0 → 0.68.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.
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
Every release of `@avi2dg/checks`, newest first, written by the release from its conventional commits.
|
|
4
4
|
|
|
5
|
+
## 0.68.0
|
|
6
|
+
|
|
7
|
+
Released 2026-11-06.
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
- **ci-wiring:** accept short shared refs for runner pick and setup [#49](https://github.com/avi2d/checks/pull/49)
|
|
12
|
+
|
|
5
13
|
## 0.67.0
|
|
6
14
|
|
|
7
15
|
Released 2026-11-06.
|
|
@@ -69,7 +69,8 @@ A job on `push` or another trigger no fork reaches may still name self-hosted la
|
|
|
69
69
|
In a private repository each mutation job carries exactly the labels the consumer declares in `package.json` under `checks.mutationRunner`.
|
|
70
70
|
Every other job there carries exactly the hosted-default expression, or exactly one of the label sets the consumer declares under `checks.selfHostedRunners`.
|
|
71
71
|
A job there also carries `runs-on: ${{ needs.<job>.outputs.runs-on }}` when the same workflow needs that job and that job calls the runner pick.
|
|
72
|
-
The pick is the repository file `runner.yml` under `.github/workflows/` or `avi2d/workflows/.github/workflows/runner.yml` at a
|
|
72
|
+
The pick is the repository file `runner.yml` under `.github/workflows/` or `avi2d/workflows/.github/workflows/runner.yml` at a full SHA or at a version tag, `v<major>` or `v<major>.<minor>.<patch>`.
|
|
73
|
+
A branch name or a missing ref is not the pick.
|
|
73
74
|
A public repository still refuses that expression on a job a fork can reach.
|
|
74
75
|
The resolved label cannot be shown to be a hosted runner before the run.
|
|
75
76
|
A repository without those declarations fails each job they would pin until it declares them.
|
|
@@ -94,7 +95,7 @@ The fleet version is the version the kit ships in its own `.bun-version`.
|
|
|
94
95
|
The step fails the check when the version is missing or differs from the fleet bun version.
|
|
95
96
|
A range fails because it differs from the fleet version.
|
|
96
97
|
A version built from an expression fails because it cannot be shown equal before the run.
|
|
97
|
-
A step that uses `avi2d/workflows/actions/setup
|
|
98
|
+
A step that uses `avi2d/workflows/setup` or `avi2d/workflows/actions/setup`, at any ref or none, reads `.bun-version`.
|
|
98
99
|
The step fails the check when `.bun-version` is missing or differs from the fleet bun version.
|
|
99
100
|
This rule skips a repository with no setup-bun step and no shared setup step.
|
|
100
101
|
A kit release that moves the fleet version turns each consumer red until its pin follows.
|
package/package.json
CHANGED
package/src/delivery/bun-pin.ts
CHANGED
|
@@ -17,7 +17,7 @@ export type BunPinFault = {
|
|
|
17
17
|
|
|
18
18
|
const SETUP_BUN = /^oven-sh\/setup-bun(?:@(?<ref>.*))?$/i;
|
|
19
19
|
const V2_REF = /^v2(?:\.\d+){0,2}$/;
|
|
20
|
-
const SHARED_SETUP = /^avi2d\/workflows\/actions\/setup(
|
|
20
|
+
const SHARED_SETUP = /^avi2d\/workflows\/(?:actions\/)?setup(?:@.*)?$/i;
|
|
21
21
|
const SETUP_VERSION_FILE = ".bun-version";
|
|
22
22
|
|
|
23
23
|
function setupBunRef(uses: unknown): string | undefined {
|
|
@@ -25,9 +25,9 @@ function setupBunRef(uses: unknown): string | undefined {
|
|
|
25
25
|
return match === null ? undefined : (match.groups?.["ref"] ?? "");
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
function
|
|
29
|
-
const
|
|
30
|
-
return
|
|
28
|
+
function sharedSetupUses(uses: unknown): string | undefined {
|
|
29
|
+
const text = typeof uses === "string" ? uses.trim() : "";
|
|
30
|
+
return SHARED_SETUP.test(text) ? text : undefined;
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
function isExpression(value: string): boolean {
|
|
@@ -113,9 +113,8 @@ function unknownRefFault(ref: string): string {
|
|
|
113
113
|
return `uses oven-sh/setup-bun at ${ref === "" ? "no ref" : ref}, but the check knows only setup-bun v2's version resolution, so the step must use oven-sh/setup-bun@v2`;
|
|
114
114
|
}
|
|
115
115
|
|
|
116
|
-
function sharedSetupFault(policy: BunPinPolicy,
|
|
116
|
+
function sharedSetupFault(policy: BunPinPolicy, uses: string): string | undefined {
|
|
117
117
|
const version = nonEmpty(policy.files.get(SETUP_VERSION_FILE));
|
|
118
|
-
const uses = ref === "" ? "avi2d/workflows/actions/setup" : `avi2d/workflows/actions/setup@${ref}`;
|
|
119
118
|
if (version === undefined) {
|
|
120
119
|
return `uses ${uses}, which reads ${SETUP_VERSION_FILE}, but the repository holds no ${SETUP_VERSION_FILE} file, want ${policy.fleet}`;
|
|
121
120
|
}
|
|
@@ -137,9 +136,9 @@ export function findBunPinFaults(policy: BunPinPolicy, workflows: readonly Workf
|
|
|
137
136
|
const fault = V2_REF.test(ref) ? bunPinFault(policy, step) : unknownRefFault(ref);
|
|
138
137
|
return fault === undefined ? [] : atStep(fault);
|
|
139
138
|
}
|
|
140
|
-
const
|
|
141
|
-
if (
|
|
142
|
-
const fault = sharedSetupFault(policy,
|
|
139
|
+
const sharedUses = sharedSetupUses(step["uses"]);
|
|
140
|
+
if (sharedUses === undefined) return [];
|
|
141
|
+
const fault = sharedSetupFault(policy, sharedUses);
|
|
143
142
|
return fault === undefined ? [] : atStep(fault);
|
|
144
143
|
});
|
|
145
144
|
});
|
|
@@ -165,7 +164,7 @@ function versionFileKeys(job: Readonly<Record<string, unknown>>): readonly strin
|
|
|
165
164
|
|
|
166
165
|
function usesSharedSetup(job: Readonly<Record<string, unknown>>): boolean {
|
|
167
166
|
const steps = Array.isArray(job["steps"]) ? job["steps"] : [];
|
|
168
|
-
return steps.some((step) => isRecord(step) &&
|
|
167
|
+
return steps.some((step) => isRecord(step) && sharedSetupUses(step["uses"]) !== undefined);
|
|
169
168
|
}
|
|
170
169
|
|
|
171
170
|
function wantedBunPinFiles(workflows: readonly Workflow[]): ReadonlySet<string> {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { names, type Workflow } from "./workflow-references.ts";
|
|
2
2
|
|
|
3
3
|
const NEEDS_RUNS_ON = /^\$\{\{\s*needs\.([\w-]+)\.outputs\.runs-on\s*\}\}$/i;
|
|
4
|
-
const SHARED_RUNNER = /^
|
|
4
|
+
const SHARED_RUNNER = /^[Aa][Vv][Ii]2[Dd]\/[Ww][Oo][Rr][Kk][Ff][Ll][Oo][Ww][Ss]\/\.github\/workflows\/runner\.yml@(?:[0-9a-fA-F]{40}|v\d+(?:\.\d+\.\d+)?)$/;
|
|
5
5
|
const LOCAL_RUNNER = ".github/workflows/runner.yml";
|
|
6
6
|
|
|
7
7
|
function callsRunnerPick(uses: unknown, workflows: readonly Workflow[]): boolean {
|