-
Notifications
You must be signed in to change notification settings - Fork 233
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
github: Fix weblate action's rights, and update generated code. #1192
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -1,4 +1,7 @@ | ||||||
name: Update translations from Weblate | ||||||
permissions: | ||||||
contents: write | ||||||
pull-requests: write | ||||||
on: | ||||||
schedule: | ||||||
- cron: "0 10 * * 1" | ||||||
|
@@ -8,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" | ||||||
Comment on lines
+28
to
+30
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This will need an update to match recent changes in Probably this is a sign we should factor this part out as a tiny shell script in its own file. I'd be happy to do that as a followup after this PR, though. |
||||||
|
||||||
- name: Update generated code | ||||||
run: | | ||||||
./tools/check l10n --fix | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit:
Suggested change
The rule is that once there's a slash in the command name, it means a file by that name, and there's no search in PATH (or for shell functions or builtins). Docs: So a leading |
||||||
git add lib/generated/l10n/ | ||||||
git commit --amend -C HEAD | ||||||
|
||||||
- name: Create Pull Request | ||||||
uses: peter-evans/create-pull-request@v7 | ||||||
with: | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: once these steps are separated by blank lines, I feel like I want the enclosing
jobs:
to be separated by a blank line from its siblings — otherwise it feels like a bit of a visual-hierarchy inversion