Skip to content

i18n download strings #6

i18n download strings

i18n download strings #6

name: i18n download strings
on:
workflow_dispatch:
schedule:
- cron: '0 10 * * 1'
jobs:
download:
name: 'Download latest strings'
runs-on: ubuntu-latest
environment: 'deploy-production'
permissions:
# Give the default GITHUB_TOKEN write permission to commit and push the
# added or changed files to the repository.
contents: write
pull-requests: write
repository-projects: write
steps:
- name: Check out code
uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: ./.github/actions/setup
- name: Download i18n strings
run: 'yarn i18n-download-strings'
env:
LOKALISE_API_TOKEN: ${{ secrets.LOKALISE_API_TOKEN }}
LOKALISE_PROJECT_ID: ${{ secrets.LOKALISE_PROJECT_ID }}
- name: Compile i18n strings
run: 'yarn build-i18n'
- name: Validate the strings
run: 'yarn i18n-check -f react-intl --locales ./apps/dotcom/client/public/tla/locales/ --source en'
- name: Commit and push changes
if: always()
env:
GH_TOKEN: ${{ github.token }}
run: |
git config --global user.name 'huppy-bot[bot]'
git config --global user.email '128400622+huppy-bot[bot]@users.noreply.github.com'
git checkout -b update-i18n-strings
git add "*.json"
if git diff-index --quiet HEAD --; then
echo "No changes to commit"
exit 0
fi
git commit --no-verify -m '[automated] update i18n strings'
git push --set-upstream origin update-i18n-strings
gh pr create --title "[automated] update i18n strings" --body "This PR updates the i18n strings.
### Change type
- [x] \`other\`" --base main --head update-i18n-strings