Skip to content

Commit

Permalink
PR Support
Browse files Browse the repository at this point in the history
  • Loading branch information
TheBurchLog committed Feb 22, 2021
1 parent de09237 commit 9bf72dd
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,16 @@ try {
const default_value = core.getInput('default-value');
const tag_position = core.getInput('tag-position');

const payload = JSON.stringify(github.context.payload, undefined, 2)
console.log(`The event payload: ${payload}`);


var issue_body = github.context.payload.issue.body;
if ('issue' in github.context.payload){
var issue_body = github.context.payload.issue.body;
}
else if ('pull_request' in github.context.payload){
var issue_body = github.context.payload.pull_request.body;
}
else{
core.exportVariable(env_variable, default_value);
return;
}
// Remove line breaks
issue_body = issue_body.replace(/(\r\n|\n|\r)/gm, " ");

Expand Down

0 comments on commit 9bf72dd

Please sign in to comment.