Skip to content

Commit

Permalink
chore(notify): debug
Browse files Browse the repository at this point in the history
  • Loading branch information
Airkro committed Dec 21, 2023
1 parent 99fdc62 commit da51261
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 25 deletions.
40 changes: 20 additions & 20 deletions .github/workflows/bring-it.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
27 changes: 23 additions & 4 deletions packages/notify/lib/utils.mjs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { execSync } from 'node:child_process';
import { createRequire } from 'node:module';

import { sync } from 'conventional-commits-parser';
Expand Down Expand Up @@ -116,8 +117,12 @@ const configs = {
};

function getlog(since, until) {
console.log({ since, until });

execSync(`git log --pretty=oneline ${since}...${until}`);

return gitlog({
repo: '.',
repo: process.cwd(),
since,
until,
fields: ['hash', 'abbrevHash', 'subject'],
Expand All @@ -127,14 +132,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(
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.3",
"version": "0.2.6",
"description": "Send releases notifications",
"license": "MIT",
"author": {
Expand Down

0 comments on commit da51261

Please sign in to comment.