weblate-sync-pot #1067
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: weblate-sync-pot | |
on: | |
schedule: | |
# Run this every morning | |
- cron: '45 2 * * *' | |
# can be run manually on https://github.com/cockpit-project/cockpit-ostree/actions | |
workflow_dispatch: | |
jobs: | |
pot-upload: | |
environment: cockpit-ostree-weblate | |
permissions: | |
pull-requests: write | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up dependencies | |
run: | | |
sudo apt update | |
sudo apt install -y --no-install-recommends npm make gettext | |
- name: Clone source repository | |
uses: actions/checkout@v4 | |
with: | |
path: src | |
- name: Generate .pot file | |
run: make -C src po/cockpit-ostree.pot | |
- name: Clone weblate repository | |
uses: actions/checkout@v4 | |
with: | |
path: weblate | |
repository: ${{ github.repository }}-weblate | |
ssh-key: ${{ secrets.DEPLOY_KEY }} | |
- name: Commit .pot to weblate repo | |
run: | | |
cp src/po/cockpit-ostree.pot weblate/ | |
git config --global user.name "GitHub Workflow" | |
git config --global user.email "[email protected]" | |
git -C weblate commit -m "Update source file" -- cockpit-ostree.pot | |
git -C weblate push |