Skip to content

get-changed-files: fix core.warn crash on multi-PR push events#229

Merged
jwbron merged 1 commit into
mainfrom
fix-get-changed-files-warning
Jul 9, 2026
Merged

get-changed-files: fix core.warn crash on multi-PR push events#229
jwbron merged 1 commit into
mainfrom
fix-get-changed-files-warning

Conversation

@jwbron

@jwbron jwbron commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Summary

actions/get-changed-files crashes with core.warn is not a function on push events when the pushed commit is associated with more than one open PR. The github-script core API method is core.warning; core.warn does not exist, and the test mock stubbed warn so the suite never caught it. The path fires exactly for stacked PRs (a commit that is the head of one PR and part of another), which is how #227 surfaced it: its "Testing with 'push' events" check dies on this line instead of warning and proceeding with the first associated PR.

One-line fix plus the matching test-mock rename.

cc @jeresig

Testing

  • npx vitest run actions/get-changed-files: 40 tests green, including the multi-PR warn path.
  • pnpm build (tsc) compiles clean.

The github-script core API method is core.warning; core.warn does not
exist. The call sits on the path taken only when a pushed commit is
associated with more than one open PR (stacked PRs), so instead of
warning and proceeding with the first PR, the action crashed with
'core.warn is not a function'.
@changeset-bot

changeset-bot Bot commented Jul 9, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 5637b13

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
get-changed-files Patch
check-for-changeset Patch
gerald-pr Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@khan-actions-bot khan-actions-bot requested review from a team, kevinb-khan and somewhatabstract and removed request for a team July 9, 2026 03:32
jwbron added a commit that referenced this pull request Jul 9, 2026
Cherry-picked from the standalone fix (PR #229) so this stacked PR's
own push-event CI can resolve its associated PRs: a stacked head commit
belongs to two open PRs, which is exactly the path that crashed. The
changeset stays with #229; this copy merges cleanly as the same patch.
@jwbron jwbron requested a review from jeresig July 9, 2026 04:28
@jwbron jwbron self-assigned this Jul 9, 2026

@jeresig jeresig left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh - good catch!

@jwbron jwbron merged commit a28b537 into main Jul 9, 2026
3 checks passed
@jwbron jwbron deleted the fix-get-changed-files-warning branch July 9, 2026 17:05
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.

2 participants