mirror of
https://github.com/gradle/gradle-build-action.git
synced 2025-06-07 16:56:12 +02:00
Extract action state-tracking out of caches.ts
This commit is contained in:
parent
d95713bd5d
commit
8f3c97e3f1
4 changed files with 51 additions and 21 deletions
|
@ -1,5 +1,5 @@
|
|||
import * as core from '@actions/core'
|
||||
import * as caches from './caches'
|
||||
import * as setupGradle from './setup-gradle'
|
||||
|
||||
// Catch and log any unhandled exceptions. These exceptions can leak out of the uploadChunk method in
|
||||
// @actions/toolkit when a failed upload closes the file descriptor causing any in-process reads to
|
||||
|
@ -11,14 +11,14 @@ process.on('uncaughtException', e => handleFailure(e))
|
|||
*/
|
||||
export async function run(): Promise<void> {
|
||||
try {
|
||||
await caches.save()
|
||||
await setupGradle.complete()
|
||||
} catch (error) {
|
||||
handleFailure(error)
|
||||
}
|
||||
}
|
||||
|
||||
function handleFailure(error: unknown): void {
|
||||
core.warning(`Unhandled error saving cache - job will continue: ${error}`)
|
||||
core.warning(`Unhandled error in Gradle post-action - job will continue: ${error}`)
|
||||
if (error instanceof Error && error.stack) {
|
||||
core.info(error.stack)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue