From 6ed1bbd1bbc85c127dfdb9379b932591f867b2e5 Mon Sep 17 00:00:00 2001 From: Michael Varrieur Date: Wed, 13 Oct 2021 10:42:42 -0400 Subject: [PATCH 1/3] Change default to work with multiple events --- action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/action.yml b/action.yml index b5962aa..e47faea 100644 --- a/action.yml +++ b/action.yml @@ -12,8 +12,8 @@ inputs: default: 'open' sha: required: false - description: Sha to get PR for. Defaults to current sha. - default: ${{ github.sha }} + description: SHA to get PR for. Defaults to current pull request SHA or current SHA. + default: ${{ github.event.pull_request.head.sha || github.sha }} outputs: pr: description: The PR if one was found. (e.g. '345' for #345) [Deprecated: Please use number instead] From fe5faa6f64ee4cb534df25a1157bdeef549a454f Mon Sep 17 00:00:00 2001 From: Michael Varrieur Date: Mon, 18 Oct 2021 11:40:05 -0400 Subject: [PATCH 2/3] Add logging output --- main.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/main.js b/main.js index 41529b2..9dd7d0f 100644 --- a/main.js +++ b/main.js @@ -17,9 +17,13 @@ async function main() { const prs = result.data.filter((el) => state === 'all' || el.state === state); const pr = prs[0]; + core.info(`Setting output: pr: ${(pr && pr.number) || ''}`); core.setOutput('pr', (pr && pr.number) || ''); + core.info(`Setting output: number: ${(pr && pr.number) || ''}`); core.setOutput('number', (pr && pr.number) || ''); + core.info(`Setting output: title: ${(pr && pr.title) || ''}`); core.setOutput('title', (pr && pr.title) || ''); + core.info(`Setting output: body: ${(pr && pr.body) || ''}`); core.setOutput('body', (pr && pr.body) || ''); } From a5dd3a90e02feb20d5250f1fb75427f3e3ca6948 Mon Sep 17 00:00:00 2001 From: Michael Varrieur Date: Mon, 18 Oct 2021 12:02:54 -0400 Subject: [PATCH 3/3] Remove body logging --- main.js | 1 - 1 file changed, 1 deletion(-) diff --git a/main.js b/main.js index 9dd7d0f..ea332f2 100644 --- a/main.js +++ b/main.js @@ -23,7 +23,6 @@ async function main() { core.setOutput('number', (pr && pr.number) || ''); core.info(`Setting output: title: ${(pr && pr.title) || ''}`); core.setOutput('title', (pr && pr.title) || ''); - core.info(`Setting output: body: ${(pr && pr.body) || ''}`); core.setOutput('body', (pr && pr.body) || ''); }