From 80720bf397c62c3aa2e399500266603a24953463 Mon Sep 17 00:00:00 2001 From: lmvysakh Date: Fri, 3 Jul 2026 13:16:50 +0530 Subject: [PATCH 1/3] Code fix using pattern --- dist/setup/index.js | 13 ++++++++++++- src/install-python.ts | 13 ++++++++++++- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/dist/setup/index.js b/dist/setup/index.js index 6ac18cd5e..32f96cb28 100644 --- a/dist/setup/index.js +++ b/dist/setup/index.js @@ -55746,6 +55746,11 @@ async function getManifestFromURL() { } return response.result; } +function isWarningMessage(msg) { + const upperMsg = msg.toUpperCase(); + const warningPatterns = ['WARNING:']; + return warningPatterns.some(pattern => upperMsg.includes(pattern)); +} async function installPython(workingDirectory) { const options = { cwd: workingDirectory, @@ -55759,7 +55764,13 @@ async function installPython(workingDirectory) { core.info(data.toString().trim()); }, stderr: (data) => { - core.error(data.toString().trim()); + const msg = data.toString().trim(); + if (isWarningMessage(msg)) { + core.warning(msg); + } + else { + core.error(msg); + } } } }; diff --git a/src/install-python.ts b/src/install-python.ts index 9e17c3346..59f4aac06 100644 --- a/src/install-python.ts +++ b/src/install-python.ts @@ -180,6 +180,12 @@ export async function getManifestFromURL(): Promise { return response.result; } +function isWarningMessage(msg: string): boolean { + const upperMsg = msg.toUpperCase(); + const warningPatterns = ['WARNING:']; + return warningPatterns.some(pattern => upperMsg.includes(pattern)); +} + async function installPython(workingDirectory: string) { const options: ExecOptions = { cwd: workingDirectory, @@ -193,7 +199,12 @@ async function installPython(workingDirectory: string) { core.info(data.toString().trim()); }, stderr: (data: Buffer) => { - core.error(data.toString().trim()); + const msg = data.toString().trim(); + if (isWarningMessage(msg)) { + core.warning(msg); + } else { + core.error(msg); + } } } }; From 7837b0ba4ff4ef9ce946354f255e3a28f950341b Mon Sep 17 00:00:00 2001 From: lmvysakh Date: Tue, 7 Jul 2026 12:24:01 +0530 Subject: [PATCH 2/3] Updated code logic --- dist/setup/index.js | 22 +++++++++++----------- src/install-python.ts | 20 +++++++++----------- 2 files changed, 20 insertions(+), 22 deletions(-) diff --git a/dist/setup/index.js b/dist/setup/index.js index 32f96cb28..e416e3076 100644 --- a/dist/setup/index.js +++ b/dist/setup/index.js @@ -55746,11 +55746,6 @@ async function getManifestFromURL() { } return response.result; } -function isWarningMessage(msg) { - const upperMsg = msg.toUpperCase(); - const warningPatterns = ['WARNING:']; - return warningPatterns.some(pattern => upperMsg.includes(pattern)); -} async function installPython(workingDirectory) { const options = { cwd: workingDirectory, @@ -55764,12 +55759,17 @@ async function installPython(workingDirectory) { core.info(data.toString().trim()); }, stderr: (data) => { - const msg = data.toString().trim(); - if (isWarningMessage(msg)) { - core.warning(msg); - } - else { - core.error(msg); + const msgList = data.toString().split(/\r?\n/); + for (const msg of msgList) { + const trimmedMsg = msg.trim(); + if (!trimmedMsg) + continue; + if (trimmedMsg.startsWith('WARNING:')) { + core.warning(trimmedMsg); + } + else { + core.error(trimmedMsg); + } } } } diff --git a/src/install-python.ts b/src/install-python.ts index 59f4aac06..1533883bc 100644 --- a/src/install-python.ts +++ b/src/install-python.ts @@ -180,12 +180,6 @@ export async function getManifestFromURL(): Promise { return response.result; } -function isWarningMessage(msg: string): boolean { - const upperMsg = msg.toUpperCase(); - const warningPatterns = ['WARNING:']; - return warningPatterns.some(pattern => upperMsg.includes(pattern)); -} - async function installPython(workingDirectory: string) { const options: ExecOptions = { cwd: workingDirectory, @@ -199,11 +193,15 @@ async function installPython(workingDirectory: string) { core.info(data.toString().trim()); }, stderr: (data: Buffer) => { - const msg = data.toString().trim(); - if (isWarningMessage(msg)) { - core.warning(msg); - } else { - core.error(msg); + const msgList = data.toString().split(/\r?\n/); + for (const msg of msgList) { + const trimmedMsg = msg.trim(); + if (!trimmedMsg) continue; + if (trimmedMsg.startsWith('WARNING:')) { + core.warning(trimmedMsg); + } else { + core.error(trimmedMsg); + } } } } From c1cf0c144d2654bd715adb05cd663df3ffea7e7f Mon Sep 17 00:00:00 2001 From: lmvysakh Date: Tue, 7 Jul 2026 17:11:53 +0530 Subject: [PATCH 3/3] Code updated --- dist/setup/index.js | 17 ++++++----------- src/install-python.ts | 14 +++++--------- 2 files changed, 11 insertions(+), 20 deletions(-) diff --git a/dist/setup/index.js b/dist/setup/index.js index e416e3076..82be52f08 100644 --- a/dist/setup/index.js +++ b/dist/setup/index.js @@ -55759,17 +55759,12 @@ async function installPython(workingDirectory) { core.info(data.toString().trim()); }, stderr: (data) => { - const msgList = data.toString().split(/\r?\n/); - for (const msg of msgList) { - const trimmedMsg = msg.trim(); - if (!trimmedMsg) - continue; - if (trimmedMsg.startsWith('WARNING:')) { - core.warning(trimmedMsg); - } - else { - core.error(trimmedMsg); - } + const msg = data.toString().trim(); + if (/^WARNING:/im.test(msg)) { + core.warning(msg); + } + else { + core.error(msg); } } } diff --git a/src/install-python.ts b/src/install-python.ts index 1533883bc..a9caf0fe0 100644 --- a/src/install-python.ts +++ b/src/install-python.ts @@ -193,15 +193,11 @@ async function installPython(workingDirectory: string) { core.info(data.toString().trim()); }, stderr: (data: Buffer) => { - const msgList = data.toString().split(/\r?\n/); - for (const msg of msgList) { - const trimmedMsg = msg.trim(); - if (!trimmedMsg) continue; - if (trimmedMsg.startsWith('WARNING:')) { - core.warning(trimmedMsg); - } else { - core.error(trimmedMsg); - } + const msg = data.toString().trim(); + if (/^WARNING:/im.test(msg)) { + core.warning(msg); + } else { + core.error(msg); } } }