From e2b6759fc852472ae85439f2a1c3ff0bc9a438fe Mon Sep 17 00:00:00 2001 From: James Netherton Date: Wed, 8 Apr 2020 17:34:59 +0100 Subject: [PATCH] Add output variable for pull request URL. Fixes #8. (#20) --- action.yml | 3 +++ entrypoint.sh | 9 ++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/action.yml b/action.yml index 720063d..ded2d01 100644 --- a/action.yml +++ b/action.yml @@ -36,6 +36,9 @@ inputs: github_token: description: GitHub token secret required: true +outputs: + pr_url: + description: 'Pull request URL' runs: using: 'docker' image: 'Dockerfile' diff --git a/entrypoint.sh b/entrypoint.sh index a6dd128..7b492a9 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -77,4 +77,11 @@ COMMAND="hub pull-request \ || true" echo "$COMMAND" -sh -c "$COMMAND" + +PR_URL=$(sh -c "$COMMAND") +if [[ "$?" != "0" ]]; then + exit 1 +fi + +echo ${PR_URL} +echo "::set-output name=pr_url::${PR_URL}"