I18n: Set description of Crowdin PR using GH Actions (#78424)

* I18n: Set description of Crowdin PR using GH Actions

* pin action sha

* Apply suggestions from code review

Co-authored-by: Alex Khomenko <Clarity-89@users.noreply.github.com>

---------

Co-authored-by: Alex Khomenko <Clarity-89@users.noreply.github.com>
This commit is contained in:
Josh Hunt 2023-11-21 11:00:29 +00:00 committed by GitHub
parent 20f3a87bf5
commit 97c79f2c34
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -19,9 +19,10 @@ jobs:
name: Fix files
runs-on: ubuntu-latest
# write permission needed to commit changes back in
permissions:
contents: write
contents: write # needed to commit changes back into the PR
pull-requests: write # needed to update PR description
steps:
- uses: actions/checkout@v4
@ -40,7 +41,27 @@ jobs:
run: yarn i18n:extract
- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v5
uses: stefanzweifel/git-auto-commit-action@8756aa072ef5b4a080af5dc8fef36c5d586e521d # v5.0.0
with:
commit_message: "Github Action: Auto-fix i18n files"
file_pattern: public/locales/*/grafana.json
- name: Update PR description
uses: devindford/Append_PR_Comment@32dd2619cd96ac8da9907c416c992fe265233ca8 # v1.1.3
if: ${{ ! contains(github.event.pull_request.body, 'Steps for merging') }}
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
body-update-action: prefix
body-template: |
:robot: Automatic sync of translations from Crowdin.
Steps for merging:
1. Wait for the "Github Action: Auto-fix i18n files" commit that may be required for CI to pass.
2. A quick sanity check of the changes and approve. Things to look out for:
- No changes to the English strings. The source of truth is already in the main branch, NOT Crowdin.
- Translations maybe be removed if the English phrase was removed, but there should not be many of these
- Anything else that looks 'funky'. Ask if you're not sure.
3. Approve & (Auto-)merge. :tada:
If there's a conflict, close the pull request and **delete the branch**. Crowdin will recreate the pull request eventually.
Remember, the longer this pull request is open, the more likely it is that it'll get conflicts.