diff --git a/src/git.ts b/src/git.ts index fdacc57..43de869 100644 --- a/src/git.ts +++ b/src/git.ts @@ -1,4 +1,4 @@ -// original content by: github.com/TriPSs/conventional-changelog-action/blob/master/src/helpers/git.js +// original content by: https://github.com/TriPSs/conventional-changelog-action/blob/master/src/helpers/git.js import * as core from '@actions/core'; import * as exec from '@actions/exec'; diff --git a/src/helpers.ts b/src/helpers.ts index b515175..8776382 100644 --- a/src/helpers.ts +++ b/src/helpers.ts @@ -29,9 +29,8 @@ export async function renderer( try { return ejs.render(templateString, data); } catch (error) { - core.error('#renderer'); - core.error(error); - process.exit(1); + core.setFailed(`#renderer: ${error}`); + return ''; } } @@ -57,7 +56,7 @@ let links: PaginationLink = { last: undefined, }; export async function paginate(): Promise { - if (!isLastPage(links)) return null; + if (isLastPage(links)) return null; const r = await apiGetStar(links.next); links = r.links; return r; diff --git a/src/index.ts b/src/index.ts index a6542f1..02b4669 100644 --- a/src/index.ts +++ b/src/index.ts @@ -47,18 +47,13 @@ export async function main(): Promise { export async function run(): Promise { try { await main(); - process.exit(0); } catch (error) { - core.error('#run:'); - core.error(error); - process.exit(1); + core.setFailed(`#run: ${error}`); } } const catchAll = (info: any) => { - core.error('#catchAll'); - core.error(info); - process.exit(1); + core.setFailed(`#catchAll: ${info}`); }; process.on('unhandledRejection', catchAll); process.on('uncaughtException', catchAll);