Fix "merged" state in activity plugin (#218)

This commit is contained in:
Simon Lecoq
2021-04-09 12:09:12 +02:00
committed by GitHub
parent 08f9655f35
commit ff8734cd34
3 changed files with 4 additions and 4 deletions

View File

@@ -88,8 +88,8 @@
case "PullRequestEvent":{
if (!["opened", "closed"].includes(payload.action))
return null
const {action, pull_request:{user:{login:user}, title, number, additions:added, deletions:deleted, changed_files:changed}} = payload
return {type:"pr", actor, timestamp, repo, action, user, title, number, lines:{added, deleted}, files:{changed}}
const {action, pull_request:{user:{login:user}, title, number, additions:added, deletions:deleted, changed_files:changed, merged}} = payload
return {type:"pr", actor, timestamp, repo, action:(action === "closed")&&(merged) ? "merged" : action, user, title, number, lines:{added, deleted}, files:{changed}}
}
//Reviewed a pull request
case "PullRequestReviewEvent":{