Avoid failing job on any failure in post-action
Some checks are pending
Verify generated outputs / check (push) Waiting to run
Test different action inputs / action-inputs (ubuntu-latest) (push) Waiting to run
Test different action inputs / action-inputs (windows-latest) (push) Waiting to run
Test caching configuration / seed-build (ubuntu-latest) (push) Waiting to run
Test caching configuration / seed-build (windows-latest) (push) Waiting to run
Test caching configuration / verify-build (ubuntu-latest) (push) Blocked by required conditions
Test caching configuration / verify-build (windows-latest) (push) Blocked by required conditions
Test save/restore configuration-cache state / seed-build (ubuntu-latest) (push) Waiting to run
Test save/restore configuration-cache state / seed-build (windows-latest) (push) Waiting to run
Test save/restore configuration-cache state / configuration-cache (ubuntu-latest) (push) Blocked by required conditions
Test save/restore configuration-cache state / configuration-cache (windows-latest) (push) Blocked by required conditions
Test save/restore configuration-cache state / no-bundles-restored (ubuntu-latest) (push) Blocked by required conditions
Test save/restore configuration-cache state / no-bundles-restored (windows-latest) (push) Blocked by required conditions
Test save/restore Gradle Home directory / seed-build (ubuntu-latest) (push) Waiting to run
Test save/restore Gradle Home directory / seed-build (windows-latest) (push) Waiting to run
Test save/restore Gradle Home directory / dependencies-cache (ubuntu-latest) (push) Blocked by required conditions
Test save/restore Gradle Home directory / dependencies-cache (windows-latest) (push) Blocked by required conditions
Test save/restore Gradle Home directory / build-cache (ubuntu-latest) (push) Blocked by required conditions
Test save/restore Gradle Home directory / build-cache (windows-latest) (push) Blocked by required conditions
Test save/restore Gradle Home directory / no-bundles-restored (ubuntu-latest) (push) Blocked by required conditions
Test save/restore Gradle Home directory / no-bundles-restored (windows-latest) (push) Blocked by required conditions
Test Gradle execution / gradle-execution (ubuntu-latest) (push) Waiting to run
Test Gradle execution / gradle-execution (windows-latest, .bat) (push) Waiting to run
Test Gradle execution / gradle-versions (ubuntu-latest) (push) Waiting to run
Test Gradle execution / gradle-versions (windows-latest, .bat) (push) Waiting to run
Test caching with a custom GRADLE_USER_HOME / seed-build (ubuntu-latest) (push) Waiting to run
Test caching with a custom GRADLE_USER_HOME / seed-build (windows-latest) (push) Waiting to run
Test caching with a custom GRADLE_USER_HOME / dependencies-cache (ubuntu-latest) (push) Blocked by required conditions
Test caching with a custom GRADLE_USER_HOME / dependencies-cache (windows-latest) (push) Blocked by required conditions
Test caching with a custom GRADLE_USER_HOME / build-cache (ubuntu-latest) (push) Blocked by required conditions
Test caching with a custom GRADLE_USER_HOME / build-cache (windows-latest) (push) Blocked by required conditions
Test caching with Kotlin DSL / seed-build (ubuntu-latest) (push) Waiting to run
Test caching with Kotlin DSL / seed-build (windows-latest) (push) Waiting to run
Test caching with Kotlin DSL / verify-build (ubuntu-latest) (push) Blocked by required conditions
Test caching with Kotlin DSL / verify-build (windows-latest) (push) Blocked by required conditions
Some checks are pending
Verify generated outputs / check (push) Waiting to run
Test different action inputs / action-inputs (ubuntu-latest) (push) Waiting to run
Test different action inputs / action-inputs (windows-latest) (push) Waiting to run
Test caching configuration / seed-build (ubuntu-latest) (push) Waiting to run
Test caching configuration / seed-build (windows-latest) (push) Waiting to run
Test caching configuration / verify-build (ubuntu-latest) (push) Blocked by required conditions
Test caching configuration / verify-build (windows-latest) (push) Blocked by required conditions
Test save/restore configuration-cache state / seed-build (ubuntu-latest) (push) Waiting to run
Test save/restore configuration-cache state / seed-build (windows-latest) (push) Waiting to run
Test save/restore configuration-cache state / configuration-cache (ubuntu-latest) (push) Blocked by required conditions
Test save/restore configuration-cache state / configuration-cache (windows-latest) (push) Blocked by required conditions
Test save/restore configuration-cache state / no-bundles-restored (ubuntu-latest) (push) Blocked by required conditions
Test save/restore configuration-cache state / no-bundles-restored (windows-latest) (push) Blocked by required conditions
Test save/restore Gradle Home directory / seed-build (ubuntu-latest) (push) Waiting to run
Test save/restore Gradle Home directory / seed-build (windows-latest) (push) Waiting to run
Test save/restore Gradle Home directory / dependencies-cache (ubuntu-latest) (push) Blocked by required conditions
Test save/restore Gradle Home directory / dependencies-cache (windows-latest) (push) Blocked by required conditions
Test save/restore Gradle Home directory / build-cache (ubuntu-latest) (push) Blocked by required conditions
Test save/restore Gradle Home directory / build-cache (windows-latest) (push) Blocked by required conditions
Test save/restore Gradle Home directory / no-bundles-restored (ubuntu-latest) (push) Blocked by required conditions
Test save/restore Gradle Home directory / no-bundles-restored (windows-latest) (push) Blocked by required conditions
Test Gradle execution / gradle-execution (ubuntu-latest) (push) Waiting to run
Test Gradle execution / gradle-execution (windows-latest, .bat) (push) Waiting to run
Test Gradle execution / gradle-versions (ubuntu-latest) (push) Waiting to run
Test Gradle execution / gradle-versions (windows-latest, .bat) (push) Waiting to run
Test caching with a custom GRADLE_USER_HOME / seed-build (ubuntu-latest) (push) Waiting to run
Test caching with a custom GRADLE_USER_HOME / seed-build (windows-latest) (push) Waiting to run
Test caching with a custom GRADLE_USER_HOME / dependencies-cache (ubuntu-latest) (push) Blocked by required conditions
Test caching with a custom GRADLE_USER_HOME / dependencies-cache (windows-latest) (push) Blocked by required conditions
Test caching with a custom GRADLE_USER_HOME / build-cache (ubuntu-latest) (push) Blocked by required conditions
Test caching with a custom GRADLE_USER_HOME / build-cache (windows-latest) (push) Blocked by required conditions
Test caching with Kotlin DSL / seed-build (ubuntu-latest) (push) Waiting to run
Test caching with Kotlin DSL / seed-build (windows-latest) (push) Waiting to run
Test caching with Kotlin DSL / verify-build (ubuntu-latest) (push) Blocked by required conditions
Test caching with Kotlin DSL / verify-build (windows-latest) (push) Blocked by required conditions
Failures to store cache entries should not fail the action or the Job. This fix attempts to catch and log any unexpected errors that occur when saving cache entries. Fixes: #119 Fixes: #120
This commit is contained in:
parent
4137be6a8b
commit
996094e8e8
2
dist/post/index.js
vendored
2
dist/post/index.js
vendored
File diff suppressed because one or more lines are too long
2
dist/post/index.js.map
vendored
2
dist/post/index.js.map
vendored
File diff suppressed because one or more lines are too long
17
src/post.ts
17
src/post.ts
@ -1,15 +1,24 @@
|
||||
import * as core from '@actions/core'
|
||||
import * as caches from './caches'
|
||||
|
||||
// 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
|
||||
// throw an uncaught exception. Instead of failing this action, just warn.
|
||||
process.on('uncaughtException', e => handleFailure(e))
|
||||
|
||||
// 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)
|
||||
}
|
||||
handleFailure(error)
|
||||
}
|
||||
}
|
||||
|
||||
function handleFailure(error: unknown): void {
|
||||
core.warning(`Unhandled error saving cache - job will continue: ${error}`)
|
||||
if (error instanceof Error && error.stack) {
|
||||
core.info(error.stack)
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user