mirror of
https://github.com/mozilla/pdf.js.git
synced 2026-06-26 01:55:48 +02:00
Merge pull request #20749 from calixteman/gh_action_locale
Add a gh action in order to create a PR containing a m-c l10n update
This commit is contained in:
commit
e37fbcbe00
49
.github/workflows/update_locales.yml
vendored
Normal file
49
.github/workflows/update_locales.yml
vendored
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
name: Update locales
|
||||||
|
|
||||||
|
on:
|
||||||
|
schedule:
|
||||||
|
- cron: "0 0 * * 5" # Every Friday at midnight UTC
|
||||||
|
workflow_dispatch: # Allow manual triggering
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
pull-requests: write
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
update-locales:
|
||||||
|
name: Update locales
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v6
|
||||||
|
|
||||||
|
- name: Use Node.js LTS
|
||||||
|
uses: actions/setup-node@v6
|
||||||
|
with:
|
||||||
|
node-version: lts/*
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: npm ci
|
||||||
|
|
||||||
|
- name: Import translations from mozilla-central
|
||||||
|
run: npx gulp importl10n
|
||||||
|
|
||||||
|
- name: Create Pull Request
|
||||||
|
env:
|
||||||
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
run: |
|
||||||
|
if [ -z "$(git status --porcelain l10n/)" ]; then
|
||||||
|
echo "No locale changes to commit."
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
git config user.name "github-actions[bot]"
|
||||||
|
git config user.email "github-actions[bot]@users.noreply.github.com"
|
||||||
|
git switch -C update-locales
|
||||||
|
git add l10n/
|
||||||
|
git commit -m "l10n: Update locale files"
|
||||||
|
git push --force origin update-locales
|
||||||
|
gh pr create \
|
||||||
|
--title "l10n: Update locale files" \
|
||||||
|
--body "Automated weekly update of locale files from mozilla-central." \
|
||||||
|
--label l10n || true
|
||||||
Loading…
x
Reference in New Issue
Block a user