mirror of
https://github.com/docker/setup-docker-action.git
synced 2025-12-31 01:21:35 +01:00
add runtime-basedir input
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
This commit is contained in:
@@ -11,6 +11,7 @@ export interface Inputs {
|
||||
context: string;
|
||||
setHost: boolean;
|
||||
rootless: boolean;
|
||||
runtimeBasedir?: string;
|
||||
}
|
||||
|
||||
export function getInputs(): Inputs {
|
||||
@@ -27,7 +28,8 @@ export function getInputs(): Inputs {
|
||||
tcpPort: Util.getInputNumber('tcp-port'),
|
||||
context: core.getInput('context'),
|
||||
setHost: core.getBooleanInput('set-host'),
|
||||
rootless: core.getBooleanInput('rootless')
|
||||
rootless: core.getBooleanInput('rootless'),
|
||||
runtimeBasedir: core.getInput('runtime-basedir')
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -18,7 +18,8 @@ actionsToolkit.run(
|
||||
// main
|
||||
async () => {
|
||||
const input: context.Inputs = context.getInputs();
|
||||
const runDir = path.join(os.homedir(), `setup-docker-action-${crypto.randomUUID().slice(0, 8)}`);
|
||||
const runBasedir = input.runtimeBasedir || path.join(os.homedir(), `setup-docker-action`);
|
||||
const runDir = path.join(runBasedir, `run-${crypto.randomUUID().slice(0, 8)}`);
|
||||
|
||||
if (input.context == 'default') {
|
||||
throw new Error(`'default' context cannot be used.`);
|
||||
|
||||
Reference in New Issue
Block a user