Skip to content

Commit 32d0f9d

Browse files
authored
CI: check the XML structure of the PR head, not of the merge commit (#3193)
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.
1 parent a22ff31 commit 32d0f9d

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

.github/workflows/check-xml.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,17 @@ jobs:
1919
name: "Check XML"
2020
runs-on: ubuntu-22.04
2121
steps:
22+
# doc-fr à la racine, doc-en dans le sous-répertoire en/ : c'est
23+
# l'arborescence attendue par check-structure.php. Le ref explicite
24+
# prend la tête réelle de la PR, et non le commit de fusion que
25+
# actions/checkout construit par défaut : ce dernier a master pour
26+
# deuxième parent, donc le diff plus bas y verrait aussi tous les
27+
# fichiers arrivés sur master depuis le dernier push de la PR.
28+
2229
- name: "Checkout php/doc-fr"
2330
uses: actions/checkout@v4
2431
with:
32+
ref: ${{ github.event.pull_request.head.sha }}
2533
fetch-depth: 0
2634

2735
- name: "Checkout php/doc-en"

0 commit comments

Comments
 (0)