Fix activity plugin when 0 commits are pushed
This commit is contained in:
@@ -121,8 +121,8 @@ export default async function({login, data, rest, q, account, imports}, {enabled
|
||||
//Pushed commits
|
||||
case "PushEvent": {
|
||||
let {size, commits, ref} = payload
|
||||
if (commits[commits.length - 1].message.startsWith("Merge branch "))
|
||||
commits = [commits[commits.length - 1]]
|
||||
if (commits.slice(-1).pop()?.message.startsWith("Merge branch "))
|
||||
commits = commits.slice(-1)
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user