Skip to content

Commit

Permalink
Condense merge commits (#242)
Browse files Browse the repository at this point in the history
  • Loading branch information
Nixinova committed Apr 19, 2021
1 parent 00ac310 commit e688fe0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions source/plugins/activity/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,9 @@
}
//Pushed commits
case "PushEvent":{
const {size, commits, ref} = payload
let {size, commits, ref} = payload
if (commits[commits.length-1].message.startsWith("Merge branch "))
commits = [commits[commits.length-1]]
return {type:"push", actor, timestamp, repo, size, branch:ref.match(/refs.heads.(?<branch>.*)/)?.groups?.branch ?? null, commits:commits.map(({sha, message}) => ({sha:sha.substring(0, 7), message}))}
}
//Released
Expand Down Expand Up @@ -141,4 +143,3 @@
throw {error:{message:"An error occured", instance:error}}
}
}

0 comments on commit e688fe0

Please sign in to comment.