From ede62a57b9f28f01a41ea807f029a5409734c92a Mon Sep 17 00:00:00 2001 From: Daniel Nagy <1622446+daniel-nagy@users.noreply.github.com> Date: Wed, 13 Apr 2022 17:52:17 -0500 Subject: [PATCH] add working_directory input to install action --- install/action.yml | 4 ++++ install/main.js | 4 ++++ lib/install/index.ts | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/install/action.yml b/install/action.yml index e2f225d..79dc565 100644 --- a/install/action.yml +++ b/install/action.yml @@ -18,3 +18,7 @@ inputs: description: asdf branch to clone required: false default: master + working_directory: + description: + The directory to run asdf install in, defaults to the workspace root. + required: false diff --git a/install/main.js b/install/main.js index 11004f0..3eb1fe2 100644 --- a/install/main.js +++ b/install/main.js @@ -1301,6 +1301,10 @@ async function pluginsAdd() { // lib/install/index.ts async function toolsInstall() { + const workingDirectory = core3.getInput("working_directory", { + required: false + }); + workingDirectory && process.chdir(workingDirectory); await pluginsAdd(); const before = core3.getInput("before_install", {required: false}); if (before) { diff --git a/lib/install/index.ts b/lib/install/index.ts index 859ec1b..de020a9 100644 --- a/lib/install/index.ts +++ b/lib/install/index.ts @@ -3,6 +3,10 @@ import * as exec from "@actions/exec"; import { pluginsAdd } from "../plugins-add"; export async function toolsInstall(): Promise { + const workingDirectory = core.getInput("working_directory", { + required: false, + }); + workingDirectory && process.chdir(workingDirectory); await pluginsAdd(); const before = core.getInput("before_install", { required: false });