Skip to content

Commit 4cd64c5

Browse files
committed
ci: skip workspace install for the translation check
scripts/find-missing-translations.js uses only Node built-ins, verified by running it with node_modules removed: it passes on a clean tree and still detects an injected missing key. Keep the pinned Node/pnpm setup and drop the frozen-lockfile install from check-translations; update the Code QA workflow guardrail test to allow the single documented skip-install opt-out. Refs #2289
1 parent f368c34 commit 4cd64c5

2 files changed

Lines changed: 9 additions & 3 deletions

File tree

‎.github/workflows/code-qa.yml‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,12 @@ jobs:
7070
steps:
7171
- name: Checkout code
7272
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
73+
# find-missing-translations.js uses Node built-ins only, so the
74+
# pinned Node setup is kept but no workspace install is needed.
7375
- name: Setup Node.js and pnpm
7476
uses: ./.github/actions/setup-node-pnpm
7577
with:
76-
install-args: "--frozen-lockfile"
78+
skip-install: true
7779
- name: Verify all translations are complete
7880
run: node scripts/find-missing-translations.js
7981

‎scripts/code-qa-workflow.test.mjs‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,13 +138,17 @@ describe("Knip quality gate", () => {
138138
})
139139

140140
describe("Code QA dependency install", () => {
141-
it("installs every job with a frozen lockfile", () => {
141+
it("installs every job with a frozen lockfile unless the translation check skips installation", () => {
142142
const setups = workflow.match(/uses: \.\/\.github\/actions\/setup-node-pnpm\n/g) ?? []
143143
const frozen =
144144
workflow.match(
145145
/uses: \.\/\.github\/actions\/setup-node-pnpm\n\s+with:\n\s+install-args: "--frozen-lockfile"\n/g,
146146
) ?? []
147+
const skipped =
148+
workflow.match(/uses: \.\/\.github\/actions\/setup-node-pnpm\n\s+with:\n\s+skip-install: true\n/g) ?? []
147149
assert.ok(setups.length > 0, "missing setup-node-pnpm steps")
148-
assert.equal(frozen.length, setups.length)
150+
assert.equal(frozen.length + skipped.length, setups.length)
151+
assert.equal(skipped.length, 1)
152+
assert.match(workflow, /check-translations:[\s\S]*?skip-install: true/)
149153
})
150154
})

0 commit comments

Comments
 (0)