feat(parameter editor): Add bulk add suggested parameters button #281
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: Compile .mo files | |
| on: | |
| workflow_dispatch: | |
| push: | |
| paths: | |
| - ardupilot_methodic_configurator/locale/**/ardupilot_methodic_configurator.po | |
| # prevent race conditions | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read | |
| jobs: | |
| compile-mo-files: | |
| permissions: | |
| contents: write # for creating branches and commits | |
| pull-requests: write # for creating PRs | |
| runs-on: ubuntu-latest | |
| env: | |
| MO_FILES_CHANGED: false | |
| steps: | |
| - name: Harden the runner (Audit all outbound calls) | |
| uses: step-security/harden-runner@20cf305ff2072d973412fa9b1e3a4f227bda3c76 # v2.14.0 | |
| with: | |
| egress-policy: audit | |
| - name: Checkout MethodicConfigurator | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: Set up Python | |
| uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 | |
| with: | |
| python-version: '3.x' | |
| cache: 'pip' | |
| cache-dependency-path: 'pyproject.toml' | |
| - name: Cache apt packages | |
| uses: actions/cache@8b402f58fbc84540c8b491a91e594a4576fec3d7 # v5.0.2 | |
| with: | |
| path: | | |
| /var/cache/apt/archives/*.deb | |
| /var/lib/apt/lists/* | |
| key: ${{ runner.os }}-apt-gettext-ubuntu2204 | |
| restore-keys: | | |
| ${{ runner.os }}-apt-gettext- | |
| ${{ runner.os }}-apt- | |
| - name: Install apt packages | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y gettext=0.21-14ubuntu2 | |
| - name: Compile translation .mo files from the .po files | |
| run: python create_mo_files.py | |
| - name: Stage changes | |
| run: | | |
| git add ardupilot_methodic_configurator/locale/**/ardupilot_methodic_configurator.mo | |
| if [ -n "$(git status --porcelain)" ]; then | |
| echo "MO_FILES_CHANGED=true" >> $GITHUB_ENV | |
| else | |
| echo "No changes to commit" | |
| fi | |
| - name: Create Pull Request | |
| if: env.MO_FILES_CHANGED == 'true' | |
| uses: peter-evans/create-pull-request@c0f553fe549906ede9cf27b5156039d195d2ece0 # v8.1.0 | |
| with: | |
| labels: i18n, automated-pr | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| branch: compile-mo-translation-files | |
| title: "Compile .mo translation files" | |
| commit-message: "chore(translations): Compile translation .mo files from the .po files" | |
| body: | | |
| This PR Compiles .mo files based on the latest changes to .po translation files. | |
| delete-branch: true |