Skip to content

Commit

Permalink
Fix some context keys
Browse files Browse the repository at this point in the history
  • Loading branch information
romeovs committed Mar 5, 2020
1 parent 282c439 commit 348bd5d
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,18 @@ async function main() {
}

const lcov = await parse(raw)
console.log(JSON.stringify(context, null, 2))

const head = context.payload.pull_request.head.ref
const base = context.payload.pull_request.base.ref

const options = {
repository: context.github.repository,
commit: context.github.event.after,
prefix: context.github.workspace,
repository: context.payload.repository.full_name,
commit: context.payload.pull_request.head.sha,
prefix: `${process.env.GITHUB_WORKSPACE}/`,
}

const comment = fragment(
"Total Coverage: ",
`Coverage after merging ${b(head)} into ${b(base)}: `,
b(`${percentage(lcov).toFixed(2)}%`),
"\n\n",
details(summary("Coverage Report"), tabulate(lcov, options)),
Expand All @@ -36,7 +38,7 @@ async function main() {
await new GitHub(token).issues.createComment({
repo: context.repo.repo,
owner: context.repo.owner,
issue_number: context.gihub.event.pull_request.number,
issue_number: context.payload.pull_request.number,
body: comment,
})
}
Expand Down

0 comments on commit 348bd5d

Please sign in to comment.