fix
parent
38b7286a0d
commit
abb275c9fd
|
|
@ -4,6 +4,9 @@ on:
|
||||||
push: { branches: [main] }
|
push: { branches: [main] }
|
||||||
pull_request: {}
|
pull_request: {}
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
env:
|
env:
|
||||||
CODECOV_TOKEN: '2f2eb890-30e2-4724-83eb-7633832cf0de'
|
CODECOV_TOKEN: '2f2eb890-30e2-4724-83eb-7633832cf0de'
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -50,6 +50,7 @@
|
||||||
"nanoid": "^3.3.1",
|
"nanoid": "^3.3.1",
|
||||||
"reflect-metadata": "^0.1.13",
|
"reflect-metadata": "^0.1.13",
|
||||||
"semver": "^7.5.2",
|
"semver": "^7.5.2",
|
||||||
|
"shell-quote": "^1.8.3",
|
||||||
"ts-md5": "^1.3.1",
|
"ts-md5": "^1.3.1",
|
||||||
"unity-changeset": "^2.0.0",
|
"unity-changeset": "^2.0.0",
|
||||||
"uuid": "^9.0.0",
|
"uuid": "^9.0.0",
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@ import { ProviderInterface } from '../provider-interface';
|
||||||
import CloudRunnerSecret from '../../options/cloud-runner-secret';
|
import CloudRunnerSecret from '../../options/cloud-runner-secret';
|
||||||
import { ProviderResource } from '../provider-resource';
|
import { ProviderResource } from '../provider-resource';
|
||||||
import { ProviderWorkflow } from '../provider-workflow';
|
import { ProviderWorkflow } from '../provider-workflow';
|
||||||
|
import { quote } from 'shell-quote';
|
||||||
|
|
||||||
class LocalCloudRunner implements ProviderInterface {
|
class LocalCloudRunner implements ProviderInterface {
|
||||||
listResources(): Promise<ProviderResource[]> {
|
listResources(): Promise<ProviderResource[]> {
|
||||||
|
|
@ -69,12 +70,12 @@ class LocalCloudRunner implements ProviderInterface {
|
||||||
// On Windows, many built-in hooks use POSIX shell syntax. Execute via bash if available.
|
// On Windows, many built-in hooks use POSIX shell syntax. Execute via bash if available.
|
||||||
if (process.platform === 'win32') {
|
if (process.platform === 'win32') {
|
||||||
const inline = commands
|
const inline = commands
|
||||||
.replace(/"/g, '\\"')
|
|
||||||
.replace(/\r/g, '')
|
.replace(/\r/g, '')
|
||||||
.split('\n')
|
.split('\n')
|
||||||
.filter((x) => x.trim().length > 0)
|
.filter((x) => x.trim().length > 0)
|
||||||
.join(' ; ');
|
.join(' ; ');
|
||||||
const bashWrapped = `bash -lc "${inline}"`;
|
// Use shell-quote to properly escape the command string, preventing command injection
|
||||||
|
const bashWrapped = `bash -lc ${quote([inline])}`;
|
||||||
return await CloudRunnerSystem.Run(bashWrapped);
|
return await CloudRunnerSystem.Run(bashWrapped);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7016,6 +7016,11 @@ shebang-regex@^3.0.0:
|
||||||
resolved "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz"
|
resolved "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz"
|
||||||
integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==
|
integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==
|
||||||
|
|
||||||
|
shell-quote@^1.8.3:
|
||||||
|
version "1.8.3"
|
||||||
|
resolved "https://registry.yarnpkg.com/shell-quote/-/shell-quote-1.8.3.tgz#55e40ef33cf5c689902353a3d8cd1a6725f08b4b"
|
||||||
|
integrity sha512-ObmnIF4hXNg1BqhnHmgbDETF8dLPCggZWBjkQfhZpbszZnYur5DUljTcCHii5LC3J5E0yeO/1LIMyH+UvHQgyw==
|
||||||
|
|
||||||
shelljs@^0.8.2, shelljs@^0.8.5:
|
shelljs@^0.8.2, shelljs@^0.8.5:
|
||||||
version "0.8.5"
|
version "0.8.5"
|
||||||
resolved "https://registry.npmjs.org/shelljs/-/shelljs-0.8.5.tgz"
|
resolved "https://registry.npmjs.org/shelljs/-/shelljs-0.8.5.tgz"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue