diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 50771143b..c8df580f3 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -2,6 +2,7 @@ name: Test this action on: push: branches-ignore: + - master - v1 tags-ignore: - '*' diff --git a/dist/index.js b/dist/index.js index 6bb583f84..098cd76ed 100644 --- a/dist/index.js +++ b/dist/index.js @@ -7896,7 +7896,7 @@ async function install(platform, ruby) { const drive = (process.env['GITHUB_WORKSPACE'] || 'C')[0] const downloadPath = await tc.downloadTool(url) - await exec.exec(`7z x ${downloadPath} -xr!${base}\\share\\doc -o${drive}:\\`) + await exec.exec('7z', ['x', downloadPath, `-xr!${base}\\share\\doc`, `-o${drive}:\\`], { silent: true }) const rubyPrefix = `${drive}:\\${base}` const [hostedRuby, msys2] = await linkMSYS2() @@ -7929,10 +7929,8 @@ async function linkMSYS2() { } function setupPath(msys2, rubyPrefix) { - let path = process.env['PATH'].split(';') - - // Remove conflicting dev tools from PATH - path = path.filter(e => !e.match(/\b(Chocolatey|CMake|mingw64|OpenSSL|Strawberry)\b/)) + const originalPath = process.env['PATH'].split(';') + let path = originalPath.slice() // Remove default Ruby in PATH path = path.filter(e => !e.match(/\bRuby\b/)) @@ -7945,6 +7943,13 @@ function setupPath(msys2, rubyPrefix) { // Add the downloaded Ruby in PATH path.unshift(`${rubyPrefix}\\bin`) + console.log("Entries removed from PATH to avoid conflicts with Ruby:") + for (const entry of originalPath) { + if (!path.includes(entry)) { + console.log(entry) + } + } + const newPath = path.join(';') core.exportVariable('PATH', newPath) } diff --git a/windows.js b/windows.js index 19874db2b..586851218 100644 --- a/windows.js +++ b/windows.js @@ -29,7 +29,7 @@ export async function install(platform, ruby) { const drive = (process.env['GITHUB_WORKSPACE'] || 'C')[0] const downloadPath = await tc.downloadTool(url) - await exec.exec(`7z x ${downloadPath} -xr!${base}\\share\\doc -o${drive}:\\`) + await exec.exec('7z', ['x', downloadPath, `-xr!${base}\\share\\doc`, `-o${drive}:\\`], { silent: true }) const rubyPrefix = `${drive}:\\${base}` const [hostedRuby, msys2] = await linkMSYS2() @@ -62,10 +62,8 @@ async function linkMSYS2() { } export function setupPath(msys2, rubyPrefix) { - let path = process.env['PATH'].split(';') - - // Remove conflicting dev tools from PATH - path = path.filter(e => !e.match(/\b(Chocolatey|CMake|mingw64|OpenSSL|Strawberry)\b/)) + const originalPath = process.env['PATH'].split(';') + let path = originalPath.slice() // Remove default Ruby in PATH path = path.filter(e => !e.match(/\bRuby\b/)) @@ -78,6 +76,13 @@ export function setupPath(msys2, rubyPrefix) { // Add the downloaded Ruby in PATH path.unshift(`${rubyPrefix}\\bin`) + console.log("Entries removed from PATH to avoid conflicts with Ruby:") + for (const entry of originalPath) { + if (!path.includes(entry)) { + console.log(entry) + } + } + const newPath = path.join(';') core.exportVariable('PATH', newPath) }