make logging ACTUALLY work

This commit is contained in:
Dario Dorando 2023-09-06 15:09:13 +03:00
parent 83bd37ca12
commit 6ea29d2e6e
3 changed files with 10 additions and 4 deletions

View file

@ -265,7 +265,10 @@ export async function createPullRequest(inputs: Inputs): Promise<void> {
}
}
} 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

View file

@ -32,7 +32,10 @@ async function run(): Promise<void> {
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))
}
}

View file

@ -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 {