gradle-build-action/src/post.ts
Daz DeBoer cca55d0890
Fail action execution on unhandled errors
Without this, the error logs contain an "UnhandledPromiseRejectionError"
but the action is reported as succeeding.
2021-09-14 07:48:06 -06:00

16 lines
359 B
TypeScript

import * as core from '@actions/core'
import * as caches from './caches'
// Invoked by GitHub Actions
export async function run(): Promise<void> {
try {
await caches.save()
} catch (error) {
core.setFailed(String(error))
if (error instanceof Error && error.stack) {
core.info(error.stack)
}
}
}
run()