From bd6859cc587faeeb3aead12917df2053a48d75b2 Mon Sep 17 00:00:00 2001 From: Benoit Daloze Date: Fri, 25 Jul 2025 20:25:02 +0200 Subject: [PATCH] Use core.group() instead of startGroup/endGroup --- common.js | 29 ++++++++++++++--------------- dist/index.js | 29 ++++++++++++++--------------- 2 files changed, 28 insertions(+), 30 deletions(-) diff --git a/common.js b/common.js index de15984..02e57b2 100644 --- a/common.js +++ b/common.js @@ -360,24 +360,23 @@ export function setupPath(newPathEntries) { const originalPath = process.env[envPath].split(path.delimiter) let cleanPath = originalPath.filter(entry => !/\bruby\b/i.test(entry)) - core.startGroup(`Modifying ${envPath}`) - - // First remove the conflicting path entries - if (cleanPath.length !== originalPath.length) { - console.log(`Entries removed from ${envPath} to avoid conflicts with default Ruby:`) - for (const entry of originalPath) { - if (!cleanPath.includes(entry)) { - console.log(` ${entry}`) + core.group(`Modifying ${envPath}`, async () => { + // First remove the conflicting path entries + if (cleanPath.length !== originalPath.length) { + console.log(`Entries removed from ${envPath} to avoid conflicts with default Ruby:`) + for (const entry of originalPath) { + if (!cleanPath.includes(entry)) { + console.log(` ${entry}`) + } } + core.exportVariable(envPath, cleanPath.join(path.delimiter)) } - core.exportVariable(envPath, cleanPath.join(path.delimiter)) - } - console.log(`Entries added to ${envPath} to use selected Ruby:`) - for (const entry of newPathEntries) { - console.log(` ${entry}`) - } - core.endGroup() + console.log(`Entries added to ${envPath} to use selected Ruby:`) + for (const entry of newPathEntries) { + console.log(` ${entry}`) + } + }) core.addPath(newPathEntries.join(path.delimiter)) } diff --git a/dist/index.js b/dist/index.js index 160f361..d82a17d 100644 --- a/dist/index.js +++ b/dist/index.js @@ -677,24 +677,23 @@ function setupPath(newPathEntries) { const originalPath = process.env[envPath].split(path.delimiter) let cleanPath = originalPath.filter(entry => !/\bruby\b/i.test(entry)) - core.startGroup(`Modifying ${envPath}`) - - // First remove the conflicting path entries - if (cleanPath.length !== originalPath.length) { - console.log(`Entries removed from ${envPath} to avoid conflicts with default Ruby:`) - for (const entry of originalPath) { - if (!cleanPath.includes(entry)) { - console.log(` ${entry}`) + core.group(`Modifying ${envPath}`, async () => { + // First remove the conflicting path entries + if (cleanPath.length !== originalPath.length) { + console.log(`Entries removed from ${envPath} to avoid conflicts with default Ruby:`) + for (const entry of originalPath) { + if (!cleanPath.includes(entry)) { + console.log(` ${entry}`) + } } + core.exportVariable(envPath, cleanPath.join(path.delimiter)) } - core.exportVariable(envPath, cleanPath.join(path.delimiter)) - } - console.log(`Entries added to ${envPath} to use selected Ruby:`) - for (const entry of newPathEntries) { - console.log(` ${entry}`) - } - core.endGroup() + console.log(`Entries added to ${envPath} to use selected Ruby:`) + for (const entry of newPathEntries) { + console.log(` ${entry}`) + } + }) core.addPath(newPathEntries.join(path.delimiter)) }