From 29eefdda13b37cc7c2bfbe67d8b46f5a6a112271 Mon Sep 17 00:00:00 2001 From: Chris Bailey Date: Fri, 17 Apr 2020 21:27:51 -0800 Subject: [PATCH] Add support for setting a working directory --- action.yml | 4 ++++ dist/index.js | 1 + index.js | 1 + 3 files changed, 6 insertions(+) diff --git a/action.yml b/action.yml index a783692..8051e84 100644 --- a/action.yml +++ b/action.yml @@ -13,6 +13,10 @@ inputs: description: 'The version of Bundler to install. Either none, 1, 2, latest or Gemfile.lock. The default tries Gemfile.lock and otherwise uses latest.' required: false default: 'default' + working-directory: + description: 'The working directory to use for this path. Useful if files like .ruby-version are somewhere other than the root of your repository. Defaults to leaving it unchanged.' + required: false + default: '.' outputs: ruby-prefix: description: 'The prefix of the installed ruby' diff --git a/dist/index.js b/dist/index.js index 40b18d8..76369e6 100644 --- a/dist/index.js +++ b/dist/index.js @@ -965,6 +965,7 @@ const common = __webpack_require__(239) async function run() { try { + process.chdir(core.getInput('working-directory')) const platform = common.getVirtualEnvironmentName() const [engine, version] = parseRubyEngineAndVersion(core.getInput('ruby-version')) diff --git a/index.js b/index.js index a7dda15..61d941d 100644 --- a/index.js +++ b/index.js @@ -7,6 +7,7 @@ const common = require('./common') export async function run() { try { + process.chdir(core.getInput('working-directory')) const platform = common.getVirtualEnvironmentName() const [engine, version] = parseRubyEngineAndVersion(core.getInput('ruby-version'))