File tree 1 file changed +8
-2
lines changed
1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -35,7 +35,12 @@ const run = async () => {
35
35
inlineScript = ` set -e >&2; echo '${ START_SCRIPT_EXECUTION_MARKER } ' >&2; ${ inlineScript } ` ;
36
36
scriptFileName = await createScriptFile ( inlineScript ) ;
37
37
let startCommand : string = ` ${ BASH_ARG } ${ CONTAINER_TEMP_DIRECTORY } /${ scriptFileName } ` ;
38
-
38
+ let gitHubEnvironmentVariables = '' ;
39
+ for ( let key in process . env ) {
40
+ if ( key . toUpperCase ( ) . startsWith ( "GITHUB_" ) && key . toUpperCase ( ) !== 'GITHUB_WORKSPACE' && process . env [ key ] ) {
41
+ gitHubEnvironmentVariables += ` -e ${ key } =${ process . env [ key ] } ` ;
42
+ }
43
+ }
39
44
/*
40
45
For the docker run command, we are doing the following
41
46
- Set the working directory for docker continer
@@ -45,7 +50,8 @@ const run = async () => {
45
50
*/
46
51
let command : string = `run --workdir ${ CONTAINER_WORKSPACE } -v ${ process . env . GITHUB_WORKSPACE } :${ CONTAINER_WORKSPACE } ` ;
47
52
command += ` -v ${ process . env . HOME } /.azure:/root/.azure -v ${ TEMP_DIRECTORY } :${ CONTAINER_TEMP_DIRECTORY } ` ;
48
- command += `-e GITHUB_WORKSPACE=${ CONTAINER_WORKSPACE } -e GITHUB_SHA=${ process . env . GITHUB_SHA } ` ;
53
+ command += ` ${ gitHubEnvironmentVariables } ` ;
54
+ command += `-e GITHUB_WORKSPACE=${ CONTAINER_WORKSPACE } ` ;
49
55
command += `--name ${ CONTAINER_NAME } ` ;
50
56
command += ` mcr.microsoft.com/azure-cli:${ azcliversion } ${ startCommand } ` ;
51
57
console . log ( `${ START_SCRIPT_EXECUTION_MARKER } ${ azcliversion } ` ) ;
You can’t perform that action at this time.
0 commit comments