Fix Transifex resource names and slugs #77
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
| # This workflow runs fix-transifex-resource-names.py nightly | |
| name: Fix Transifex resource names and slugs | |
| on: | |
| push: # after adding repositories to the openedx-translations repo | |
| branches: [ main ] | |
| paths: | |
| - 'transifex.yml' | |
| - '.github/workflows/extract-translation-source-files.yml' | |
| schedule: # Also run monthly just in case there's a stall slug/name update | |
| - cron: '0 0 1 * *' | |
| workflow_dispatch: # by request | |
| inputs: | |
| release_name: | |
| description: 'Release name e.g. redwood, sumac, , etc or main for the latest project (defaults to "main").' | |
| required: true | |
| default: main | |
| type: string | |
| dry_run: | |
| description: 'If true, will not make any changes to Transifex' | |
| required: false | |
| default: true | |
| type: boolean | |
| force_suffix: | |
| description: 'If true, will force suffix to be added to the resource Transifex slug' | |
| required: false | |
| default: false | |
| type: boolean | |
| jobs: | |
| resource-names: | |
| runs-on: ubuntu-latest | |
| steps: | |
| # Clones the openedx-translations repo | |
| - name: clone openedx/openedx-translations | |
| uses: actions/checkout@v5 | |
| # Sets up Python | |
| - name: setup python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| # Run the script | |
| - name: Fix transifex automatic resource names | |
| env: | |
| TRANSIFEX_API_TOKEN: ${{ secrets.TRANSIFEX_API_TOKEN }} | |
| RELEASE: ${{ inputs.release_name }} | |
| run: | | |
| make translations_scripts_requirements | |
| if [[ "${{ inputs.dry_run }}" == "true" ]]; then | |
| if [[ "${{ inputs.force_suffix }}" == "true" ]]; then | |
| make fix_force_suffix_dry_run_transifex_resource_names; | |
| else | |
| make fix_dry_run_transifex_resource_names; | |
| fi | |
| else | |
| if [[ "${{ inputs.force_suffix }}" == "true" ]]; then | |
| make fix_force_suffix_transifex_resource_names; | |
| else | |
| make fix_transifex_resource_names; | |
| fi | |
| fi |