Do not serialize custom job parameter

pull/461/head
Frostebite 2022-09-27 23:05:40 +01:00
parent 818ce19fd8
commit cf95b5e11d
4 changed files with 24 additions and 10 deletions

5
dist/index.js vendored
View File

@ -3656,7 +3656,7 @@ class LocalDockerCloudRunner {
fs_1.writeFileSync(`${workspace}/${entrypointFilePath}`, commands, { fs_1.writeFileSync(`${workspace}/${entrypointFilePath}`, commands, {
flag: 'w', flag: 'w',
}); });
yield docker_1.default.run(image, Object.assign({ workspace, actionFolder }, this.buildParameters), false, entrypointFilePath, content, { yield docker_1.default.run(image, Object.assign({ workspace, actionFolder }, this.buildParameters), false, `${workspace}/${entrypointFilePath}`, content, {
listeners: { listeners: {
stdout: (data) => { stdout: (data) => {
myOutput += data.toString(); myOutput += data.toString();
@ -4794,6 +4794,9 @@ class TaskParameterSerializer {
// buildParameters[element] = base64.decode(buildParameters[element]); // buildParameters[element] = base64.decode(buildParameters[element]);
} }
} }
if (JSON.stringify(buildParameters) === JSON.stringify({})) {
throw new Error(`Build parameters from environment are empty`);
}
return buildParameters; return buildParameters;
} }
static readInput() { static readInput() {

2
dist/index.js.map vendored

File diff suppressed because one or more lines are too long

View File

@ -89,7 +89,13 @@ class LocalDockerCloudRunner implements ProviderInterface {
flag: 'w', flag: 'w',
}); });
await Docker.run(image, { workspace, actionFolder, ...this.buildParameters }, false, entrypointFilePath, content, { await Docker.run(
image,
{ workspace, actionFolder, ...this.buildParameters },
false,
`${workspace}/${entrypointFilePath}`,
content,
{
listeners: { listeners: {
stdout: (data: Buffer) => { stdout: (data: Buffer) => {
myOutput += data.toString(); myOutput += data.toString();
@ -98,7 +104,8 @@ class LocalDockerCloudRunner implements ProviderInterface {
myOutput += `[LOCAL-DOCKER-ERROR]${data.toString()}`; myOutput += `[LOCAL-DOCKER-ERROR]${data.toString()}`;
}, },
}, },
}); },
);
return myOutput; return myOutput;
} }

View File

@ -96,6 +96,10 @@ export class TaskParameterSerializer {
} }
} }
if (JSON.stringify(buildParameters) === JSON.stringify({})) {
throw new Error(`Build parameters from environment are empty`);
}
return buildParameters; return buildParameters;
} }