Skip to content

Fix 3.14 branch #30

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: 3.14
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
62 changes: 62 additions & 0 deletions .github/workflows/pull-translations.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# Workflow from https://github.com/python-docs-translations/transifex-automations/blob/main/sample-workflows/transifex-pull.yml
name: Pull Translations from Transifex

on:
schedule:
- cron: '0 0 * * *'
workflow_dispatch:
permissions:
contents: write

jobs:
update-translation:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
version: [ '3.14' ]
steps:
- uses: styfle/cancel-workflow-action@main
with:
access_token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/setup-python@master
with:
python-version: 3
- name: Install Dependencies
run: |
sudo apt-get install -y gettext
pip install requests cogapp polib transifex-python sphinx-intl blurb six
curl -o- https://raw.githubusercontent.com/transifex/cli/master/install.sh | bash
working-directory: /usr/local/bin
- uses: actions/checkout@master
with:
ref: ${{ matrix.version }}
fetch-depth: 0
- run: curl -O https://raw.githubusercontent.com/python-docs-translations/transifex-automations/master/sample-workflows/transifex-util.py
- run: chmod +x transifex-util.py
- run: ./transifex-util.py recreate_tx_config --language id --project-slug python-newest --version 3.14
env:
TX_TOKEN: ${{ secrets.TX_TOKEN }}
- run: ./transifex-util.py fetch --language id --project-slug python-newest --version 3.14
env:
TX_TOKEN: ${{ secrets.TX_TOKEN }}
- run: ./transifex-util.py delete_obsolete_files --language id --project-slug python-newest --version 3.14
- name: Set up Git
run: |
git config --local user.email [email protected]
git config --local user.name "GitHub Action's update-translation job"
- name: Filter files
run: |
! git diff -I'^"POT-Creation-Date: ' \
-I'^"Language-Team: ' \
-I'^# ' -I'^"Last-Translator: ' \
--exit-code \
&& echo "SIGNIFICANT_CHANGES=1" >> $GITHUB_ENV || exit 0
- run: git add .
- run: git commit -m 'Update translation from Transifex'
if: env.SIGNIFICANT_CHANGES
- uses: ad-m/github-push-action@master
if: env.SIGNIFICANT_CHANGES
with:
branch: ${{ matrix.version }}
github_token: ${{ secrets.GITHUB_TOKEN }}
Loading