1313 - ' workshop/**/*.md'
1414 workflow_dispatch :
1515
16- permissions :
17- contents : write
18- pull-requests : write
19- copilot-requests : write
16+ permissions : {}
2017
2118concurrency :
2219 group : localization-sync-main
2320 cancel-in-progress : false
2421
2522jobs :
26- localize :
27- name : Update localized documentation
23+ generate :
24+ name : Generate localized documentation
2825 runs-on : ubuntu-latest
2926 timeout-minutes : 45
27+ permissions :
28+ contents : read
29+ copilot-requests : write
30+ outputs :
31+ changed : ${{ steps.detect.outputs.changed }}
32+ changed_files : ${{ steps.detect.outputs.changed_files }}
3033 steps :
3134 - name : Checkout repository
3235 uses : actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
@@ -110,8 +113,56 @@ jobs:
110113
111114 rm .localization-changed-files.txt
112115
113- - name : Guard generated changes
116+ - name : Upload generated localization tree
114117 if : steps.detect.outputs.changed == 'true'
118+ uses : actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
119+ with :
120+ name : localization-output
121+ path : |
122+ localizations
123+ docs/locale-registry.js
124+ include-hidden-files : true
125+ if-no-files-found : error
126+ retention-days : 1
127+
128+ validate :
129+ name : Validate generated localization
130+ needs : generate
131+ if : needs.generate.outputs.changed == 'true'
132+ runs-on : ubuntu-latest
133+ timeout-minutes : 10
134+ permissions :
135+ contents : read
136+ outputs :
137+ changed : ${{ steps.generated.outputs.changed }}
138+ steps :
139+ - name : Checkout trusted repository
140+ uses : actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
141+ with :
142+ persist-credentials : false
143+
144+ - name : Set up Node.js
145+ uses : actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
146+ with :
147+ node-version : 22
148+
149+ - name : Set up Python
150+ uses : actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
151+ with :
152+ python-version : " 3.11"
153+
154+ - name : Download generated localization tree
155+ uses : actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
156+ with :
157+ name : localization-output
158+ path : ${{ runner.temp }}/localization-output
159+
160+ - name : Materialize generated localization tree
161+ run : |
162+ python3 scripts/materialize_localization_artifact.py \
163+ "${{ runner.temp }}/localization-output"
164+
165+ - name : Guard generated changes
115166 id : generated
116167 run : |
117168 python3 scripts/check_localization_updates.py \
@@ -129,15 +180,47 @@ jobs:
129180
130181 - name : Validate localized site
131182 if : steps.generated.outputs.changed == 'true'
183+ run : bash scripts/validate-workshop.sh content
184+
185+ publish :
186+ name : Publish localization pull request
187+ needs : [generate, validate]
188+ if : needs.validate.outputs.changed == 'true'
189+ runs-on : ubuntu-latest
190+ timeout-minutes : 10
191+ permissions :
192+ contents : write
193+ pull-requests : write
194+ steps :
195+ - name : Checkout trusted repository
196+ uses : actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
197+ with :
198+ fetch-depth : 0
199+ persist-credentials : false
200+
201+ - name : Set up Python
202+ uses : actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
203+ with :
204+ python-version : " 3.11"
205+
206+ - name : Download validated localization tree
207+ uses : actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
208+ with :
209+ name : localization-output
210+ path : ${{ runner.temp }}/localization-output
211+
212+ - name : Materialize validated localization tree
132213 run : |
133- node docs/tests/workshop-site.test.js
134- python3 scripts/validate_workshop.py
214+ python3 scripts/materialize_localization_artifact.py \
215+ "${{ runner.temp }}/localization-output"
135216
136217 - name : Create localization review pull request
137- if : steps.generated.outputs.changed == 'true'
138218 uses : peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e # v7.0.8
139219 with :
140220 token : ${{ github.token }}
221+ add-paths : |
222+ localizations
223+ docs/locale-registry.js
141224 branch : automation/localization-sync
142225 base : main
143226 delete-branch : true
@@ -147,7 +230,7 @@ jobs:
147230 GitHub Copilot CLI ran the repository-local localization skill for these English sources requiring synchronization:
148231
149232 ```
150- ${{ steps.detect .outputs.changed_files }}
233+ ${{ needs.generate .outputs.changed_files }}
151234 ```
152235
153236 This pull request updates only existing locales. Please review translation quality and the localization baselines before merging.
0 commit comments