mirror of
https://github.com/peakoss/anti-slop
synced 2026-12-01 13:39:13 +08:00
feat(core): add typed error handling to main run function
This commit is contained in:
1 file changed
+12
-1
+12
-1
@@ -1 +1,12 @@
|
||||
export async function run(): Promise<void> {}
|
||||
import * as core from "@actions/core";
|
||||
|
||||
export async function run(): Promise<void> {
|
||||
try {
|
||||
} catch (error: unknown) {
|
||||
if (error instanceof Error) {
|
||||
core.setFailed(error.message);
|
||||
} else {
|
||||
core.setFailed("An unexpected error occurred");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user