This document defines the error handling architecture, native error propagation, top-level entry point boundaries, build failure logging, and @actions/core failure reporting across @area44/workflows.
This specification governs how errors are generated, caught, propagated, logged, and reported to GitHub Actions runner environments across composite actions (pages, autofix) and core resolution modules.
All internal modules throw standard native JavaScript Error instances containing clear, actionable, and context-rich messages. Custom error classes, error wrapping utilities, or custom regex-based string sanitizers are avoided in favor of direct native exceptions.
Action steps report failures to the GitHub Actions runner using official @actions/core APIs:
core.setFailed(message): Marks the current workflow step as failed and logs the provided error message.core.error(message): Emits inline error log annotations when appropriate.
Bundled executable action entrypoints (dist/resolve-environment.mjs, dist/site-variables.mjs, dist/build-command.mjs, dist/autofix.mjs) wrap execution inside top-level try/catch error boundaries:
resolve-environment: Catches unparseable project manifests or package manager resolution conflicts, triggeringcore.setFailed()with the exact error message.site-variables: ValidatesGITHUB_REPOSITORYandGITHUB_REPOSITORY_OWNERenvironment variables. Emits warnings if repository metadata is missing or malformed without failing the job when possible.build-command: Wraps build command parsing, CLI execution, and output directory validation. Catches non-zero process exit codes and missing build output directories.autofix: Wraps independent JavaScript and Python workflow steps, aggregating errors across both pipelines before reporting final step outcomes viacore.setFailed().
For machine-verifiable assertions in CI workflows, runBuildCommand() in src/pages/build-command.ts captures build failures:
- Log File Location: When the
RUNNER_TEMPenvironment variable is set by the runner, failure details are written to${RUNNER_TEMP}/pages_build_error.log. - Diagnostic Coverage: Captures non-zero exit codes from custom or default build commands (e.g.,
"Build command execution failed with exit code 1") and output path validation errors (e.g.,"Build output validation failed: Configured build output directory 'dist' does not exist."). - CI Verification: Integration workflows like
.github/workflows/test-actions.ymlassert step failure status and verify the exact contents of${RUNNER_TEMP}/pages_build_error.logfor negative scenario matrix jobs.
- No Silent Failures: Any unhandled exception during resolution or execution MUST terminate the action step with a non-zero exit code.
- Aggregated Diagnostics: In multi-language workflows (
autofix), failure in one language pipeline does not immediately suppress execution or error reporting from other active pipelines. All accumulated errors are logged prior to setting step failure.
- Repository README: Project overview and action API summary.
- Security Boundaries: Trust boundaries, process tokenization, and secret masking.
- Maintenance & Repository Health: Source files, build pipeline, and quality gates.
- Integration Testing Guide: Integration test matrix and failure mode verification.