Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: branch is undefined #33

Merged
merged 22 commits into from
Apr 4, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
pull
  • Loading branch information
amondnet committed Apr 4, 2020
commit 0725211c2129b03e2166cb3cfc45aeb34d40d609
33 changes: 22 additions & 11 deletions index.js
Original file line number Diff line number Diff line change
@@ -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() {
@@ -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",
[
@@ -107,10 +118,10 @@ async function nowDeploy() {
"-m",
`githubCommitMessage=${commit}`,
"-m",
`githubCommitRef=${context.ref}`
],
options
);
`githubCommitRef=${commitRef}`
],
options
);

return myOutput;
}