refactor(github): split action.ts into smaller modules #484
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.
Closes #461
Applied changes based on Issue #461.
I’ve split the giant
action.ts
into four focused modules plus an aggregator, preserving all existing behavior and test contracts:1. Progress UI (
src/github/progress.ts
)escapeRegExp
,createProgressComment
andupdateProgressComment
into a dedicated progress‐comment manager.2. Prompt Builder (
src/github/prompt-builder.ts
)--fetch
,--fix-build
,createIssues
, image‐URL extraction, and thegeneratePrompt
call.fetchLatestFailedWorkflowLogs
.3. Result Handler (
src/github/result-handler.ts
)handleResult
), including workflow‐file filtering, image‐artifact cleanup, commit‐message generation, PR vs. comment dispatch, and--no-pr
handling.4. Run Action Orchestrator (
src/github/runAction.ts
)runAction
now only orchestrates the high‐level flow: reactions, clone, file‐snapshot, prompt preparation, Codex call, progress updates, create‑issues dispatch, change detection & progress ticks, then hands off tohandleResult
.5. Action Aggregator (
src/github/action.ts
)Next steps:
src/main.ts
) continue to work without modification.escapeRegExp
,createProgressComment
,updateProgressComment
, andcreateIssuesFromFeaturePlan
will still pass againstsrc/github/action.ts
as before.Please let me know if you’d like any tweaks!