Skip to content

Commit

Permalink
fix(github): fix implementation for pr merge
Browse files Browse the repository at this point in the history
  • Loading branch information
shigma committed Sep 9, 2020
1 parent cf00713 commit ffc8a1e
Show file tree
Hide file tree
Showing 4 changed files with 523 additions and 5 deletions.
8 changes: 4 additions & 4 deletions packages/plugin-github/src/events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -204,12 +204,12 @@ export function addListeners(on: <T extends EventNames.All>(event: T, handler: E
].join('\n'), { link: html_url, reply: [comments_url] }]
})

on('pull_request.closed', ({ repository, pull_request }) => {
on('pull_request.closed', ({ repository, pull_request, sender }) => {
const { full_name } = repository
const { user, html_url, issue_url, comments_url, title, number } = pull_request
if (user.type === 'Bot') return
const { html_url, issue_url, comments_url, title, number, merged } = pull_request

return [`[GitHub] ${user.login} closed pull request ${full_name}#${number}\n${title}`, {
const type = merged ? 'merged' : 'closed'
return [`[GitHub] ${sender.login} ${type} pull request ${full_name}#${number}\n${title}`, {
link: html_url,
react: issue_url + '/reactions',
reply: [comments_url],
Expand Down
Loading

0 comments on commit ffc8a1e

Please sign in to comment.