From e7e0930a05c33c48fc252b5ca752d39aa936d514 Mon Sep 17 00:00:00 2001 From: Sora Morimoto Date: Sun, 10 Nov 2024 04:47:13 +0900 Subject: [PATCH] The post step should not fail if there is an error Signed-off-by: Sora Morimoto --- analysis/dist/index.js | 2 +- dist/index.js | 6 +++--- dist/post/index.js | 7 ++++--- lint-doc/dist/index.js | 2 +- lint-fmt/dist/index.js | 2 +- lint-opam/dist/index.js | 2 +- packages/analysis/src/index.ts | 2 +- packages/lint-doc/src/index.ts | 2 +- packages/lint-fmt/src/index.ts | 2 +- packages/lint-opam/src/index.ts | 2 +- packages/setup-ocaml/src/cache.ts | 4 ++-- packages/setup-ocaml/src/index.ts | 2 +- packages/setup-ocaml/src/post.ts | 3 ++- 13 files changed, 20 insertions(+), 18 deletions(-) diff --git a/analysis/dist/index.js b/analysis/dist/index.js index f780f064..82f7550a 100644 --- a/analysis/dist/index.js +++ b/analysis/dist/index.js @@ -36046,7 +36046,7 @@ async function run() { } catch (error) { if (error instanceof Error) { - core.setFailed(error.message); + core.error(error.message); } external_node_process_namespaceObject.exit(1); } diff --git a/dist/index.js b/dist/index.js index 43a687ad..86c3e471 100644 --- a/dist/index.js +++ b/dist/index.js @@ -156788,7 +156788,7 @@ async function restoreCache(key, restoreKeys, paths) { if (error instanceof Error) { lib_core.info(error.message); } - lib_core.warning("An internal error has occurred in cache backend. Please check https://www.githubstatus.com for any ongoing issue in actions."); + lib_core.notice("An internal error has occurred in cache backend. Please check https://www.githubstatus.com for any ongoing issue in actions."); return; } } @@ -156804,7 +156804,7 @@ async function saveCache(key, paths) { if (error instanceof Error) { lib_core.info(error.message); } - lib_core.warning("An internal error has occurred in cache backend. Please check https://www.githubstatus.com for any ongoing issue in actions."); + lib_core.notice("An internal error has occurred in cache backend. Please check https://www.githubstatus.com for any ongoing issue in actions."); } } async function restoreDuneCache() { @@ -156994,7 +156994,7 @@ async function run() { } catch (error) { if (error instanceof Error) { - lib_core.setFailed(error.message); + lib_core.error(error.message); } external_node_process_.exit(1); } diff --git a/dist/post/index.js b/dist/post/index.js index 55f75da2..4c157cd4 100644 --- a/dist/post/index.js +++ b/dist/post/index.js @@ -103023,7 +103023,7 @@ async function restoreCache(key, restoreKeys, paths) { if (error instanceof Error) { core.info(error.message); } - core.warning("An internal error has occurred in cache backend. Please check https://www.githubstatus.com for any ongoing issue in actions."); + core.notice("An internal error has occurred in cache backend. Please check https://www.githubstatus.com for any ongoing issue in actions."); return; } } @@ -103039,7 +103039,7 @@ async function saveCache(key, paths) { if (error instanceof Error) { lib_core.info(error.message); } - lib_core.warning("An internal error has occurred in cache backend. Please check https://www.githubstatus.com for any ongoing issue in actions."); + lib_core.notice("An internal error has occurred in cache backend. Please check https://www.githubstatus.com for any ongoing issue in actions."); } } async function restoreDuneCache() { @@ -103150,7 +103150,8 @@ async function run() { if (error instanceof Error) { lib_core.error(error.message); } - external_node_process_.exit(1); + // The post step should not fail if there is an error... + external_node_process_.exit(0); } } void run(); diff --git a/lint-doc/dist/index.js b/lint-doc/dist/index.js index f2efd6b8..adbecba1 100644 --- a/lint-doc/dist/index.js +++ b/lint-doc/dist/index.js @@ -27460,7 +27460,7 @@ async function run() { } catch (error) { if (error instanceof Error) { - core.setFailed(error.message); + core.error(error.message); } external_node_process_namespaceObject.exit(1); } diff --git a/lint-fmt/dist/index.js b/lint-fmt/dist/index.js index 630843b5..30acfd6f 100644 --- a/lint-fmt/dist/index.js +++ b/lint-fmt/dist/index.js @@ -27502,7 +27502,7 @@ async function run() { } catch (error) { if (error instanceof Error) { - core.setFailed(error.message); + core.error(error.message); } external_node_process_namespaceObject.exit(1); } diff --git a/lint-opam/dist/index.js b/lint-opam/dist/index.js index 9597aac6..1072c1c9 100644 --- a/lint-opam/dist/index.js +++ b/lint-opam/dist/index.js @@ -27460,7 +27460,7 @@ async function run() { } catch (error) { if (error instanceof Error) { - core.setFailed(error.message); + core.error(error.message); } external_node_process_namespaceObject.exit(1); } diff --git a/packages/analysis/src/index.ts b/packages/analysis/src/index.ts index 583398a6..5ed3a0e0 100644 --- a/packages/analysis/src/index.ts +++ b/packages/analysis/src/index.ts @@ -11,7 +11,7 @@ async function run() { process.exit(0); } catch (error) { if (error instanceof Error) { - core.setFailed(error.message); + core.error(error.message); } process.exit(1); } diff --git a/packages/lint-doc/src/index.ts b/packages/lint-doc/src/index.ts index 27930653..385c7ca2 100644 --- a/packages/lint-doc/src/index.ts +++ b/packages/lint-doc/src/index.ts @@ -11,7 +11,7 @@ async function run() { process.exit(0); } catch (error) { if (error instanceof Error) { - core.setFailed(error.message); + core.error(error.message); } process.exit(1); } diff --git a/packages/lint-fmt/src/index.ts b/packages/lint-fmt/src/index.ts index 656f22b6..427fa476 100644 --- a/packages/lint-fmt/src/index.ts +++ b/packages/lint-fmt/src/index.ts @@ -15,7 +15,7 @@ async function run() { process.exit(0); } catch (error) { if (error instanceof Error) { - core.setFailed(error.message); + core.error(error.message); } process.exit(1); } diff --git a/packages/lint-opam/src/index.ts b/packages/lint-opam/src/index.ts index 374a261b..3d373015 100644 --- a/packages/lint-opam/src/index.ts +++ b/packages/lint-opam/src/index.ts @@ -12,7 +12,7 @@ async function run() { process.exit(0); } catch (error) { if (error instanceof Error) { - core.setFailed(error.message); + core.error(error.message); } process.exit(1); } diff --git a/packages/setup-ocaml/src/cache.ts b/packages/setup-ocaml/src/cache.ts index f522d921..efe8557f 100644 --- a/packages/setup-ocaml/src/cache.ts +++ b/packages/setup-ocaml/src/cache.ts @@ -127,7 +127,7 @@ async function restoreCache( if (error instanceof Error) { core.info(error.message); } - core.warning( + core.notice( "An internal error has occurred in cache backend. Please check https://www.githubstatus.com for any ongoing issue in actions.", ); return; @@ -145,7 +145,7 @@ async function saveCache(key: string, paths: string[]) { if (error instanceof Error) { core.info(error.message); } - core.warning( + core.notice( "An internal error has occurred in cache backend. Please check https://www.githubstatus.com for any ongoing issue in actions.", ); } diff --git a/packages/setup-ocaml/src/index.ts b/packages/setup-ocaml/src/index.ts index e13cee9a..beca9fac 100644 --- a/packages/setup-ocaml/src/index.ts +++ b/packages/setup-ocaml/src/index.ts @@ -8,7 +8,7 @@ async function run() { process.exit(0); } catch (error) { if (error instanceof Error) { - core.setFailed(error.message); + core.error(error.message); } process.exit(1); } diff --git a/packages/setup-ocaml/src/post.ts b/packages/setup-ocaml/src/post.ts index a2269e4a..5aa8d51a 100644 --- a/packages/setup-ocaml/src/post.ts +++ b/packages/setup-ocaml/src/post.ts @@ -15,7 +15,8 @@ async function run() { if (error instanceof Error) { core.error(error.message); } - process.exit(1); + // The post step should not fail if there is an error... + process.exit(0); } }