Skip to content

Commit

Permalink
refactor(notify): code base
Browse files Browse the repository at this point in the history
  • Loading branch information
Airkro committed Jan 8, 2024
1 parent 23a7113 commit db17b4c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion packages/notify/lib/utils.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,10 @@ function getlog(from, to) {

function getLogs() {
try {
if (!GIT_PREVIOUS_COMMIT) {
throw new Error('GIT_PREVIOUS_COMMIT is null');
}

return getlog(GIT_PREVIOUS_COMMIT, GIT_COMMIT);
} catch (error) {
console.error(error);
Expand All @@ -158,7 +162,7 @@ const headerPattern = /^(\w*)(?:\((\S*)\))?:\s?(.*)$/;

function getCommits() {
const io =
GIT_COMMIT && GIT_COMMIT === GIT_PREVIOUS_COMMIT
!GIT_PREVIOUS_COMMIT || (GIT_COMMIT && GIT_COMMIT === GIT_PREVIOUS_COMMIT)
? []
: sortBy(
Object.entries(
Expand Down Expand Up @@ -465,6 +469,7 @@ export function createContent({
{
type: 'link',
url:
!GIT_PREVIOUS_COMMIT ||
GIT_COMMIT === GIT_PREVIOUS_COMMIT
? `${DEPOT_URL}/git/commit/${GIT_COMMIT}`
: `${DEPOT_URL}/git/compare/${short(
Expand All @@ -474,6 +479,7 @@ export function createContent({
{
type: 'text',
value:
!GIT_PREVIOUS_COMMIT ||
GIT_COMMIT === GIT_PREVIOUS_COMMIT
? GIT_COMMIT_SHORT
: `${short(
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.3.0",
"version": "0.3.1",
"description": "Send releases notifications",
"license": "MIT",
"author": {
Expand Down

0 comments on commit db17b4c

Please sign in to comment.