mirror of
https://github.com/actions/runner-container-hooks.git
synced 2025-12-14 16:46:43 +00:00
Merge branch 'nikola-jokic/docker-env' into nikola-jokic/computed-build-directory
This commit is contained in:
@@ -44,13 +44,9 @@ export async function createContainer(
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (args.environmentVariables) {
|
if (args.environmentVariables) {
|
||||||
for (const [key, value] of Object.entries(args.environmentVariables)) {
|
for (const [key] of Object.entries(args.environmentVariables)) {
|
||||||
dockerArgs.push('-e')
|
dockerArgs.push('-e')
|
||||||
if (!value) {
|
dockerArgs.push(`"${key}"`)
|
||||||
dockerArgs.push(`"${key}"`)
|
|
||||||
} else {
|
|
||||||
dockerArgs.push(`"${key}=${value}"`)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -344,13 +340,9 @@ export async function containerExecStep(
|
|||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
const dockerArgs: string[] = ['exec', '-i']
|
const dockerArgs: string[] = ['exec', '-i']
|
||||||
dockerArgs.push(`--workdir=${args.workingDirectory}`)
|
dockerArgs.push(`--workdir=${args.workingDirectory}`)
|
||||||
for (const [key, value] of Object.entries(args['environmentVariables'])) {
|
for (const [key] of Object.entries(args['environmentVariables'])) {
|
||||||
dockerArgs.push('-e')
|
dockerArgs.push('-e')
|
||||||
if (!value) {
|
dockerArgs.push(`"${key}"`)
|
||||||
dockerArgs.push(`"${key}"`)
|
|
||||||
} else {
|
|
||||||
dockerArgs.push(`"${key}=${value}"`)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Todo figure out prepend path and update it here
|
// Todo figure out prepend path and update it here
|
||||||
|
|||||||
Reference in New Issue
Block a user