Skip to content

feat(derived parameters): gracefully catch errors when deriving param… #269

feat(derived parameters): gracefully catch errors when deriving param…

feat(derived parameters): gracefully catch errors when deriving param… #269

name: Update Vehicle Components Strings
on:
push:
paths:
- 'ardupilot_methodic_configurator/vehicle_templates/**/vehicle_components.json'
- 'ardupilot_methodic_configurator/vehicle_components_schema.json'
pull_request:
paths:
- 'ardupilot_methodic_configurator/vehicle_templates/**/vehicle_components.json'
- 'ardupilot_methodic_configurator/vehicle_components_schema.json'
# Run on schedule to catch any manual changes to files
schedule:
- cron: '0 0 * * 0' # Weekly on Sunday at midnight
# Enable manual trigger
workflow_dispatch:
# prevent race conditions
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
update-strings:
permissions:
contents: write # for creating branches and commits
pull-requests: write # for creating PRs
runs-on: ubuntu-latest
env:
STRINGS_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 repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Set up Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: '3.10'
- name: Generate vehicle components strings
run: |
python update_vehicle_components_translation.py
- name: Check for changes
run: |
git add ardupilot_methodic_configurator/vehicle_components.py
if [ -n "$(git status --porcelain)" ]; then
echo "STRINGS_CHANGED=true" >> $GITHUB_ENV
else
echo "No changes to commit"
fi
- name: Create Pull Request
if: env.STRINGS_CHANGED == 'true'
uses: peter-evans/create-pull-request@c0f553fe549906ede9cf27b5156039d195d2ece0 # v8.1.0
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: 'Auto-update vehicle components translatable strings'
title: 'Update vehicle components translatable strings'
body: |
This PR updates the vehicle_components.py file with new translatable strings.
These strings were automatically extracted from the vehicle_components.json template files
and the vehicle_components_schema.json schema file.
This PR was triggered by changes to one or more files.
branch: update-vehicle-components-strings
delete-branch: true
labels: automated-pr, i18n
reviewers: ${{ github.actor }}