diff --git a/src/create-pull-request.ts b/src/create-pull-request.ts index bf5eb9c..d511a1c 100644 --- a/src/create-pull-request.ts +++ b/src/create-pull-request.ts @@ -265,7 +265,10 @@ export async function createPullRequest(inputs: Inputs): Promise { } } } catch (error) { - console.log(error) + if (error instanceof Error) { + core.error(error) + if (error.stack) core.error(error.stack) + } core.setFailed(utils.getErrorMessage(error)) } finally { // Remove auth and restore persisted auth config if it existed diff --git a/src/main.ts b/src/main.ts index c6db73c..9be7c90 100644 --- a/src/main.ts +++ b/src/main.ts @@ -32,7 +32,10 @@ async function run(): Promise { await createPullRequest(inputs) } catch (error) { - console.error(error) + if (error instanceof Error) { + core.error(error) + if (error.stack) core.error(error.stack) + } core.setFailed(utils.getErrorMessage(error)) } } diff --git a/src/utils.ts b/src/utils.ts index 92ba36c..c8bacc5 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -147,8 +147,8 @@ export function fileExistsSync(path: string): boolean { throw new Error("Arg 'path' must not be empty") } - console.log(path) - console.log(fs.realpathSync(path)) + core.info(path) + core.info(fs.realpathSync(path)) let stats: fs.Stats try {