Skip to content

CI: check the XML structure of the PR head, not of the merge commit - #1605

Open
lacatoire wants to merge 1 commit into
php:masterfrom
lacatoire:ci/check-xml-pr-head
Open

CI: check the XML structure of the PR head, not of the merge commit#1605
lacatoire wants to merge 1 commit into
php:masterfrom
lacatoire:ci/check-xml-pr-head

Conversation

@lacatoire

Copy link
Copy Markdown
Member

On a pull_request event, actions/checkout defaults to refs/pull/N/merge, whose second parent is the tip of master. The BASE...HEAD diff below it then lists the pull request plus everything landed on master since base.sha was frozen, and hands all of it to check-structure.php.

Measured on a pull request of another translation touching a single .yaml file:

diff files of which .xml
base.sha...merge commit (current) 300 294
base.sha...head.sha (this change) 1 0

The job failed on structural drift the pull request did not introduce. Checking out the head sha keeps the diff inside the pull request.

The layout the script expects, translation at the root and doc-en under en/, is now stated in the workflow too.

On a pull_request event, actions/checkout defaults to refs/pull/N/merge,
whose second parent is master. The BASE...HEAD diff therefore also lists
every file landed on master since the last push to the PR, and feeds them
to check-structure.php. A pull request touching a single non-XML file was
seen sending 294 unrelated .xml files to the check, failing on drift it
did not introduce.

Checking out the head sha restores the diff to the commits of the PR.

The expected directory layout is now noted in the workflow itself.
@lacatoire
lacatoire requested a review from a team as a code owner August 7, 2026 07:54
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