Skip to content

Vehicle Config: JSON-driven QML page generation for configuration pages #29

Vehicle Config: JSON-driven QML page generation for configuration pages

Vehicle Config: JSON-driven QML page generation for configuration pages #29

Workflow file for this run

name: Crowdin Translations
# https://github.com/crowdin/github-action/tree/master
on:
push:
branches: [master]
paths: ['docs/en/**']
pull_request:
types: [closed]
branches: [master]
paths: ['docs/en/**']
schedule:
- cron: '0 0 * * 0' # Download translations every Sunday
workflow_dispatch:
inputs:
action:
description: 'Action to perform'
required: true
default: 'upload'
type: choice
options:
- upload
- download
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: false
jobs:
sync:
name: Crowdin Sync
if: github.repository_owner == 'mavlink'
runs-on: ubuntu-latest
timeout-minutes: 15
permissions:
contents: read
steps:
- name: Determine action
id: action
env:
EVENT_NAME: ${{ github.event_name }}
INPUT_ACTION: ${{ inputs.action }}
PR_MERGED: ${{ github.event.pull_request.merged }}
run: |
if [[ "$EVENT_NAME" == "schedule" ]] || [[ "$EVENT_NAME" == "workflow_dispatch" && "$INPUT_ACTION" == "download" ]]; then
echo "mode=download" >> "$GITHUB_OUTPUT"
elif [[ "$EVENT_NAME" == "push" ]] || [[ "$EVENT_NAME" == "pull_request" && "$PR_MERGED" == "true" ]] || [[ "$EVENT_NAME" == "workflow_dispatch" && "$INPUT_ACTION" == "upload" ]]; then
echo "mode=upload" >> "$GITHUB_OUTPUT"
else
echo "mode=skip" >> "$GITHUB_OUTPUT"
fi
- name: Harden Runner
if: steps.action.outputs.mode != 'skip'
uses: step-security/harden-runner@v2
with:
egress-policy: audit
- name: Checkout
if: steps.action.outputs.mode != 'skip'
uses: actions/checkout@v6
- name: Upload sources to Crowdin
if: steps.action.outputs.mode == 'upload'
uses: crowdin/github-action@v2
with:
config: 'docs/crowdin_docs.yml'
upload_sources: true
upload_translations: false
download_translations: false
crowdin_branch_name: master
env:
GITHUB_TOKEN: ${{ secrets.PX4BUILDBOT_ACCESSTOKEN }}
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_DOCS_PROJECT_ID }}
CROWDIN_PERSONAL_TOKEN: ${{ secrets.PX4BUILDBOT_CROWDIN_PERSONAL_TOKEN }}
- name: Download translations from Crowdin
if: steps.action.outputs.mode == 'download'
uses: crowdin/github-action@v2
with:
config: 'docs/crowdin_docs.yml'
upload_sources: false
upload_translations: false
download_translations: true
localization_branch_name: l10n_crowdin_docs_translations
crowdin_branch_name: master
create_pull_request: true
pull_request_title: 'New QGC guide translations (Crowdin)'
pull_request_body: 'New QGC guide Crowdin translations by [Crowdin GH Action](https://github.com/crowdin/github-action)'
pull_request_labels: 'translations, automated'
pull_request_base_branch_name: 'master'
env:
GITHUB_TOKEN: ${{ secrets.PX4BUILDBOT_ACCESSTOKEN }}
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_DOCS_PROJECT_ID }}
CROWDIN_PERSONAL_TOKEN: ${{ secrets.PX4BUILDBOT_CROWDIN_PERSONAL_TOKEN }}