File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55 branches :
66 - ' *'
77jobs :
8- update :
8+ update-translation :
99 runs-on : ubuntu-latest
1010 steps :
1111 - uses : actions/checkout@v1
1919 env :
2020 TX_TOKEN : ${{ secrets.TX_TOKEN }}
2121 - run : git config --local user.email 'maciej.olko@gmail.com'
22- - run : git config --local user.name 'Maciej Olko'
22+ - run : git config --local user.name "GitHub Action's update-translation job"
2323 - run : git commit -a -m 'Update translation from Transifex' || true
2424 - uses : ad-m/github-push-action@master
2525 with :
2626 github_token : ${{ secrets.GITHUB_TOKEN }}
2727 branch : 3.8
28+ update-readme :
29+ runs-on : ubuntu-latest
30+ steps :
31+ - uses : actions/checkout@v1
32+ - uses : actions/setup-python@v1
33+ with :
34+ python-version : 3.8
35+ - run : pip install requests numpy
36+ - run : ./manage_translations.py recreate_readme
37+ env :
38+ TX_TOKEN : ${{ secrets.TX_TOKEN }}
39+ - run : git config --local user.email 'maciej.olko@gmail.com'
40+ - run : git config --local user.name "GitHub Action's update-readme job"
41+ - run : git commit -a -m 'Update translation progress' || true
42+ - uses : ad-m/github-push-action@master
43+ with :
44+ github_token : ${{ secrets.GITHUB_TOKEN }}
45+ branch : 3.8
Original file line number Diff line number Diff line change @@ -82,8 +82,11 @@ def _get_resources():
8282 from requests import get
8383 resources = []
8484 offset = 0
85- with open ('.tx/api-key' ) as f :
86- transifex_api_key = f .read ()
85+ if os .path .exists ('.tx/api-key' ):
86+ with open ('.tx/api-key' ) as f :
87+ transifex_api_key = f .read ()
88+ else :
89+ transifex_api_key = os .getenv ('TX_TOKEN' )
8790 while True :
8891 response = get (
8992 f'https://api.transifex.com/organizations/python-doc/projects/{ PROJECT_SLUG } /resources/' ,
You can’t perform that action at this time.
0 commit comments