Skip to content

Commit

Permalink
Properly sort commits chronologically
Browse files Browse the repository at this point in the history
The events are sorted from the newest, but the commits on the payload are sorted from the oldest.
  • Loading branch information
Hans5958 committed Mar 31, 2021
1 parent bb74753 commit 9d919bc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/print.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ module.exports = async () => {
break;
case "PushEvent":
const branch = payload.ref.slice(11)
payload.commits.forEach(commit => {
payload.commits.sort(() => 1).forEach(commit => {
if (commit.author.name === "Hans5958") {
const hash = commit.sha
commits.push(`[\`${hash.substr(0, 7)}\`](${repoLink}/commit/${hash}) ${commit['message'].split("\n")[0]} (${repoLinkMarkdown}, [${branch}](${repoLink}/tree/${branch}))`)
Expand Down

0 comments on commit 9d919bc

Please sign in to comment.