From 721815dc3cdbe25431c3db9228873ffaa0a3ac4d Mon Sep 17 00:00:00 2001 From: Michael Shick Date: Mon, 25 Nov 2019 13:22:39 -0500 Subject: [PATCH] trigger --- index.js | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/index.js b/index.js index eee2d4a..4b74f91 100644 --- a/index.js +++ b/index.js @@ -9,19 +9,20 @@ async function run() { core.debug(`Input message: ${msg}`); const octokit = new github.GitHub(repoToken); - const context = github.context; + const { + payload: { + pull_request: pullRequestPayload + // respository: repositoryPayload + } + } = github.context; - console.log(context); + const { data: pullRequest } = await octokit.pulls.get({ + owner: "mshick", + repo: "add-pr-comment", + pull_number: pullRequestPayload.number + }); - core.debug(context); - - // const { data: pullRequest } = await octokit.pulls.get({ - // owner: "octokit", - // repo: "rest.js", - // pull_number: 123, - // }); - - // console.log(pullRequest); + console.log(pullRequest); } catch (error) { core.setFailed(error.message); }