1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
name: Docs
on:
pull_request:
# The site itself builds in the CI workflow, after its lint job; this one keeps the
# translation-parity check, which has to re-run on a label and would drag the whole CI
# along with it there. `ready_for_review` is here because a draft runs nothing, as in the
# CI workflow. `labeled` / `unlabeled` are here because applying the escape-hatch label has
# to re-run the check, or the label leaves a stale red run blocking the merge.
types:
paths:
- docs/**
- website/i18n/**
- examples/**
# the testing and conformance guides embed their snippets from these test files
- tests/doc_*.rs
- tests/conformance_self.rs
- scripts/lint_doc_fences.py
- scripts/check_doc_i18n.py
- scripts/check_doc_parity.py
- scripts/doc_glossary.toml
- .github/workflows/docs.yml
permissions:
contents: read
concurrency:
group: docs-${{ github.ref }}
cancel-in-progress: true
jobs:
translation-parity:
name: Translation parity
# The label is for an edit confined to one language: spelling, grammar, or a word choice
# that was already right elsewhere. It suppresses this job only.
if: >-
github.event_name == 'pull_request'
&& !contains(github.event.pull_request.labels.*.name, 'docs-single-language')
&& !github.event.pull_request.draft
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
with:
persist-credentials: false
# The rule is a diff rule, so the merge base with the target branch has to be
# reachable.
fetch-depth: 0
- name: Check that an edit reached every language
# The branch name goes through the environment, not into the script text: a name is
# attacker-controlled input, and a template expansion inside `run` is an injection.
env:
BASE_REF: ${{ github.base_ref }}
run: python3 scripts/check_doc_parity.py --base "origin/$BASE_REF"