Manual Translation Update #45
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: 'Manual Translation Update' | |
on: | |
workflow_dispatch: | |
inputs: | |
branch: | |
description: 'Branch to update' | |
required: true | |
default: 'master' | |
jobs: | |
update-translations: | |
runs-on: ubuntu-latest | |
name: "Download latest translations from Phrase.com and make a PR." | |
steps: | |
- name: Check out repo | |
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 | |
with: | |
fetch-depth: 0 | |
token: ${{ secrets.RELEASE_ACCESS_TOKEN }} | |
- name: Install Phrase CLI | |
uses: phrase/setup-cli@d1c415d0ff01efc1bb21287d60a547669d9331c5 | |
with: | |
version: '2.29.0' | |
- name: Prepend Phrase configuration | |
run: | | |
echo "phrase:" > .phrase.yml | |
echo " access_token: ${PHRASE_ACCESS_KEY}" >> .phrase.yml | |
echo " project_id: ${PHRASE_PROJECT_ID}" >> .phrase.yml | |
cat phrase_config.yml >> .phrase.yml | |
env: | |
PHRASE_ACCESS_KEY: ${{ secrets.PHRASE_ACCESS_KEY }} | |
PHRASE_PROJECT_ID: ${{ secrets.PHRASE_PROJECT_ID }} | |
- name: Download Translations from Phrase | |
run: phrase pull | |
- name: Remove .phrase.yml file | |
run: | | |
rm .phrase.yml | |
- name: Check for changes in translations folder | |
run: | | |
if git diff --quiet; then | |
echo "No changes detected in translations folder. Exiting." | |
else | |
echo "Changes detected:" | |
git diff | |
fi | |
- name: Create Pull Request | |
uses: peter-evans/create-pull-request@c5a7806660adbe173f04e3e038b0ccdcd758773c | |
with: | |
token: ${{ secrets.RELEASE_ACCESS_TOKEN }} | |
base: ${{ github.event.inputs.branch }} | |
branch: update-translations/${{ github.event.inputs.branch }} | |
title: "chore: Translation Update" | |
commit-message: "Update translations" | |
body: "This PR updates the translations from Phrase.com" |