Split workflow in two #1
Workflow file for this run
This file contains 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: Import translations from Weblate | ||
on: | ||
workflow_run: | ||
workflows: [Import translations from Weblate] | ||
types: [completed] | ||
jobs: | ||
import: | ||
runs-on: ubuntu-20.04 | ||
if: > | ||
github.event.workflow_run.event == 'pull_request' && | ||
github.event.workflow_run.conclusion == 'success' | ||
permissions: | ||
contents: write | ||
steps: | ||
- name: Download the patch artifact | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: sync-translations.patch | ||
run-id: ${{ github.event.workflow_run.id }} | ||
- name: Checkout the PR source branch | ||
run: | | ||
git config user.name "github-actions[bot]" | ||
git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | ||
git remote add weblate ${{ github.event.pull_request.head.repo.clone_url }} | ||
git fetch weblate | ||
git checkout ${{ github.event.pull_request.head.ref }} | ||
- name: Apply the patch | ||
run: git apply sync-translations.patch | ||
- name: Commit and push changes | ||
run: | | ||
git add . | ||
git commit -m "Import translations from Weblate" | ||
git push |