@@ -27,12 +27,12 @@ jobs:
2727 include :
2828 - language : pt-BR
2929 language_code : pt
30- # - language: zh-CN
31- # language_code: cn
32- # - language: ja-JP
33- # language_code: ja
34- # - language: es-ES
35- # language_code: es
30+ - language : zh-CN
31+ language_code : cn
32+ - language : ja-JP
33+ language_code : ja
34+ - language : es-ES
35+ language_code : es
3636 steps :
3737 - name : Set branch name
3838 id : set-branch
8989
9090 - name : Commit crowdin sync
9191 run : |
92- git add .
92+ git add translations/${{ matrix.language }}
9393 git commit -m "Add crowdin translations" || echo "Nothing to commit"
9494
9595 - name : ' Setup node'
@@ -99,54 +99,62 @@ jobs:
9999
100100 - run : npm ci
101101
102- - name : Reset files with broken liquid tags
103- run : |
104- node script/i18n/reset-files-with-broken-liquid-tags.js --language=${{ matrix.language_code }}
105- git add . && git commit -m "run script/i18n/reset-files-with-broken-liquid-tags.js --language=${{ matrix.language_code }}" || echo "Nothing to commit"
106-
107- # step 5 in docs-engineering/crowdin.md using script from docs-internal#22709
108- - name : Reset known broken files
109- run : |
110- node script/i18n/reset-known-broken-translation-files.js
111- git add . && git commit -m "run script/i18n/reset-known-broken-translation-files.js" || echo "Nothing to commit"
112- env :
113- GITHUB_TOKEN : ${{ secrets.DOCUBOT_REPO_PAT }}
114-
115102 # step 6 in docs-engineering/crowdin.md
116103 - name : Homogenize frontmatter
117104 run : |
118105 node script/i18n/homogenize-frontmatter.js
119- git add . && git commit -m "Run script/i18n/homogenize-frontmatter.js" || echo "Nothing to commit"
106+ git add translations/${{ matrix.language }} && git commit -m "Run script/i18n/homogenize-frontmatter.js" || echo "Nothing to commit"
120107
121108 # step 7 in docs-engineering/crowdin.md
122109 - name : Fix translation errors
123110 run : |
124111 node script/i18n/fix-translation-errors.js
125- git add . && git commit -m "Run script/i18n/fix-translation-errors.js" || echo "Nothing to commit"
112+ git add translations/${{ matrix.language }} && git commit -m "Run script/i18n/fix-translation-errors.js" || echo "Nothing to commit"
126113
127114 # step 8a in docs-engineering/crowdin.md
128115 - name : Check parsing
129116 run : |
130- node script/i18n/lint-translation-files.js --check parsing
131- git add . && git commit -m "Run script/i18n/lint-translation-files.js --check parsing" || echo "Nothing to commit"
117+ node script/i18n/lint-translation-files.js --check parsing | tee -a /tmp/batch.log | cat
118+ git add translations/${{ matrix.language }} && git commit -m "Run script/i18n/lint-translation-files.js --check parsing" || echo "Nothing to commit"
132119
133120 # step 8b in docs-engineering/crowdin.md
134121 - name : Check rendering
135122 run : |
136- node script/i18n/lint-translation-files.js --check rendering
137- git add . && git commit -m "Run script/i18n/lint-translation-files.js --check rendering" || echo "Nothing to commit"
123+ node script/i18n/lint-translation-files.js --check rendering | tee -a /tmp/batch.log | cat
124+ git add translations/${{ matrix.language }} && git commit -m "Run script/i18n/lint-translation-files.js --check rendering" || echo "Nothing to commit"
125+
126+ - name : Reset files with broken liquid tags
127+ run : |
128+ node script/i18n/reset-files-with-broken-liquid-tags.js --language=${{ matrix.language_code }} | tee -a /tmp/batch.log | cat
129+ git add translations/${{ matrix.language }} && git commit -m "run script/i18n/reset-files-with-broken-liquid-tags.js --language=${{ matrix.language_code }}" || echo "Nothing to commit"
130+
131+ # step 5 in docs-engineering/crowdin.md using script from docs-internal#22709
132+ - name : Reset known broken files
133+ run : |
134+ node script/i18n/reset-known-broken-translation-files.js | tee -a /tmp/batch.log | cat
135+ git add translations/${{ matrix.language }} && git commit -m "run script/i18n/reset-known-broken-translation-files.js" || echo "Nothing to commit"
136+ env :
137+ GITHUB_TOKEN : ${{ secrets.DOCUBOT_REPO_PAT }}
138+
139+ - name : Check in CSV report
140+ run : |
141+ mkdir -p log
142+ csvFile=log/${{ matrix.language_code }}-resets.csv
143+ script/i18n/report-reset-files.js --report-type=csv --language=${{ matrix.language_code }} --log-file=/tmp/batch.log > $csvFile
144+ git add -f $csvFile && git commit -m "Check in ${{ matrix.language }} CSV report" || echo "Nothing to commit"
138145
139146 - name : Create Pull Request
140147 env :
141148 GITHUB_TOKEN : ${{ secrets.DOCUBOT_REPO_PAT }}
142149 # We'll try to create the pull request based on the changes we pushed up in the branch.
143150 # If there are actually no differences between the branch and `main`, we'll delete it.
144151 run : |
152+ script/i18n/report-reset-files.js --report-type=pull-request-body --language=${{ matrix.language_code }} --log-file=/tmp/batch.log > /tmp/pr-body.txt
145153 git push origin ${{ steps.set-branch.outputs.BRANCH_NAME }}
146- gh pr create -t "New translation batch for ${{ matrix.language }}" \
154+ gh pr create --title "New translation batch for ${{ matrix.language }}" \
147155 --base=main \
148156 --head=${{ steps.set-branch.outputs.BRANCH_NAME }} \
149- -b "New batch for ${{ matrix.language }} created by [this workflow]($GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID)" || git push origin :${{ steps.set-branch.outputs.BRANCH_NAME }}
157+ --body-file /tmp/pr-body.txt || git push origin :${{ steps.set-branch.outputs.BRANCH_NAME }}
150158
151159 # When the maximum execution time is reached for this job, Actions cancels the workflow run.
152160 # This emits a notification for the first responder to triage.
0 commit comments