diff --git a/__tests__/tested-version.test.ts b/__tests__/tested-version.test.ts index 2e0412d53..6979030b1 100644 --- a/__tests__/tested-version.test.ts +++ b/__tests__/tested-version.test.ts @@ -24,10 +24,12 @@ describe("[env variable mock]", () => { "Tested up to: 0.42", "Tested up to:0.42", "LINE1\nNot Tested up to: 0.41\nTested up to: 0.42\nLINE2", + "LINE1\r\nNot Tested up to: 0.41\r\nTested up to: 0.42\r\nLINE2", " Tested up to: 0.42", " Tested up to: 0.42", "\tTested up to: 0.42", "\nTested up to: 0.42\n", + "\r\nTested up to: 0.42\r\n", "Tested up to: 0.42", ])("testedVersion works correctly", async (readme) => { expect.assertions(1); diff --git a/dist/index.js b/dist/index.js index 90a3e9012..7a7b1441f 100644 --- a/dist/index.js +++ b/dist/index.js @@ -10612,7 +10612,7 @@ function readme(config) { function testedVersion(config) { return __awaiter(this, void 0, void 0, function* () { const readmeContents = yield readme(config); - for (const line of readmeContents.split("\n")) { + for (const line of readmeContents.split(/\r?\n/)) { const matches = [...line.matchAll(/^[\s]*Tested up to:[\s]*([.\d]+)$/g)]; if (matches.length !== 1) { continue; diff --git a/src/tested-version.ts b/src/tested-version.ts index b85e8e221..a12cbf9af 100644 --- a/src/tested-version.ts +++ b/src/tested-version.ts @@ -36,7 +36,7 @@ async function readme(config: Config): Promise { export async function testedVersion(config: Config): Promise { const readmeContents = await readme(config); - for (const line of readmeContents.split("\n")) { + for (const line of readmeContents.split(/\r?\n/)) { const matches = [...line.matchAll(/^[\s]*Tested up to:[\s]*([.\d]+)$/g)]; if (matches.length !== 1) { continue;