diff --git a/actions/setup/js/check_workflow_timestamp_api.cjs b/actions/setup/js/check_workflow_timestamp_api.cjs index f88794ed891..9b94409b83b 100644 --- a/actions/setup/js/check_workflow_timestamp_api.cjs +++ b/actions/setup/js/check_workflow_timestamp_api.cjs @@ -109,6 +109,4 @@ async function main() { } } -main().catch(error => { - core.setFailed(error instanceof Error ? error.message : String(error)); -}); +module.exports = { main }; diff --git a/pkg/workflow/main_export_validation_test.go b/pkg/workflow/main_export_validation_test.go index 6f569bc65e9..9560f9b9afb 100644 --- a/pkg/workflow/main_export_validation_test.go +++ b/pkg/workflow/main_export_validation_test.go @@ -64,10 +64,10 @@ func TestScriptsExportMain(t *testing.T) { // follow the correct pattern and include the require.main check for direct execution func TestScriptsWithMainExportPattern(t *testing.T) { jsDir := "js" - + // Pattern to match: module.exports = { main } mainExportPattern := regexp.MustCompile(`module\.exports\s*=\s*\{[^}]*\bmain\b[^}]*\}`) - + // Pattern to check for require.main === module check requireMainPattern := regexp.MustCompile(`require\.main\s*===\s*module`)