Skip to content

Commit

Permalink
pull
Browse files Browse the repository at this point in the history
  • Loading branch information
amondnet committed Apr 4, 2020
1 parent d1ee573 commit 0725211
Showing 1 changed file with 22 additions and 11 deletions.
33 changes: 22 additions & 11 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,15 @@ async function run() {
} else {
core.info("comment : disabled");
}
const pull = await octokit.pulls.get({
...context.repo,
pull_number: context.payload.pull_request.number
})
core.info(pull)
core.info(`ref : ${context.payload.pull_request.html_url}`)
if ( octokit ) {
const pull = await octokit.pulls.get({
...context.repo, pull_number: context.payload.pull_request.number
});
if (pull) {
core.debug(JSON.stringify(pull));
core.debug(`ref : ${context.payload.pull_request.html_url}`);
}
}
}

async function setEnv() {
Expand Down Expand Up @@ -80,7 +83,15 @@ async function nowDeploy() {
if (workingDirectory) {
options.cwd = workingDirectory;
}

let commitRef = context.ref;
if (context.eventName === "pull_request") {
//commitRef = context.payload.pull_request.number;
//octokit.
}
let commitMessage = commit;
if ( context.eventName === "pull_request") {
//commitMessage =
}
await exec.exec(
"npx",
[
Expand All @@ -107,10 +118,10 @@ async function nowDeploy() {
"-m",
`githubCommitMessage=${commit}`,
"-m",
`githubCommitRef=${context.ref}`
],
options
);
`githubCommitRef=${commitRef}`
],
options
);

return myOutput;
}
Expand Down

0 comments on commit 0725211

Please sign in to comment.