Condense merge commits (#242)

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

View File

@@ -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
@@ -141,4 +143,3 @@
throw {error:{message:"An error occured", instance:error}}
}
}