Problem
When use_rest_api: true is set, only pull_request* events are supported. For push, merge_group, and all other events, actions/checkout is required. For large repositories, the checkout step adds significant time to workflows that only need to know which files changed (e.g., conditional job triggers, path-based filtering).
This also creates a poor user experience for teams using merge queues. A workflow with use_rest_api: true works correctly on pull_request events, but then fails when the same workflow triggers on merge_group as the PR moves into the merge queue — or on push when it lands on the target branch. Users either have to add actions/checkout (losing the performance benefit) or maintain separate workflow configurations per event type.
Proposed solution
Extend the REST API mode to support push and merge_group events by using the repos.compareCommits endpoint instead of pulls.listFiles. The webhook payload already contains the necessary SHAs:
- push:
payload.before / payload.after
- merge_group:
payload.merge_group.base_sha / payload.merge_group.head_sha
Both endpoints return files in the same shape (filename, status, previous_filename), so all downstream processing (filtering, dir_names, output formatting, etc.) works without changes.
Prior art
This pattern is proven in the wild. Two maintained forks of jitterbit/get-changed-files use repos.compareCommits for API-only changed file detection across event types, with no checkout required:
Scope
getChangedFilesFromGithubAPI in changedFiles.ts — branch endpoint selection by event type
- Gate in
main.ts — allow push/merge_group through to the REST API path
- Unit tests for both the API function and routing logic
- No changes to the git-based code path or any existing inputs/outputs
Limitations
The same 3,000-file cap that applies to pulls.listFiles also applies to repos.compareCommits. This is a GitHub API limitation, not specific to this implementation.
Problem
When
use_rest_api: trueis set, onlypull_request*events are supported. Forpush,merge_group, and all other events,actions/checkoutis required. For large repositories, the checkout step adds significant time to workflows that only need to know which files changed (e.g., conditional job triggers, path-based filtering).This also creates a poor user experience for teams using merge queues. A workflow with
use_rest_api: trueworks correctly onpull_requestevents, but then fails when the same workflow triggers onmerge_groupas the PR moves into the merge queue — or onpushwhen it lands on the target branch. Users either have to addactions/checkout(losing the performance benefit) or maintain separate workflow configurations per event type.Proposed solution
Extend the REST API mode to support
pushandmerge_groupevents by using therepos.compareCommitsendpoint instead ofpulls.listFiles. The webhook payload already contains the necessary SHAs:payload.before/payload.afterpayload.merge_group.base_sha/payload.merge_group.head_shaBoth endpoints return files in the same shape (
filename,status,previous_filename), so all downstream processing (filtering, dir_names, output formatting, etc.) works without changes.Prior art
This pattern is proven in the wild. Two maintained forks of jitterbit/get-changed-files use
repos.compareCommitsfor API-only changed file detection across event types, with no checkout required:pull_request,pull_request_target, andpushvia APIpull_request,pull_request_target,push, andmerge_groupvia APIScope
getChangedFilesFromGithubAPIinchangedFiles.ts— branch endpoint selection by event typemain.ts— allow push/merge_group through to the REST API pathLimitations
The same 3,000-file cap that applies to
pulls.listFilesalso applies torepos.compareCommits. This is a GitHub API limitation, not specific to this implementation.