Skip to content

chore(deps): update pre-commit hook astral-sh/ruff-pre-commit to v0.16.3 #577

chore(deps): update pre-commit hook astral-sh/ruff-pre-commit to v0.16.3

chore(deps): update pre-commit hook astral-sh/ruff-pre-commit to v0.16.3 #577

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:
# Do not run in forks; it only clutters fork repositories with unused branches.
if: ${{ !github.event.repository.fork }}
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@05e31511f85b41b11d1cf0ef85d0992719546e2c # v2.21.0
with:
egress-policy: audit
- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Set up Python
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.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@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8.1.1
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: 'docs(component editor): 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 }}