ci: add per-PR EN-Revision hash check#788
Conversation
|
@lacatoire , the filtering of XML files and inputting of |
|
The And no, it doesn't run once on empty data: $ n=0; while IFS= read -r f; do n=$((n+1)); done < <(printf ''); echo "$n"
0(That's also why |
|
Cool. I do not know that bash is that "functional style" capable. |
|
Note to myself: check if this CI does not conflict with revcheck / consecutive skip-revcheck. |
|
Uma boa verificação na minha opinião. Às vezes esqueço de atualizar o rev-tag ou não envio uma tradução que não é da última revisão. |
|
Pode desconsiderar o "Note to myself" acima, ao avaliar esse PR. Após uma triste noite, eu re-descobri que o CI do GH desconsidera alterações no main/master. Ele faz um merge no master, sim, mas em um master no passado, não do presente. Como não é algo que não faz sentido para mim, isso não fica na minha cabeça. Só para alertar, caso não já não soubesse desse detalhe. Isso não faz tanta diferença na tradução aqui, que quase nunca tem PRs concorrentes, mas é... triste, em repositórios com muitas alterações e/ou muitos PRs. Mas fica também a pergunta, se há interesse que o CI aqui faça testes com um merge no master atual em vez do passado, que daí eu posso tentar, dentro das minhas limitadas capacidades, alterar o CI nesse sentido. |
Adds a GitHub Actions workflow that runs on every pull request and verifies that the
EN-Revisionheader in modified XML files points to the latestdoc-encommit for that file.How it works
pull_requestevents targetingmaster.xmlfiles changed in the PRdoc-en, reads the declaredEN-Revisionhashgit log -1on the matchingdoc-enfile::errorannotation and fails if the hash is missing or outdatedThis ensures that translation updates always reference the exact upstream commit they are based on, making future sync work easier to track.
Prior art
This check is already in use in
doc-fr,doc-ru, anddoc-es. There is also an ongoing initiative indoc-baseto provide reusable workflows that alldoc-*repos can share.