-
Notifications
You must be signed in to change notification settings - Fork 4
48 lines (43 loc) · 1.56 KB
/
fix_translations.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
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:
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: |
git config --global user.name "github-actions"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
git commit -am "Fix translated and formatted files"
git push