From 45b8efceec1c51c856c167dba9a5c7a9eebd1f76 Mon Sep 17 00:00:00 2001 From: Eric Date: Thu, 21 Dec 2023 18:35:12 +0800 Subject: [PATCH] chore(notify): debug --- .github/workflows/bring-it.yaml | 4 ++-- packages/notify/lib/utils.mjs | 20 +++++++++++++++++--- packages/notify/package.json | 2 +- 3 files changed, 20 insertions(+), 6 deletions(-) diff --git a/.github/workflows/bring-it.yaml b/.github/workflows/bring-it.yaml index 43fff61..c18c9e3 100644 --- a/.github/workflows/bring-it.yaml +++ b/.github/workflows/bring-it.yaml @@ -11,8 +11,8 @@ jobs: strategy: matrix: os: - - macos-latest - - windows-latest + # - macos-latest + # - windows-latest - ubuntu-latest node: - lts/* diff --git a/packages/notify/lib/utils.mjs b/packages/notify/lib/utils.mjs index b9e4167..99e6ed4 100644 --- a/packages/notify/lib/utils.mjs +++ b/packages/notify/lib/utils.mjs @@ -127,14 +127,28 @@ function getlog(since, until) { function getLogs() { try { return getlog(GIT_PREVIOUS_COMMIT, GIT_COMMIT); - } catch { - return getlog('HEAD~5', 'HEAD'); + } catch (error) { + console.error(error); + + try { + return getlog('HEAD~5', 'HEAD'); + } catch (error_) { + console.error(error_); + + try { + return getlog('HEAD~1', 'HEAD'); + } catch (error__) { + console.error(error__); + + return []; + } + } } } function getCommits() { const io = - GIT_COMMIT === GIT_PREVIOUS_COMMIT + GIT_COMMIT && GIT_COMMIT === GIT_PREVIOUS_COMMIT ? [] : sortBy( Object.entries( diff --git a/packages/notify/package.json b/packages/notify/package.json index 479b9bd..741eb3a 100644 --- a/packages/notify/package.json +++ b/packages/notify/package.json @@ -1,6 +1,6 @@ { "name": "@bring-it/notify", - "version": "0.2.3", + "version": "0.2.4", "description": "Send releases notifications", "license": "MIT", "author": {