Reverse commits listed in a recent activity entry (#244)

This commit is contained in:
Nixinova
2021-04-20 08:20:29 +12:00
committed by GitHub
parent e688fe0061
commit e8e715528b

View File

@@ -109,7 +109,7 @@
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}))}
return {type:"push", actor, timestamp, repo, size, branch:ref.match(/refs.heads.(?<branch>.*)/)?.groups?.branch ?? null, commits:commits.reverse().map(({sha, message}) => ({sha:sha.substring(0, 7), message}))}
}
//Released
case "ReleaseEvent":{