Skip to content

Commit aa5abda

Browse files
committed
Add a gh action in order to create a PR containing a m-c l10n update
1 parent 3ae6cdc commit aa5abda

1 file changed

Lines changed: 49 additions & 0 deletions

File tree

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Update locales
2+
3+
on:
4+
schedule:
5+
- cron: "0 0 * * 5" # Every Friday at midnight UTC
6+
workflow_dispatch: # Allow manual triggering
7+
8+
permissions:
9+
contents: write
10+
pull-requests: write
11+
12+
jobs:
13+
update-locales:
14+
name: Update locales
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- name: Checkout repository
19+
uses: actions/checkout@v6
20+
21+
- name: Use Node.js LTS
22+
uses: actions/setup-node@v6
23+
with:
24+
node-version: lts/*
25+
26+
- name: Install dependencies
27+
run: npm ci
28+
29+
- name: Import translations from mozilla-central
30+
run: npx gulp importl10n
31+
32+
- name: Create Pull Request
33+
env:
34+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
35+
run: |
36+
if [ -z "$(git status --porcelain l10n/)" ]; then
37+
echo "No locale changes to commit."
38+
exit 0
39+
fi
40+
git config user.name "github-actions[bot]"
41+
git config user.email "github-actions[bot]@users.noreply.github.com"
42+
git switch -C update-locales
43+
git add l10n/
44+
git commit -m "l10n: Update locale files"
45+
git push --force origin update-locales
46+
gh pr create \
47+
--title "l10n: Update locale files" \
48+
--body "Automated weekly update of locale files from mozilla-central." \
49+
--label l10n || true

0 commit comments

Comments
 (0)