Report files reset during the translation batch (#23159)
* Add script to report reset files * Has the workflow report the reset files * Fix script name * Filter report by language * Update .github/workflows/create-translation-batch-pr.yml * Use build in array methods
This commit is contained in:
@@ -136,17 +136,25 @@ jobs:
|
||||
node script/i18n/lint-translation-files.js --check rendering
|
||||
git add translations/${{ matrix.language }} && git commit -m "Run script/i18n/lint-translation-files.js --check rendering" || echo "Nothing to commit"
|
||||
|
||||
- name: Check in CSV report
|
||||
run: |
|
||||
mkdir -p log
|
||||
csvFile=log/${{ matrix.language_code }}-resets.csv
|
||||
script/i18n/report-reset-files.js --report-type=csv --language=${{ matrix.language_code }} --log-file=/tmp/batch.log > $csvFile
|
||||
git add -f $csvFile && git commit -m "Check in ${{ matrix.language }} CSV report" || echo "Nothing to commit"
|
||||
|
||||
- name: Create Pull Request
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.DOCUBOT_REPO_PAT }}
|
||||
# We'll try to create the pull request based on the changes we pushed up in the branch.
|
||||
# If there are actually no differences between the branch and `main`, we'll delete it.
|
||||
run: |
|
||||
script/i18n/report-reset-files.js --report-type=pull-request-body --language=${{ matrix.language_code }} --log-file=/tmp/batch.log > /tmp/pr-body.txt
|
||||
git push origin ${{ steps.set-branch.outputs.BRANCH_NAME }}
|
||||
gh pr create -t "New translation batch for ${{ matrix.language }}" \
|
||||
gh pr create --title "New translation batch for ${{ matrix.language }}" \
|
||||
--base=main \
|
||||
--head=${{ steps.set-branch.outputs.BRANCH_NAME }} \
|
||||
-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 }}
|
||||
--body-file /tmp/pr-body.txt || git push origin :${{ steps.set-branch.outputs.BRANCH_NAME }}
|
||||
|
||||
# When the maximum execution time is reached for this job, Actions cancels the workflow run.
|
||||
# This emits a notification for the first responder to triage.
|
||||
|
||||
Reference in New Issue
Block a user