Skip to content

GitHub workflows: Fix changelog checks for forked PRs - #80487

Closed
mirka wants to merge 5 commits into
WordPress:trunkfrom
mirka:fix/fork-changelog-base-fetch
Closed

mirka wants to merge 5 commits into
WordPress:trunkfrom
mirka:fix/fork-changelog-base-fetch

Conversation

@mirka

@mirka mirka commented Jul 20, 2026 •

Copy link
Copy Markdown
Member

What?

Fixes the optional package changelog workflow to fetch the base branch history from the base repository instead of the pull request author's fork.

Why?

When a pull request comes from a fork whose trunk branch is behind upstream, the current fetch may not include the pull request's base SHA. The subsequent three-dot diff cannot resolve the merge base and may incorrectly skip the changelog check. This occurred in #80472.

How?

Fetches the base branch from $GITHUB_SERVER_URL/$GITHUB_REPOSITORY.git. These variables identify the repository running the workflow, so forked and same-repository pull requests use the upstream base history consistently.

Testing Instructions

This was tested in the draft PR by adding and then removing a temporary file under packages/components. Both testing commits are retained in the PR history.

  1. Open the test workflow run.
  2. Confirm the Components changelog check fetched trunk from WordPress/gutenberg.
  3. Confirm it reached the changelog validation and failed with Please add a CHANGELOG entry to packages/components/CHANGELOG.md instead of skipping due to an invalid diff.
  4. Confirm the other package matrix jobs passed.

@mirka mirka self-assigned this Jul 20, 2026
@github-actions github-actions Bot added the [Package] Components /packages/components label Jul 20, 2026
@mirka
mirka force-pushed the fix/fork-changelog-base-fetch branch from b2cb320 to 870c6c6 Compare July 20, 2026 18:28
@github-actions github-actions Bot removed the [Package] Components /packages/components label Jul 20, 2026
@github-actions github-actions Bot added the [Package] Components /packages/components label Jul 20, 2026
@github-actions github-actions Bot removed the [Package] Components /packages/components label Jul 20, 2026
@github-actions github-actions Bot added the [Package] Components /packages/components label Jul 21, 2026
@github-actions github-actions Bot removed the [Package] Components /packages/components label Jul 21, 2026
@mirka

mirka commented Jul 21, 2026

Copy link
Copy Markdown
Member Author

Superseded by #80538, which retains the baseline, fix, and cleanup commits along with both workflow runs.

@mirka mirka closed this Jul 21, 2026
@mirka
mirka deleted the fix/fork-changelog-base-fetch branch July 21, 2026 18:38
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.

1 participant