diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1a985a4..4f9aa50 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1181,7 +1181,7 @@ jobs: environment-activation-unix: strategy: matrix: - os: [ubuntu-latest, macos-latest] + os: [ubuntu-latest, macos-latest, ubuntu-24.04-arm] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 diff --git a/dist/index.js b/dist/index.js index 579454f..6916e3e 100644 --- a/dist/index.js +++ b/dist/index.js @@ -80804,11 +80804,15 @@ var getNewPathComponents = (path17) => { if (!currentPath) { throw new Error("Unable to obtain current PATH from environment"); } - if (!path17.endsWith(currentPath)) { - throw new Error("Unable to handle environment activation which does not only append to PATH"); - } debug(`Found current path '${currentPath}'`); debug(`Got new path '${path17}'`); + if (!path17.endsWith(currentPath)) { + throw new Error( + `Unable to handle environment activation which does not only append to PATH. +Current PATH: '${currentPath}' +Activated PATH: '${path17}'` + ); + } const newPath = path17.slice(0, path17.length - currentPath.length); return newPath.split(osPath.delimiter).filter((p) => p.length > 0); }; diff --git a/src/activate.ts b/src/activate.ts index 4410d31..2803854 100644 --- a/src/activate.ts +++ b/src/activate.ts @@ -34,11 +34,13 @@ const getNewPathComponents = (path: string): string[] => { if (!currentPath) { throw new Error('Unable to obtain current PATH from environment') } - if (!path.endsWith(currentPath)) { - throw new Error('Unable to handle environment activation which does not only append to PATH') - } core.debug(`Found current path '${currentPath}'`) core.debug(`Got new path '${path}'`) + if (!path.endsWith(currentPath)) { + throw new Error( + `Unable to handle environment activation which does not only append to PATH.\nCurrent PATH: '${currentPath}'\nActivated PATH: '${path}'` + ) + } const newPath = path.slice(0, path.length - currentPath.length) return newPath.split(osPath.delimiter).filter((p) => p.length > 0) }