From 97567a91e79e1ee4c291eb78f5f9c30c2046ac94 Mon Sep 17 00:00:00 2001 From: Affaan Mustafa Date: Mon, 18 May 2026 13:53:26 -0400 Subject: [PATCH] test: normalize release workflow line endings --- tests/scripts/release-publish.test.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/scripts/release-publish.test.js b/tests/scripts/release-publish.test.js index f3318fb7..3f5bcdca 100644 --- a/tests/scripts/release-publish.test.js +++ b/tests/scripts/release-publish.test.js @@ -22,7 +22,7 @@ function test(name, fn) { } function load(relativePath) { - return fs.readFileSync(path.join(repoRoot, relativePath), 'utf8'); + return fs.readFileSync(path.join(repoRoot, relativePath), 'utf8').replace(/\r\n/g, '\n'); } console.log('\n=== Testing release publish workflow ===\n'); @@ -32,7 +32,8 @@ for (const workflow of [ '.github/workflows/reusable-release.yml', ]) { const content = load(workflow); - const workflowHeader = content.slice(0, content.indexOf('\njobs:\n')); + const jobsIndex = content.search(/^jobs:\s*$/m); + const workflowHeader = jobsIndex >= 0 ? content.slice(0, jobsIndex) : content; test(`${workflow} scopes id-token to the publish job for npm provenance`, () => { assert.doesNotMatch(workflowHeader, /id-token:\s*write/);