mirror of
https://github.com/mozilla/pdf.js.git
synced 2026-06-06 18:21:10 +02:00
Moreover, we indicate the exact version that belongs to each commit
hash. This not only makes it easier to compare the hash against the
release tags in the actions repositories, but hopefully also makes it
easier for e.g. Dependabot to keep the comments up-to-date since not all
of them were correct and varying comment styles were in use. This commit
aligns all of them to a single `v{major}.{minor}.{patch}` style.
53 lines
1.5 KiB
YAML
53 lines
1.5 KiB
YAML
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@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
with:
|
|
persist-credentials: true
|
|
|
|
- name: Use Node.js LTS
|
|
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
|
|
with:
|
|
node-version: lts/*
|
|
cache: 'npm'
|
|
|
|
- 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
|