From 605400761d446e285590d4a54b073a10aae04f94 Mon Sep 17 00:00:00 2001 From: phips28 Date: Mon, 13 Jan 2020 15:04:50 +0100 Subject: [PATCH] custom PACKAGEJSON_DIR --- index.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/index.js b/index.js index 2fb914f..00dd9ab 100644 --- a/index.js +++ b/index.js @@ -1,6 +1,11 @@ const { Toolkit } = require('actions-toolkit') const { execSync } = require('child_process') +// Change working directory if user defined PACKAGEJSON_DIR +if (process.env.PACKAGEJSON_DIR) { + process.chdir(`${process.env.GITHUB_WORKSPACE}/${process.env.PACKAGEJSON_DIR}`) +} + // Run your GitHub Action! Toolkit.run(async tools => { const pkg = tools.getPackageJSON()