Add cron action for automatic translations pull

Testing for now, if everything works properly, I'll update the schedule
This commit is contained in:
JustArchi 2020-08-03 22:55:08 +02:00
parent 1f60265502
commit db1ba37b59

73
.github/workflows/translations.yml vendored Normal file
View file

@ -0,0 +1,73 @@
name: ASF-translations
on:
schedule:
- cron: '*/10 * * * *'
jobs:
update:
strategy:
matrix:
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
submodules: recursive
- name: Download latest translations from Crowdin
uses: crowdin/github-action@1.0.9
with:
upload_sources: false
download_translations: true
skip_untranslated_strings: true
push_translations: false
crowdin_branch_name: master
project_id: ${{ secrets.ASF_CROWDIN_PROJECT_ID }}
token: ${{ secrets.ASF_CROWDIN_API_TOKEN }}
env:
GITHUB_TOKEN: 'not-used' # TODO: https://github.com/crowdin/github-action/pull/30
- name: Commit the changes to wiki
shell: sh
run: |
set -eu
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
cd wiki
git pull
git add -A "locale"
if ! git diff --cached --quiet; then
git commit -m "Automatic translations update"
fi
- name: Push changes to wiki
uses: ad-m/github-push-action@master
with:
directory: wiki
github_token: ${{ secrets.GITHUB_TOKEN }}
repository: JustArchiNET/ArchiSteamFarm.wiki
- name: Commit the changes to ASF
shell: sh
run: |
set -eu
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git add -A "ArchiSteamFarm/Localization" "wiki"
if ! git diff --cached --quiet; then
git commit -m "Automatic translations update"
fi
- name: Push changes to ASF
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}