-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
51 additions
and
18 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
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 |