fix: exit condition
This commit is contained in:
parent
f8cb892016
commit
914a11532f
@ -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 core from '@actions/core';
|
||||||
import * as exec from '@actions/exec';
|
import * as exec from '@actions/exec';
|
||||||
|
@ -29,9 +29,8 @@ export async function renderer(
|
|||||||
try {
|
try {
|
||||||
return ejs.render(templateString, data);
|
return ejs.render(templateString, data);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
core.error('#renderer');
|
core.setFailed(`#renderer: ${error}`);
|
||||||
core.error(error);
|
return '';
|
||||||
process.exit(1);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -57,7 +56,7 @@ let links: PaginationLink = {
|
|||||||
last: undefined,
|
last: undefined,
|
||||||
};
|
};
|
||||||
export async function paginate(): Promise<ApiGetStarResponse | null> {
|
export async function paginate(): Promise<ApiGetStarResponse | null> {
|
||||||
if (!isLastPage(links)) return null;
|
if (isLastPage(links)) return null;
|
||||||
const r = await apiGetStar(links.next);
|
const r = await apiGetStar(links.next);
|
||||||
links = r.links;
|
links = r.links;
|
||||||
return r;
|
return r;
|
||||||
|
@ -47,18 +47,13 @@ export async function main(): Promise<any> {
|
|||||||
export async function run(): Promise<any> {
|
export async function run(): Promise<any> {
|
||||||
try {
|
try {
|
||||||
await main();
|
await main();
|
||||||
process.exit(0);
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
core.error('#run:');
|
core.setFailed(`#run: ${error}`);
|
||||||
core.error(error);
|
|
||||||
process.exit(1);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const catchAll = (info: any) => {
|
const catchAll = (info: any) => {
|
||||||
core.error('#catchAll');
|
core.setFailed(`#catchAll: ${info}`);
|
||||||
core.error(info);
|
|
||||||
process.exit(1);
|
|
||||||
};
|
};
|
||||||
process.on('unhandledRejection', catchAll);
|
process.on('unhandledRejection', catchAll);
|
||||||
process.on('uncaughtException', catchAll);
|
process.on('uncaughtException', catchAll);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user