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
|
//Pushed commits
|
||||||
case "PushEvent": {
|
case "PushEvent": {
|
||||||
let {size, commits, ref} = payload
|
let {size, commits, ref} = payload
|
||||||
if (commits[commits.length - 1].message.startsWith("Merge branch "))
|
if (commits.slice(-1).pop()?.message.startsWith("Merge branch "))
|
||||||
commits = [commits[commits.length - 1]]
|
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}))}
|
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
|
//Released
|
||||||
|
|||||||
Reference in New Issue
Block a user