Skip to content

[eslint-monster] setup/js: harden unhandled throw sites (fetch/fs/JSON.parse/execSync/async entrypoints) #49214

Description

@github-actions

Summary

Daily npm run lint:setup-js found a cluster of runtime-hardening warnings in actions/setup/js where throwing APIs are called without local handling.

Root cause group

Wrap throwing operations in the required guards so setup-time failures are reported cleanly instead of crashing the action.

Affected files

  • actions/setup/js/artifact_client.cjs
  • actions/setup/js/data_schema_normalizer.cjs
  • actions/setup/js/start_mcp_gateway.cjs
  • actions/setup/js/test-live-github-api.cjs
  • actions/setup/js/upload_artifact.cjs
  • actions/setup/js/validate_memory_files.cjs

Representative diagnostics

  • actions/setup/js/artifact_client.cjs:217gh-aw-custom/require-fetch-try-catch
  • actions/setup/js/data_schema_normalizer.cjs:155gh-aw-custom/require-json-parse-try-catch
  • actions/setup/js/start_mcp_gateway.cjs:876gh-aw-custom/require-execsync-try-catch
  • actions/setup/js/test-live-github-api.cjs:106gh-aw-custom/require-async-entrypoint-catch
  • actions/setup/js/upload_artifact.cjs:137gh-aw-custom/require-fs-io-try-catch
  • actions/setup/js/validate_memory_files.cjs:44gh-aw-custom/require-fs-io-try-catch

Expected outcome

Add local try/catch or equivalent structured error handling around these operations so the action fails predictably with actionable messages.

Checklist

  • Fix only the unhandled-throw/runtime-hardening findings in the files above
  • Add targeted try/catch coverage around fetch, JSON.parse, execSync, and sync fs calls
  • Ensure async entrypoints terminate with explicit .catch(...) handling where required
  • Keep edits scoped to actions/setup/js
  • Run npm run lint:setup-js

Generated by 🧹 ESLint Monster · gpt54 · 15.8 AIC · ⌖ 6.66 AIC · ⊞ 4.8K ·

  • expires on Aug 6, 2026, 2:21 PM UTC-08:00

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions