From 6c4cf6563c04569f442961b7d61d11ab6caaa51c Mon Sep 17 00:00:00 2001 From: lacatoire Date: Fri, 7 Aug 2026 09:53:17 +0200 Subject: [PATCH] CI: check the XML structure of the PR head, not of the merge commit 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. --- .github/workflows/check-xml.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/check-xml.yml b/.github/workflows/check-xml.yml index c28e38e70..a24f7eb2c 100644 --- a/.github/workflows/check-xml.yml +++ b/.github/workflows/check-xml.yml @@ -19,9 +19,16 @@ jobs: name: "Check XML" runs-on: ubuntu-24.04 steps: + # The translation at the root, doc-en under en/: this is the layout + # check-structure.php expects. The explicit ref takes the real head of + # the pull request, not the merge commit actions/checkout builds by + # default: that one has master as its second parent, so the diff below + # would also list every file landed on master since the last push. + - name: "Checkout translation" uses: actions/checkout@v4 with: + ref: ${{ github.event.pull_request.head.sha }} fetch-depth: 0 - name: "Checkout php/doc-en"