Add result mode for multi-job deployments - #501
Conversation
Live testingTested The table records behavior before cleanup. Failed and cancelled runs are intentional tests of failure handling; a failed reporting step does not necessarily mean the deployment work failed.
All eight rejection cases failed the result step with an empty ✅ Both sandboxes were restored (personal restoration, org-fork restoration). Their Result context and job results still need trusted workflow jobs in the same run and attempt, with one finalizer per context. These tests do not provide an exactly-once guarantee or guarantee finalization after force cancellation, runner loss or API failure. Earlier testing at |
There was a problem hiding this comment.
Pull request overview
Adds opt-in result mode for safely finalizing multi-job deployments and noops while preserving existing completion behavior.
Changes:
- Adds validated cross-job completion context and result aggregation.
- Integrates final status, comment, label, reaction, and lock handling.
- Documents the workflow and adds comprehensive tests.
Reviewed changes
Copilot reviewed 31 out of 33 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
src/types.ts |
Adds result-mode domain types. |
src/operation-result.ts |
Registers result reason codes. |
src/main.ts |
Dispatches result operations. |
src/functions/trusted-deployment-template.ts |
Exports path validation. |
src/functions/result-operation.ts |
Verifies and completes results. |
src/functions/result-context.ts |
Parses and validates handoff data. |
src/functions/prechecks.ts |
Captures deferred review data. |
src/functions/post.ts |
Suppresses result-mode post handling. |
src/functions/post-deploy.ts |
Adds result-aware completion and cleanup. |
src/functions/post-deploy-message.ts |
Renders result statuses and URLs. |
src/functions/environment-targets.ts |
Exports URL lookup. |
src/functions/deployment-operation.ts |
Publishes trusted completion context. |
src/functions/deferred-completion.ts |
Builds deferred handoff metadata. |
src/action-io.ts |
Registers new inputs and outputs. |
README.md |
Documents result-mode contracts. |
docs/result-mode.md |
Adds the result-mode guide. |
docs/examples.md |
Replaces manual reporting example. |
action.yml |
Declares the public interface. |
__tests__/types.test.ts |
Updates registry type checks. |
__tests__/schemas/action.schema.yml |
Extends metadata schema. |
__tests__/result-mode-fixtures.ts |
Adds shared context fixtures. |
__tests__/main.test.ts |
Tests dispatch and context publication. |
__tests__/functions/result-operation.test.ts |
Tests verification and completion. |
__tests__/functions/result-context.test.ts |
Tests parsing and validation. |
__tests__/functions/prechecks.test.ts |
Tests deferred review snapshots. |
__tests__/functions/post.test.ts |
Tests post-hook suppression. |
__tests__/functions/post-deploy.test.ts |
Tests result cleanup behavior. |
__tests__/functions/post-deploy-message.test.ts |
Tests result message rendering. |
__tests__/functions/deferred-completion.test.ts |
Tests context generation. |
__tests__/docs-security.test.ts |
Enforces secure examples. |
__tests__/action-contract.test.ts |
Updates public contract assertions. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This pull request adds opt-in result mode so multi-job deployments and noops can report their results without the extra reporting YAML. Result mode defaults to
falseand keeps existing modes and manualskip_completingworkflows supported. It requires trusted context from the same workflow run and attempt, with one finalizer per context; interrupted reporting can still need manual recovery. Live sandbox tests cover ordinary deployments, forks, failure paths, and reruns at920f085; both sandboxes are restored.Closes #455