From 8981a14efb9d90b333f75a2c67fddc3ca8592250 Mon Sep 17 00:00:00 2001 From: Alex Vandiver Date: Fri, 20 Dec 2024 10:21:28 -0500 Subject: [PATCH 1/2] github: Elevate permisisons to allow creating branches and PRs. --- .github/workflows/update-translations.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/update-translations.yml b/.github/workflows/update-translations.yml index b0e934e287..e47774dd87 100644 --- a/.github/workflows/update-translations.yml +++ b/.github/workflows/update-translations.yml @@ -1,4 +1,7 @@ name: Update translations from Weblate +permissions: + contents: write + pull-requests: write on: schedule: - cron: "0 10 * * 1" From 527c3681f519b11106f2b24e068a1a192cfdd64c Mon Sep 17 00:00:00 2001 From: Alex Vandiver Date: Fri, 20 Dec 2024 10:23:01 -0500 Subject: [PATCH 2/2] github: Add steps to update generated code as well. --- .github/workflows/update-translations.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/.github/workflows/update-translations.yml b/.github/workflows/update-translations.yml index e47774dd87..54bf027c48 100644 --- a/.github/workflows/update-translations.yml +++ b/.github/workflows/update-translations.yml @@ -11,12 +11,30 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + - 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 git merge --ff-only weblate/main + + - name: Clone Flutter SDK + # We can't do a depth-1 clone, because we need the most recent tag + # so that Flutter knows its version and sees the constraint in our + # pubspec is satisfied. It's uncommon for flutter/flutter to go + # more than 100 commits between tags. Fetch 1000 for good measure. + run: | + git clone --depth=1000 -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" + + - name: Update generated code + run: | + ./tools/check l10n --fix + git add lib/generated/l10n/ + git commit --amend -C HEAD + - name: Create Pull Request uses: peter-evans/create-pull-request@v7 with: