Skip to content

Commit ea17753

Browse files
committed
ci: autoupdating translation stats via PRs
1 parent 3996a5b commit ea17753

File tree

2 files changed

+44
-1
lines changed

2 files changed

+44
-1
lines changed
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Update translation guide status
2+
3+
on:
4+
workflow_dispatch:
5+
schedule:
6+
- cron: '0 3 1 * *'
7+
8+
jobs:
9+
update-dep:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: write
13+
pull-requests: write
14+
steps:
15+
- name: Checkout repository
16+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
17+
18+
- name: Setup Python
19+
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
20+
with:
21+
python-version: "3.13"
22+
23+
- name: Run script to update translation guide status
24+
run: |
25+
python -m pip install --upgrade pip
26+
python -m pip install babel
27+
python scripts/translation_stats.py
28+
29+
- name: Create Pull Request
30+
uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e # v7.0.8
31+
with:
32+
token: ${{ secrets.GITHUB_TOKEN }}
33+
commit-message: 'chore(translation): update translation guide status'
34+
title: 'chore(translation): update translation guide status'
35+
body: |
36+
This PR updates the translation guide status in the _static/translation_stats.json file.
37+
38+
_Auto-generated by [create-pull-request][1]_
39+
40+
[1]: https://github.com/peter-evans/create-pull-request
41+
branch: chore/update-translation-guide-status
42+
add-paths: '_static/translation_stats.json'
43+
delete-branch: true

scripts/translation_stats.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ def main():
100100
# Dump the results to a JSON file
101101
with open(STATIC_DIR / "translation_stats.json", "w") as f:
102102
import json
103-
json.dump(results, f, indent=4)
103+
json.dump(results, f, indent=2)
104104

105105
if __name__ == "__main__":
106106
main()

0 commit comments

Comments
 (0)