Skip to content

Commit

Permalink
fix(notify): bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Airkro committed Dec 21, 2023
1 parent 7371a77 commit 99fdc62
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 14 deletions.
36 changes: 23 additions & 13 deletions packages/notify/lib/utils.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -115,26 +115,36 @@ const configs = {
},
};

function getlog(since, until) {
return gitlog({
repo: '.',
since,
until,
fields: ['hash', 'abbrevHash', 'subject'],
});
}

function getLogs() {
try {
return getlog(GIT_PREVIOUS_COMMIT, GIT_COMMIT);
} catch {
return getlog('HEAD~5', 'HEAD');
}
}

function getCommits() {
const io =
GIT_COMMIT === GIT_PREVIOUS_COMMIT
? []
: sortBy(
Object.entries(
groupBy(
gitlog
.default({
repo: '.',
since: GIT_PREVIOUS_COMMIT,
until: GIT_COMMIT,
fields: ['hash', 'abbrevHash', 'subject'],
})
.map(({ abbrevHash, hash, subject }) => ({
hash,
abbrevHash,
message: sync(subject),
subject,
})),
getLogs().map(({ abbrevHash, hash, subject }) => ({
hash,
abbrevHash,
message: sync(subject),
subject,
})),
({ message }) => message.type,
),
),
Expand Down
2 changes: 1 addition & 1 deletion packages/notify/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@bring-it/notify",
"version": "0.2.1",
"version": "0.2.3",
"description": "Send releases notifications",
"license": "MIT",
"author": {
Expand Down

0 comments on commit 99fdc62

Please sign in to comment.