Skip to content

Commit

Permalink
Merge pull request #14 from mvarrieur/master
Browse files Browse the repository at this point in the history
Change default value to work with multiple events
  • Loading branch information
jwalton authored Oct 18, 2021
2 parents ca6fa39 + a5dd3a9 commit 465461f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
3 changes: 3 additions & 0 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,11 @@ 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.setOutput('body', (pr && pr.body) || '');
}
Expand Down

0 comments on commit 465461f

Please sign in to comment.