diff --git a/lib/main.js b/lib/main.js index 7f1219a3..7a7a943d 100644 --- a/lib/main.js +++ b/lib/main.js @@ -123,8 +123,10 @@ function run() { process.chdir(workingDirectory); } for (const script of scripts) { - yield exec.exec(`sh -c \\"${script}"`); - } + // use array form to avoid various quote escaping problems + // caused by exec(`sh -c "${script}"`) + yield exec.exec('sh', ['-c', script]); + } } catch (error) { core.setFailed(error.message); diff --git a/src/main.ts b/src/main.ts index c671dd6c..de27fecf 100644 --- a/src/main.ts +++ b/src/main.ts @@ -111,7 +111,9 @@ async function run() { process.chdir(workingDirectory); } for (const script of scripts) { - await exec.exec(`sh -c \\"${script}"`); + // use array form to avoid various quote escaping problems + // caused by exec(`sh -c "${script}"`) + await exec.exec('sh', ['-c', script]); } } catch (error) { core.setFailed(error.message);