Skip to content

Fix get-changed-files action for schedule and workflow_dispatch events#27078

Open
SufficientDaikon wants to merge 1 commit intoPowerShell:masterfrom
SufficientDaikon:fix/markdown-links-schedule
Open

Fix get-changed-files action for schedule and workflow_dispatch events#27078
SufficientDaikon wants to merge 1 commit intoPowerShell:masterfrom
SufficientDaikon:fix/markdown-links-schedule

Conversation

@SufficientDaikon
Copy link
Copy Markdown

@SufficientDaikon SufficientDaikon commented Mar 22, 2026

PR Summary

Fixes the Verify Markdown Links workflow that has been failing every Sunday since October 2025. The underlying get-changed-files action only handles pull_request and push events but the workflow also uses schedule and workflow_dispatch triggers.

scope breaking existing

Fixes #27091.

Caution

Every scheduled run has been failing with this error since the workflow was introduced in #26219:

Unsupported event type: schedule. Supported types: pull_request, push

What Changed

File Change
get-changed-files/action.yml Add schedule + workflow_dispatch event handlers using GitHub Trees API
markdownlinks/action.yml Update event-types to include schedule,workflow_dispatch
get-changed-files/README.md Document new event type support with usage examples

Event Routing

The existing pull_request and push code paths are completely untouched. The new path only activates for schedule and workflow_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 --> F
Loading

For schedule/workflow_dispatch events there is no diff to compare, so the new code path uses github.rest.git.getTree with recursive: 'true' to enumerate all blobs, then feeds them through the existing filter logic. A tree.truncated warning is logged if the repository exceeds GitHub's ~100K entry API limit.

Tip

How to test after merge: Go to ActionsVerify Markdown LinksRun workflow → select master branch. The next Sunday cron run will also exercise the new path.


PR Context

The get-changed-files composite action has code paths for pull_request (compare via PR files API with pagination) and push (compare via commit comparison), but no path for schedule or workflow_dispatch events. 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 schedule trigger, but the action was never updated to support it.


PR Checklist

… 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>
@SufficientDaikon
Copy link
Copy Markdown
Author

@jshigetomi — This fixes the Verify Markdown Links scheduled workflow that has been failing every Sunday since it was introduced in #26219 (October 2025). Every scheduled run produces Unsupported event type: schedule because get-changed-files only handles pull_request and push events.

The existing pull_request and push code paths are completely untouched. The fix only adds a schedule/workflow_dispatch handler that uses the Trees API to enumerate all markdown files when there is no diff context.

CI is green. Happy to adjust anything.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Verify Markdown Links workflow fails on schedule and workflow_dispatch events

1 participant