Add post hooks for cleanup (#193)
* Add post hooks for cleanup * Switch to signal-based cleanup * Better exit handling
This commit is contained in:
committed by
pullfrog[bot]
parent
90945a9481
commit
102417f442
@@ -6,6 +6,7 @@
|
||||
|
||||
import * as core from "@actions/core";
|
||||
import { main } from "./main.ts";
|
||||
import { runCleanup } from "./utils/exitHandler.ts";
|
||||
|
||||
async function run(): Promise<void> {
|
||||
try {
|
||||
@@ -17,6 +18,8 @@ async function run(): Promise<void> {
|
||||
} catch (error) {
|
||||
const errorMessage = error instanceof Error ? error.message : "Unknown error occurred";
|
||||
core.setFailed(`Action failed: ${errorMessage}`);
|
||||
} finally {
|
||||
await runCleanup();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user