From d6a2c79bc7edafde46fb62efb39fdaac481d0ed0 Mon Sep 17 00:00:00 2001 From: Riley Martinez-Lynch Date: Fri, 8 Nov 2019 04:28:35 -0500 Subject: [PATCH] Add PR number to output when triggered by push --- README.md | 4 ++++ src/main.js | 1 + 2 files changed, 5 insertions(+) diff --git a/README.md b/README.md index 1a359d22..67a4078e 100644 --- a/README.md +++ b/README.md @@ -73,6 +73,10 @@ jobs: auto-merge: true # If `true`, will try to automatically merge the pull requests. ``` +### Output +When triggered by a push event, the pull request number which is created or found to +already exist is stored in the `pull-request` output variable. + ### Auto update You can use (at your own risk) the `release` branch instead of the specific version tag. Never user `master`, since the distribution file does not exist in this branch and the action will always fail. diff --git a/src/main.js b/src/main.js index 8b7265ec..5ec016c6 100644 --- a/src/main.js +++ b/src/main.js @@ -133,6 +133,7 @@ async function push() { core.info(`Label ${label} added to #${pull_number}.`); core.debug(JSON.stringify(labelsResponse.data)); } + core.setOutput("pull-request", pull_number.toString()); if (auto_merge) { await merge(pull_number); }