Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use GitHub Action to fetch translations from Transifex daily
Everyday around 00:00 UTC (+/- some offset), this action will fetch translations from Transifex and commit them if there are any changes. This action will also be triggered by: - Updates to Python files - Updates to this file. - Manually from actions page. TRANSIFEX_API_TOKEN must be set up as a secret in the repository.
- Loading branch information
1 parent
7989f55
commit 880452e
Showing
1 changed file
with
51 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
name: Clerk work | ||
|
||
on: | ||
schedule: # Daily schedule. | ||
- cron: 0 0 * * * | ||
|
||
workflow_dispatch: {} # For manual switch in actions page. | ||
|
||
push: # Run on update to py files or this file on the main branch. | ||
branches: | ||
- main | ||
paths: | ||
- "**.py" | ||
- ".github/workflows/action.yml" | ||
# End of on. | ||
|
||
|
||
jobs: | ||
scheduled: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
cache: "pip" | ||
run: pip install -r requirements.txt | ||
|
||
- name: Run update script | ||
run: python3 fetch_latest.py | ||
env: | ||
TRANSIFEX_API_TOKEN: ${{ secrets.TRANSIFEX_API_TOKEN }} | ||
|
||
- name: Commit changes (if any) | ||
run: | | ||
if [[ $(git status -s) ]]; then | ||
git config user.name github-actions | ||
git config user.email github-actions[bot]@users.noreply.github.com | ||
git add . | ||
git commit -m "Auto fetch: $(date +'%Y-%m-%d %R')" | ||
git push | ||
fi | ||
# End of steps. | ||
# End of scheduled. | ||
# End of jobs. | ||
|
||
|
||
# End of file. |