Skip to content

Commit

Permalink
include title rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
luigibertaco committed Jul 22, 2021
1 parent 42b58a9 commit b27702e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7069,12 +7069,12 @@ async function run(){

// Get the JSON webhook payload for the event that triggered the workflow
const payload = JSON.stringify(github.context.payload, undefined, 2)
core.info(`The event payload: ${payload}`);
//core.info(`The event payload: ${payload}`);

// Show PR details
const pr = github.context.payload.pull_request;
core.info(`Pull request body: ${pr.body}`);
core.info(`Pull request head ref: ${pr.head.ref}`);
core.info(`Pull request title: ${pr.title}`);

// update PR body
const octokit = github.getOctokit(ghToken);
Expand All @@ -7085,6 +7085,7 @@ async function run(){
body: mustache.render(pr.body, pr),
title: mustache.render(pr.title, pr),
}
core.info(`update request: ${request}`);
const response = await octokit.rest.pulls.update(request);

core.info(`Response: ${response.status}`);
Expand Down
5 changes: 3 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ async function run(){

// Get the JSON webhook payload for the event that triggered the workflow
const payload = JSON.stringify(github.context.payload, undefined, 2)
core.info(`The event payload: ${payload}`);
//core.info(`The event payload: ${payload}`);

// Show PR details
const pr = github.context.payload.pull_request;
core.info(`Pull request body: ${pr.body}`);
core.info(`Pull request head ref: ${pr.head.ref}`);
core.info(`Pull request title: ${pr.title}`);

// update PR body
const octokit = github.getOctokit(ghToken);
Expand All @@ -26,6 +26,7 @@ async function run(){
body: mustache.render(pr.body, pr),
title: mustache.render(pr.title, pr),
}
core.info(`update request: ${request}`);
const response = await octokit.rest.pulls.update(request);

core.info(`Response: ${response.status}`);
Expand Down

0 comments on commit b27702e

Please sign in to comment.