mirror of
https://github.com/gradle/gradle-build-action.git
synced 2025-06-07 16:56:12 +02:00
Fail action execution on unhandled errors
Without this, the error logs contain an "UnhandledPromiseRejectionError" but the action is reported as succeeding.
This commit is contained in:
parent
a802a3c0ce
commit
cca55d0890
3 changed files with 20 additions and 11 deletions
10
src/post.ts
10
src/post.ts
|
@ -1,8 +1,16 @@
|
|||
import * as core from '@actions/core'
|
||||
import * as caches from './caches'
|
||||
|
||||
// Invoked by GitHub Actions
|
||||
export async function run(): Promise<void> {
|
||||
await caches.save()
|
||||
try {
|
||||
await caches.save()
|
||||
} catch (error) {
|
||||
core.setFailed(String(error))
|
||||
if (error instanceof Error && error.stack) {
|
||||
core.info(error.stack)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
run()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue