From fdc472c5c87a4bf1487d0add98f98c451c5ef630 Mon Sep 17 00:00:00 2001 From: lacatoire Date: Fri, 7 Aug 2026 09:52:05 +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 550ea31c3..0c83ae246 100644 --- a/.github/workflows/check-xml.yml +++ b/.github/workflows/check-xml.yml @@ -19,9 +19,16 @@ jobs: name: "Check XML" runs-on: ubuntu-22.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@v7 with: + ref: ${{ github.event.pull_request.head.sha }} fetch-depth: 0 - name: "Checkout php/doc-en"