mirror of
https://github.com/docker/setup-docker-action.git
synced 2025-06-12 14:47:12 +02:00
context input
This commit is contained in:
@ -3,11 +3,13 @@ import * as core from '@actions/core';
|
||||
export interface Inputs {
|
||||
version: string;
|
||||
channel: string;
|
||||
context: string;
|
||||
}
|
||||
|
||||
export function getInputs(): Inputs {
|
||||
return {
|
||||
version: core.getInput('version'),
|
||||
channel: core.getInput('channel')
|
||||
channel: core.getInput('channel'),
|
||||
context: core.getInput('context')
|
||||
};
|
||||
}
|
||||
|
@ -15,10 +15,15 @@ actionsToolkit.run(
|
||||
const input: context.Inputs = context.getInputs();
|
||||
const runDir = path.join(os.homedir(), `setup-docker-action-${uuid.v4()}`);
|
||||
|
||||
if (input.context == 'default') {
|
||||
throw new Error(`'default' context cannot be used.`);
|
||||
}
|
||||
|
||||
const install = new Install({
|
||||
runDir: runDir,
|
||||
version: input.version,
|
||||
channel: input.channel
|
||||
version: input.version || 'latest',
|
||||
channel: input.channel || 'stable',
|
||||
contextName: input.context || 'setup-docker-action'
|
||||
});
|
||||
let toolDir;
|
||||
if (!(await Docker.isAvailable()) || input.version) {
|
||||
|
Reference in New Issue
Block a user