Add error handling to publish workflow JSON operations #20
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
The publish workflow's version update steps lacked error handling, causing cryptic failures when JSON parsing or file operations failed. Added comprehensive validation and error handling to both
deno.jsonandpackage.json.templateupdate steps.Type of Change
Changes Made
deno evalfile operations in try-catch blocksDeno.stat)Deno.exit(1)on failuresTesting
deno task gensuccessfullydeno lint(noted any acceptable errors)deno check mod.tsAdditional testing:
Architectural Decision Record (ADR)
docs/adr/docs/adr/README.mdIf ADR is required but not included, please explain why:
Workflow-level error handling is a standard defensive programming practice, not an architectural decision.
Documentation
Breaking Changes
None. Changes are internal to CI/CD workflow error handling.
Related Issues
Fixes #[issue_number]
Additional Notes
The original issue description referenced Rust/WASM code at line 56, but the actual problem was in the GitHub Actions workflow at line 56 where
deno evalwas parsing JSON without error handling. The "Reflect.get called on non-object" error occurred when parsed values weren't validated as objects before property access.Error cases now handled:
Checklist
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.