Skip to content

ci: Deepen the initial fetch so it can overlap with weblate. #85

ci: Deepen the initial fetch so it can overlap with weblate.

ci: Deepen the initial fetch so it can overlap with weblate. #85

name: Update translations from Weblate

Check failure on line 1 in .github/workflows/update-translations.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/update-translations.yml

Invalid workflow file

(Line: 18, Col: 9): Unexpected value 'with'
permissions:
contents: write
pull-requests: write
on:
schedule:
- cron: "0 10 * * 1"
workflow_dispatch:
jobs:
update-translations:
runs-on: ubuntu-latest
steps:
- name: Trigger a rebase in Weblate
run: |
pip install wlc
wlc --url https://hosted.weblate.org/api/ --key $WEBLATE_API_KEY pull zulip/zulip-flutter
with:
WEBLATE_API_KEY: ${{ secrets.WEBLATE_API_KEY }}
- uses: actions/checkout@v4
with:
# Enough such that even a still-out-of-date weblate will have shared history
fetch-depth: 50
- name: Fetch and merge from Weblate
# The commit message is generated in Weblate; see https://hosted.weblate.org/addon/17163/
run: |
git remote add weblate https://hosted.weblate.org/git/zulip/zulip-flutter/
git fetch weblate
# This may lag behind `main` if weblate is backlogged; this can
# theoretically cause the PR to not be able to auto-merged, though
# re-running the action once weblate has caught up should be
# sufficient to fix that.
git reset --hard weblate/main
- name: Clone Flutter SDK
# Upstream's version calculation fails with a shallow clone,
# so instead clone with `--filter=blob:none`.
run: |
git clone --filter=blob:none -b main https://github.com/flutter/flutter ~/flutter
TZ=UTC git --git-dir ~/flutter/.git log -1 --format='%h | %ci | %s' --date=iso8601-local
echo ~/flutter/bin >> "$GITHUB_PATH"
# The Flutter tool assumes the tip of tree is "origin/master"
# (or "upstream/master"):
# https://github.com/flutter/flutter/issues/160626
# TODO(upstream): make workaround unneeded
git --git-dir ~/flutter/.git update-ref refs/remotes/origin/master origin/main
- name: Update generated code
run: |
mkdir -p build
tools/check l10n --fix
git add lib/generated/l10n/
GIT_COMMITTER_NAME="Hosted Weblate" GIT_COMMITTER_EMAIL="[email protected]" \
git commit --amend -C HEAD
- name: Create Pull Request
uses: peter-evans/create-pull-request@v7
with:
branch: update-translations/weblate
delete-branch: true
title: Update translations from Weblate