Skip to content

Commit 1e2e841

Browse files
committed
fix: preserve required CI status contexts
1 parent 3ce701a commit 1e2e841

3 files changed

Lines changed: 14 additions & 9 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,15 +59,17 @@ jobs:
5959
run: npm run actionlint
6060

6161
locked:
62-
name: Locked OpenAI / Node.js ${{ matrix.node-version }}
62+
name: Locked OpenAI / Node.js ${{ matrix.node-major }}.x
6363
runs-on: ubuntu-latest
6464
timeout-minutes: 25
6565
strategy:
6666
fail-fast: false
6767
matrix:
68-
node-version:
69-
- 22.23.4
70-
- 24.22.1
68+
include:
69+
- node-version: 22.23.4
70+
node-major: "22"
71+
- node-version: 24.22.1
72+
node-major: "24"
7173
steps:
7274
- name: Check out the repository
7375
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

‎tests/ci-workflow.test.mjs‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,10 +107,10 @@ describe("blocking CI workflow", () => {
107107
"fail-fast",
108108
"matrix",
109109
]);
110-
expect(Object.keys(locked.strategy.matrix)).toEqual(["node-version"]);
111-
expect(locked.strategy?.matrix?.["node-version"]).toEqual([
112-
"22.23.4",
113-
"24.22.1",
110+
expect(Object.keys(locked.strategy.matrix)).toEqual(["include"]);
111+
expect(locked.strategy?.matrix?.include).toEqual([
112+
{ "node-version": "22.23.4", "node-major": "22" },
113+
{ "node-version": "24.22.1", "node-major": "24" },
114114
]);
115115

116116
const liveContractSteps = locked.steps.filter(

‎tests/workflow-contract.test.mjs‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,10 @@ describe("GitHub Actions workflow contract", () => {
104104
const ci = workflow("ci.yml");
105105
const locked = job(ci, "locked");
106106
expect(locked).toMatch(
107-
/matrix:\n {8}node-version:\n {10}- 22\.23\.4\n {10}- 24\.22\.1/,
107+
/matrix:\n {8}include:\n {10}- node-version: 22\.23\.4\n {12}node-major: "22"\n {10}- node-version: 24\.22\.1\n {12}node-major: "24"/,
108+
);
109+
expect(locked).toMatch(
110+
/^ {4}name: Locked OpenAI \/ Node\.js \$\{\{ matrix\.node-major \}\}\.x$/m,
108111
);
109112
expect(locked).not.toContain("- 26.x");
110113

0 commit comments

Comments
 (0)