Smartling translations are updated for commit ec91d8fc55d5be6b597150a9d1ee0d91fb05837d from main #1765
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: Fix translations | |
on: | |
pull_request: | |
jobs: | |
i18n-fixes: | |
name: Fix translated files | |
runs-on: ubuntu-latest | |
if: startsWith(github.head_ref, 'smartling') | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
NODE_AUTH_TOKEN: ${{ secrets.ADJUST_NPM_TOKEN }} | |
steps: | |
- name: Checkout the full PR history | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.ref }} | |
fetch-depth: 0 | |
# Set up Node.js environment | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: "20.x" | |
registry-url: https://npm.pkg.github.com/ | |
scope: "@adjust" | |
# Install npm dependencies | |
- name: Install dependencies | |
working-directory: .github/scripts | |
run: npm install | |
# Run the .mjs script to fix translations and format modified files | |
- name: Run translation fixes script | |
working-directory: .github/scripts | |
run: node fixTranslations.mjs | |
# Check for modified files | |
- name: Check for modified files | |
id: git-check | |
run: echo "MODIFIED=$(if [ -n "$(git status --porcelain)" ]; then echo "true"; else echo "false"; fi)" >> "$GITHUB_OUTPUT" | |
# Commit and push changes if any files were modified | |
- name: Commit changes | |
if: ${{ steps.git-check.outputs.MODIFIED == 'true' }} | |
run: | | |
BRANCH_NAME=${GITHUB_HEAD_REF} | |
git config --global user.name "github-actions" | |
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
git checkout -B "$BRANCH_NAME" | |
git commit -am "Fix translated and formatted files" | |
git push origin "$BRANCH_NAME" |