diff --git a/.github/scripts/qwen-triage-workflow.test.mjs b/.github/scripts/qwen-triage-workflow.test.mjs index 03de579f07..6c4f66e50f 100644 --- a/.github/scripts/qwen-triage-workflow.test.mjs +++ b/.github/scripts/qwen-triage-workflow.test.mjs @@ -755,8 +755,8 @@ describe('qwen-triage: npm cache producer workflow', () => { it('runs on the same target as the consumers so the cache version matches', () => { // actions/cache scopes an entry by a hash of the literal cache path plus // the compression method. A producer on a different runner or outside the - // container computes a different version, so every restore misses even - // when the key and path strings match — pin runs-on + container to the + // container image computes a different version, so every restore misses + // even when the key and path strings match — pin runs-on + image to the // consumers' so both match by construction. for (const [jobName, jobDef] of [ ['verify', verifyJob], @@ -767,11 +767,16 @@ describe('qwen-triage: npm cache producer workflow', () => { jobDef['runs-on'], `producer runs-on must match ${jobName}`, ); - assert.deepEqual( - saveJob.container, - jobDef.container, - `producer container must match ${jobName}`, + assert.equal( + saveJob.container.image, + jobDef.container.image, + `producer container image must match ${jobName}`, ); } + assert.equal( + saveJob.container.options, + '--init --user node', + 'producer must not leave root-owned files on the self-hosted runner', + ); }); }); diff --git a/.github/workflows/npm-cache.yml b/.github/workflows/npm-cache.yml index 09b7d14751..1131ae37bd 100644 --- a/.github/workflows/npm-cache.yml +++ b/.github/workflows/npm-cache.yml @@ -30,7 +30,8 @@ jobs: runs-on: ['self-hosted', 'linux', 'x64', 'ecs-qwen'] container: image: 'node:22-bookworm' - options: '--init' + # Match the host runner UID/GID so bind-mounted files stay writable. + options: '--init --user node' timeout-minutes: 15 steps: - uses: 'actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10' # v6.0.3 diff --git a/scripts/tests/qwen-triage-workflow.test.js b/scripts/tests/qwen-triage-workflow.test.js index ea691f330c..ce034e0802 100644 --- a/scripts/tests/qwen-triage-workflow.test.js +++ b/scripts/tests/qwen-triage-workflow.test.js @@ -5370,6 +5370,7 @@ describe('qwen-triage npm cache producer', () => { "runs-on: ['self-hosted', 'linux', 'x64', 'ecs-qwen']", ); expect(cacheProducerWorkflow).toContain("image: 'node:22-bookworm'"); + expect(cacheProducerWorkflow).toContain("options: '--init --user node'"); for (const jobName of ['verify', 'tmux-testing']) { expect(job(jobName)).toContain( "runs-on: ['self-hosted', 'linux', 'x64', 'ecs-qwen']",