Export translations #462
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Export translations | |
on: | |
schedule: | |
- cron: "0 12 * * *" # Run daily at 12PM UTC | |
workflow_dispatch: | |
jobs: | |
copy: | |
name: Export translations | |
runs-on: ubuntu-latest | |
steps: | |
- name: Clone l10n repository | |
uses: actions/checkout@v4 | |
with: | |
path: l10n_repo | |
- name: Clone main code repository | |
uses: actions/checkout@v4 | |
with: | |
repository: mozilla/blurts-server | |
fetch-depth: 0 | |
path: code_repo | |
- name: Copy translation files | |
run: | | |
# Use rsync to sync the content of the "locales" folder | |
# Exclude hidden files, the "en" folder, markdown files, license. | |
rsync -av --progress --exclude="en/*" --exclude="*.md" --exclude="LICENSE" --exclude=".*" l10n_repo/ code_repo/locales/ --delete | |
- name: Get the current date for PR title | |
run: echo "current_date=$(date +"%Y-%m-%d")" >> $GITHUB_ENV | |
- uses: peter-evans/create-pull-request@v6 | |
with: | |
path: code_repo | |
token: ${{ secrets.MONITOR_L10N_TOKEN }} | |
branch: l10n_automation | |
author: mozilla-pontoon <[email protected]> | |
title: "Import translations from l10n repository (${{ env.current_date }})" | |
commit-message: "Import translations from l10n repository (${{ env.current_date }})" | |
labels: l10n | |
delete-branch: true |