From 8f88041d212b25dac1f596fae86c4f474d0052c6 Mon Sep 17 00:00:00 2001 From: Kenneth Garza Date: Tue, 29 Jun 2021 13:47:27 -0400 Subject: [PATCH] ENBL-4519 adding output variable to set the repo path --- action.yml | 3 +++ dist/index.js | 1 + src/input-helper.ts | 2 ++ 3 files changed, 6 insertions(+) diff --git a/action.yml b/action.yml index e03e091..66f2b66 100644 --- a/action.yml +++ b/action.yml @@ -71,6 +71,9 @@ inputs: When the `ssh-key` input is not provided, SSH URLs beginning with `git@github.com:` are converted to HTTPS. default: false +outputs: + WORKSPACE_DIR: + description: working directory for the project runs: using: node12 main: dist/index.js diff --git a/dist/index.js b/dist/index.js index ba1f178..9105cca 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1535,6 +1535,7 @@ function getInputs() { if (!allowParentPath && !(result.repositoryPath + path.sep).startsWith(githubWorkspacePath + path.sep)) { throw new Error(`Repository path '${result.repositoryPath}' is not under '${githubWorkspacePath}'`); } + core.setOutput('WORKSPACE_DIR', result.repositoryPath); // Workflow repository? const isWorkflowRepository = qualifiedRepository.toUpperCase() === `${github.context.repo.owner}/${github.context.repo.repo}`.toUpperCase(); diff --git a/src/input-helper.ts b/src/input-helper.ts index cbafa76..7d9a7b7 100644 --- a/src/input-helper.ts +++ b/src/input-helper.ts @@ -51,6 +51,8 @@ export function getInputs(): IGitSourceSettings { ) } + core.setOutput('WORKSPACE_DIR', result.repositoryPath) + // Workflow repository? const isWorkflowRepository = qualifiedRepository.toUpperCase() ===