-
Notifications
You must be signed in to change notification settings - Fork 71
Expand file tree
/
Copy pathupdate_vehicle_components_translation.yaml
More file actions
81 lines (69 loc) · 2.82 KB
/
Copy pathupdate_vehicle_components_translation.yaml
File metadata and controls
81 lines (69 loc) · 2.82 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
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 }}