allow for input or environment

This commit is contained in:
Daniel Quackenbush 2022-11-03 10:29:47 -04:00
parent 04b79be048
commit 1568b67ba5
No known key found for this signature in database
GPG Key ID: D910A0D0AD6A46A9
1 changed files with 4 additions and 1 deletions

View File

@ -5,7 +5,10 @@ const { EOL } = require('os');
const path = require('path');
// Change working directory if user defined PACKAGEJSON_DIR
if (process.env.INPUT_PACKAGEJSON_DIR) {
if (process.env.PACKAGEJSON_DIR) {
process.env.GITHUB_WORKSPACE = `${process.env.GITHUB_WORKSPACE}/${process.env.PACKAGEJSON_DIR}`;
process.chdir(process.env.GITHUB_WORKSPACE);
} else if (process.env.INPUT_PACKAGEJSON_DIR) {
process.env.GITHUB_WORKSPACE = `${process.env.GITHUB_WORKSPACE}/${process.env.INPUT_PACKAGEJSON_DIR}`;
process.chdir(process.env.GITHUB_WORKSPACE);
}