I18n: Github action to fix up i18n files in Crowdin files (#78191)

* I18n: Start github action to fix up i18n files after crowdin push

* finish action

* change message

* actions
This commit is contained in:
Josh Hunt 2023-11-15 16:21:30 +00:00 committed by GitHub
parent d090dab138
commit 0a5a86f20b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 47 additions and 0 deletions

1
.github/CODEOWNERS vendored
View File

@ -667,6 +667,7 @@ embed.go @grafana/grafana-as-code
/.github/workflows/ephemeral-instances-pr-opened-closed.yml @grafana/grafana-operator-experience-squad
/.github/workflows/create-security-patch-from-security-mirror.yml @grafana/grafana-delivery
/.github/workflows/core-plugins-build-and-release.yml @grafana/plugins-platform-frontend @grafana/plugins-platform-backend
/.github/workflows/i18n-crowdin-fix-files.yml @grafana/grafana-frontend-platform
# Generated files not requiring owner approval
/packages/grafana-data/src/types/featureToggles.gen.ts @grafanabot

View File

@ -0,0 +1,46 @@
# When Crowdin creates a pull request from the crowdin-service-branch branch,
# run `yarn i18n:extract` and commit the changed grafana.json files back into the PR
# to reformat crowdin's changes to prevent conflicts with our CI checks.
name: Fix Crowdin I18n files
on:
pull_request:
paths:
- 'public/locales/*/grafana.json'
branches:
- main # Only run on pull requests *target* main (will be merged into main)
jobs:
fix-files:
# Only run on pull requests *from* the crowdin-service-branch branch
if: github.head_ref == 'crowdin-service-branch'
name: Fix files
runs-on: ubuntu-latest
# write permission needed to commit changes back in
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
- uses: actions/setup-node@v4
with:
node-version: 20.9.0
cache: 'yarn'
- name: Install dependencies
run: yarn install
- name: Extract I18n files
run: yarn i18n:extract
- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "Github Action: Auto-fix i18n files"
file_pattern: public/locales/*/grafana.json