Skip to content

Commit 3d9751b

Browse files
committed
ci: fix crowdin-export action
1 parent c30b5f0 commit 3d9751b

File tree

2 files changed

+19
-13
lines changed

2 files changed

+19
-13
lines changed
Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,37 @@
11
name: Export translations from Crowdin
2-
on: [workflow_dispatch]
2+
on:
3+
workflow_dispatch:
4+
schedule:
5+
- cron: "0 0 * * *"
36
jobs:
47
sync:
58
runs-on: ubuntu-latest
69
env:
710
TIMER_CROWDIN_AUTH: ${{ secrets.TIMER_CROWDIN_AUTH }}
811
steps:
9-
- name: Checkout branch i18n-export
12+
- name: Prepare branch
1013
uses: actions/checkout@v4
1114
with:
1215
fetch-depth: 1
1316
token: ${{secrets.GITHUB_TOKEN}}
14-
ref: i18n-export
1517
- name: Test using Node.js
1618
uses: actions/setup-node@v1
1719
with:
18-
node-version: "v20.11.0"
20+
node-version: "v22"
1921
- name: Install ts-node
2022
run: npm i -g ts-node
2123
- name: Install dependencies
2224
run: npm install
2325
- name: Export translations
2426
run: ts-node ./script/crowdin/export-translation.ts
25-
- name: Commit change
26-
run: |
27-
git config --global user.name 'Crowdin Bot'
28-
git config --global user.email 'returnzhy1996@outlook.com'
29-
git add .
30-
git commit -m "Export translations by Github Action"
31-
- name: Push change
32-
run: git push
27+
- name: Test typescript
28+
uses: icrawl/action-tsc@v1
29+
- name: Create Pull Request
30+
uses: peter-evans/create-pull-request@v7
31+
with:
32+
commit-message: "i18n(download): download translations by bot"
33+
branch: crowdin-export/patch
34+
title: "i18n(download): download translations by bot"
35+
body: "Automated download translations from [Crowdin](https://crowdin.com/project/timer-chrome-edge-firefox)"
36+
author: "github-actions[bot] <github-actions[bot]@users.noreply.github.com>"
37+
labels: "i18n"

tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
"resolveJsonModule": true,
1717
"importHelpers": true,
1818
"moduleResolution": "node",
19+
"skipLibCheck": true,
1920
"paths": {
2021
"@api/*": [
2122
"src/api/*"
@@ -77,4 +78,4 @@
7778
"tsconfig-paths/register"
7879
]
7980
}
80-
}
81+
}

0 commit comments

Comments
 (0)