gha: bump actions/checkout from 6.0.0 to 6.0.1 #72
Workflow file for this run
This file contains hidden or 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
| name: Update and pull python-docs-theme project | |
| on: | |
| push: | |
| branches: | |
| - 'main' | |
| paths-ignore: | |
| - 'docs/**' | |
| - '.readthedocs.yaml' | |
| - 'sample-workflows/**' | |
| pull_request: | |
| branches: | |
| - 'main' | |
| paths-ignore: | |
| - 'docs/**' | |
| - '.readthedocs.yaml' | |
| - 'sample-workflows/**' | |
| workflow_dispatch: | |
| inputs: | |
| push: | |
| description: "Push source strings and translations to Transifex" | |
| type: boolean | |
| pull: | |
| description: "Pull translations from Transifex" | |
| type: boolean | |
| schedule: | |
| - cron: '0 0 * * 1' | |
| env: | |
| TX_CLI_VERSION: '1.6.16' | |
| jobs: | |
| update: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Check out repository | |
| uses: actions/[email protected] | |
| with: | |
| ref: python-docs-theme | |
| - name: Check out python-docs-theme | |
| uses: actions/[email protected] | |
| with: | |
| repository: python/python-docs-theme | |
| persist-credentials: false | |
| path: python-docs-theme | |
| - name: Set up Python 3 | |
| uses: actions/[email protected] | |
| with: | |
| python-version: 3 | |
| cache: 'pip' | |
| cache-dependency-path: | | |
| python-docs-theme/requirements.txt | |
| - name: Install Transifex CLI | |
| working-directory: /usr/local/bin | |
| run: | | |
| curl -o- https://raw.githubusercontent.com/transifex/cli/master/install.sh | bash -s -- v${{ env.TX_CLI_VERSION }} | |
| - name: Install dependencies | |
| run: | | |
| sudo apt update -y && sudo apt install gettext -y | |
| pip3 install --upgrade pip | |
| pip3 install -r python-docs-theme/requirements.txt | |
| - name: Generate and store POT file | |
| run: | | |
| python python-docs-theme/babel_runner.py extract | |
| cp python-docs-theme/python_docs_theme/locale/python-docs-theme.pot . | |
| - name: Push source strings to Transifex | |
| if: ${{ github.event_name == 'schedule' || | |
| (github.event_name == 'workflow_dispatch' && github.event.inputs.push == 'true') }} | |
| id: tx_push | |
| run: | | |
| tx push --source --skip | |
| env: | |
| TX_TOKEN: ${{ secrets.TX_TOKEN }} | |
| - name: Pull translations for all languages | |
| if: ${{ github.event_name == 'schedule' || | |
| (github.event_name == 'workflow_dispatch' && github.event.inputs.pull == 'true') }} | |
| run: | | |
| tx pull --all --translations --force | |
| env: | |
| TX_TOKEN: ${{ secrets.TX_TOKEN }} | |
| - name: Commit changes | |
| run: | | |
| git config user.name github-actions[bot] | |
| git config user.email 41898282+github-actions[bot]@users.noreply.github.com | |
| git status | |
| git ls-files --others --exclude-standard -- python-docs-theme.pot | xargs -r git add -v | |
| git ls-files --others --exclude-standard -- ./*/LC_MESSAGES/python-docs-theme.po | xargs -r git add -v | |
| git diff -I'^"POT-Creation-Date: ' --numstat ./*/LC_MESSAGES/python-docs-theme.po python-docs-theme.pot | cut -f3 | xargs -r git add -v | |
| git diff-index --cached --quiet HEAD || { git commit -vm "Update translations from Transifex"; } | |
| - name: Push changes | |
| if: ${{ contains(fromJSON('["schedule", "workflow_dispatch"]'), github.event_name) }} | |
| run: | | |
| git push |