diff --git a/action.yml b/action.yml index d0af95fbe..1504ba546 100644 --- a/action.yml +++ b/action.yml @@ -52,6 +52,9 @@ inputs: description: "Do not perform tagging, just calculate next version and changelog, then exit." required: false default: "false" + repo_path: + description: "Path relative to $GITHUB_WORKSPACE that contains the cloned repository." + required: false runs: using: "node12" diff --git a/src/action.ts b/src/action.ts index 3c31efa01..711fec983 100644 --- a/src/action.ts +++ b/src/action.ts @@ -26,12 +26,23 @@ export default async function main() { const dryRun = core.getInput('dry_run'); const customReleaseRules = core.getInput('custom_release_rules'); const shouldFetchAllTags = core.getInput('fetch_all_tags'); + const repoPath = core.getInput('repo_path'); let mappedReleaseRules; if (customReleaseRules) { mappedReleaseRules = mapCustomReleaseRules(customReleaseRules); } + if (repoPath) { + try { + const originDirectory = process.cwd(); + process.chdir(repoPath); + console.log('Changed directory from ' + originDirectory + ' to ' + process.cwd()); + } catch (err) { + console.log('Error encountered when changing directory: ' + err); + } + } + const { GITHUB_REF, GITHUB_SHA } = process.env; if (!GITHUB_REF) {