diff --git a/.github/workflows/bring-it.yaml b/.github/workflows/bring-it.yaml index 43fff61..d6f9a7d 100644 --- a/.github/workflows/bring-it.yaml +++ b/.github/workflows/bring-it.yaml @@ -7,29 +7,29 @@ on: - master jobs: - test: - strategy: - matrix: - os: - - macos-latest - - windows-latest - - ubuntu-latest - node: - - lts/* - - lts/-1 - exclude: - - os: ubuntu-latest - node: lts/* + # test: + # strategy: + # matrix: + # os: + # - macos-latest + # - windows-latest + # - ubuntu-latest + # node: + # - lts/* + # - lts/-1 + # exclude: + # - os: ubuntu-latest + # node: lts/* - runs-on: ${{ matrix.os }} - steps: - - name: Run - uses: airkro/bring-it@actions - with: - node-version: ${{ matrix.node }} + # runs-on: ${{ matrix.os }} + # steps: + # - name: Run + # uses: airkro/bring-it@actions + # with: + # node-version: ${{ matrix.node }} publish: - needs: [test] + # needs: [test] runs-on: ubuntu-latest steps: - name: Run diff --git a/packages/notify/lib/utils.mjs b/packages/notify/lib/utils.mjs index b9e4167..5b7cff2 100644 --- a/packages/notify/lib/utils.mjs +++ b/packages/notify/lib/utils.mjs @@ -115,11 +115,12 @@ const configs = { }, }; -function getlog(since, until) { +function getlog(from, to) { + console.log({ from, to }); + return gitlog({ - repo: '.', - since, - until, + repo: process.cwd(), + branch: `${from}...${to}`, fields: ['hash', 'abbrevHash', 'subject'], }); } @@ -127,14 +128,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..1e9aaa6 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.7", "description": "Send releases notifications", "license": "MIT", "author": {