Fix get-changed-files action for schedule and workflow_dispatch events - #27078
Fix get-changed-files action for schedule and workflow_dispatch events#27078Ahmed Taha (SufficientDaikon) wants to merge 2 commits into
get-changed-files action for schedule and workflow_dispatch events#27078Conversation
… events The `Verify Markdown Links` workflow declares four triggers but `get-changed-files` only handles `pull_request` and `push`, causing every weekly Sunday cron run to fail with "Unsupported event type: schedule" since PR PowerShell#26219 (October 2025). Add a code path that uses the GitHub Trees API to enumerate all repository files for `schedule` and `workflow_dispatch` events, then feeds them through the existing filter and output logic. Update the markdownlinks action to pass the new event types. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Justin Chung (@jshigetomi) — This fixes the The existing CI is green. Happy to adjust anything. |
|
This pull request has been automatically marked as Review Needed because it has been there has not been any activity for 7 days. |
There was a problem hiding this comment.
Pull request overview
This pull request fixes the Verify Markdown Links workflow for schedule and workflow_dispatch runs by extending the internal get-changed-files composite action to support those event types (enumerating matching files via the GitHub Trees API), and wiring the markdown link-check action to opt into the new event routing.
Changes:
- Added
schedule/workflow_dispatchsupport toget-changed-filesby listing repository blobs viagithub.rest.git.getTree({ recursive: 'true' }). - Updated the
markdownlinkscomposite action to includeschedule,workflow_dispatchin its allowedevent-types. - Documented the new event support and usage examples in the
get-changed-filesREADME.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
Comments suppressed due to low confidence (1)
.github/actions/infrastructure/get-changed-files/README.md:12
- The feature bullet "Handles up to 100 changed files per request" is misleading/incorrect now that the action paginates PR file listings and the README later states "No file limit". This should be reworded to clarify that GitHub’s API returns 100 files per page, and the action paginates to fetch them all.
- Supports `schedule` and `workflow_dispatch` events (returns all matching files)
- Optional filtering by file pattern
- Returns files as JSON array for easy consumption
- Filters out deleted files (only returns added, modified, or renamed files)
- Handles up to 100 changed files per request

PR Summary
Fixes the
Verify Markdown Linksworkflow that has been failing every Sunday since October 2025. The underlyingget-changed-filesaction only handlespull_requestandpushevents but the workflow also usesscheduleandworkflow_dispatchtriggers.Fixes #27091.
Caution
Every scheduled run has been failing with this error since the workflow was introduced in #26219:
What Changed
get-changed-files/action.ymlschedule+workflow_dispatchevent handlers using GitHub Trees APImarkdownlinks/action.ymlevent-typesto includeschedule,workflow_dispatchget-changed-files/README.mdEvent Routing
The existing
pull_requestandpushcode paths are completely untouched. The new path only activates forscheduleandworkflow_dispatch:flowchart LR A["Trigger"] --> B{"Event type?"} B -->|pull_request| C["PR Files API\n(paginated)"] B -->|push| D["Commit\ncomparison"] B -->|schedule| E["Trees API\n(recursive)\n✨ NEW"] B -->|workflow_dispatch| E C --> F["Filter → check links"] D --> F E --> FFor
schedule/workflow_dispatchevents there is no diff to compare, so the new code path usesgithub.rest.git.getTreewithrecursive: 'true'to enumerate all blobs, then feeds them through the existing filter logic. Atree.truncatedwarning is logged if the repository exceeds GitHub's ~100K entry API limit.Tip
How to test after merge: Go to Actions → Verify Markdown Links → Run workflow → select
masterbranch. The next Sunday cron run will also exercise the new path.PR Context
The
get-changed-filescomposite action has code paths forpull_request(compare via PR files API with pagination) andpush(compare via commit comparison), but no path forscheduleorworkflow_dispatchevents. These events have no PR number and no before/after commit SHAs, so neither existing branch applies.The workflow was introduced in #26219 (October 2025) with the
scheduletrigger, but the action was never updated to support it.PR Checklist
.h,.cpp,.cs,.ps1and.psm1files have the correct copyright header