prevent command injection vulnerability

This commit is contained in:
volodymyrZotov
2022-08-15 13:32:42 +03:00
parent e1b37a5b1e
commit 5c5bbcbaf0
2 changed files with 6 additions and 12 deletions

View File

@@ -7,14 +7,11 @@ async function run(): Promise<void> {
const parentDir = path.resolve(__dirname, '..');
// Get action inputs
const unsetPrevious = core.getInput('unset-previous');
const exportEnv = core.getInput('export-env');
process.env.INPUT_UNSET_PREVIOUS = core.getInput('unset-previous');
process.env.INPUT_EXPORT_ENV = core.getInput('export-env');
// Execute bash script
await exec.exec(`sh -c "` +
`INPUT_UNSET_PREVIOUS=` + unsetPrevious + ` ` +
`INPUT_EXPORT_ENV=` + exportEnv + ` ` +
parentDir + `/entrypoint.sh"`);
await exec.exec(`sh -c "` + parentDir + `/entrypoint.sh"`);
} catch (error: any) {
core.setFailed(error.message);