Add file to act command

Signed-off-by: Sanjula Ganepola <sanjulagane@gmail.com>
This commit is contained in:
Sanjula Ganepola
2024-11-22 17:31:09 -05:00
parent 9079f014c9
commit 5554557372
2 changed files with 18 additions and 7 deletions

View File

@@ -46,12 +46,15 @@ export enum Event {
}
export enum Option {
Input = '--input',
Workflows = '-W',
Job = '-j',
Platform = '-P',
Secret = '--secret',
SecretFile = '--secret-file',
Variable = '--var',
Workflows = '-W'
VariableFile = '--var-file',
Input = '--input',
InputFile = '--input-file'
}
export interface CommandArgs {
@@ -306,8 +309,11 @@ export class Act {
`set -o pipefail; ` +
`${Act.base} ${commandArgs.options}` +
(settings.secrets.length > 0 ? ` ${Option.Secret} ${settings.secrets.map(secret => secret.key).join(` ${Option.Secret} `)}` : ``) +
(settings.secretFiles.length > 0 ? ` ${Option.SecretFile} ${settings.secretFiles.map(secretFile => `"${secretFile.path}"`).join(` ${Option.SecretFile} `)}` : ``) +
(settings.variables.length > 0 ? ` ${Option.Variable} ${settings.variables.map(variable => (variable.value ? `${variable.key}=${variable.value}` : variable.key)).join(` ${Option.Variable} `)}` : ``) +
(settings.variableFiles.length > 0 ? ` ${Option.VariableFile} ${settings.variableFiles.map(variableFile => `"${variableFile.path}"`).join(` ${Option.VariableFile} `)}` : ``) +
(settings.inputs.length > 0 ? ` ${Option.Input} ${settings.inputs.map(input => `${input.key}=${input.value}`).join(` ${Option.Input} `)}` : ``) +
(settings.inputFiles.length > 0 ? ` ${Option.InputFile} ${settings.inputFiles.map(inputFile => `"${inputFile.path}"`).join(` ${Option.InputFile} `)}` : ``) +
(settings.runners.length > 0 ? ` ${Option.Platform} ${settings.runners.map(runner => `${runner.key}=${runner.value}`).join(` ${Option.Platform} `)}` : ``) +
` 2>&1 | tee "${logPath}"`;