fix: strengthen diff behavior and type safety - #96
Merged
Merged
Conversation
Signed-off-by: Rui Chen <[email protected]>
Signed-off-by: Rui Chen <[email protected]>
chenrui333
marked this pull request as ready for review
July 15, 2026 13:30
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
GitHubClientboundary and an Octokit adapter so diff behavior uses typed, focused fakes instead of concrete-client casts.Motivation
GitHubDiffpreviously depended on the entire Octokit surface, which forced broad fakes and unsafe assertions. Event payloads were trusted after an unchecked JSON cast, unreadable payloads silently changed diff selection, and truncated push commit lists could omit files. The initial adapter also inferred pagination completion from response length instead of GitHub'sLink: rel="next"contract.Behavioral coverage
Errorrejections, and bounded throttle retries.Coverage
Compatibility
Input names, output names, the Node 24 runtime, default-base selection, and the default exclusion of removed files are unchanged. The space-delimited outputs remain available. Observable improvements are limited to early errors for malformed required context/event files, conservative range fallback for push lists at the documented cap or with missing entries, deduplicated/stably ordered filter results, and avoiding duplicate Pulls fallback requests after a failure.
Generated bundle
dist/index.jswas regenerated fromsrc/main.ts. Consecutive and post-commit builds produced the same SHA-256 and left the committed bundle clean.Risks and follow-ups
beforeSHA cannot use a before/after comparison; the action conservatively retains any available commit IDs and otherwise keeps the existing same-ref fallback.