Skip to content

Commit

Permalink
Add workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
surapunoyousei committed Aug 15, 2024
1 parent e4b929f commit 8da2df4
Show file tree
Hide file tree
Showing 3 changed files with 85 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/update-langpack.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: (U) 🧰 Update Language packs

on:
workflow_dispatch:

jobs:
update--langpackas:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: configure git
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
- name: Setup git-cinnabar 🪛
run: |
mkdir ~/tools
cd ~/tools
git clone https://github.com/glandium/git-cinnabar.git
cd git-cinnabar
git checkout 0.5.11
export PATH=~/tools/git-cinnabar:$PATH
cd ~
git cinnabar download
- name: Update Language packs
run: |
for lang in $(cat ./supported-languages); do
./update-langpack.sh $lang
done
- name: Commit changes
run: |
git add .
git commit -m "[bot] Update Language packs"
git push
27 changes: 27 additions & 0 deletions supported-languages
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
ar
cs
da
de
el
en-GB
fr
hu
id
it
ja
ja-JP-mac
ko
lt
nl
nn-NO
pl
pt-BR
pt-PT
ru
sv-SE
th
tr
uk
vi
zh-CN
zh-TW
19 changes: 19 additions & 0 deletions update-tool.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash

langId=$1
currentDir=$(pwd)

echo "Updating language pack for $lang"

cd ./$langId

if [ ! -d .git ]; then
git init
fi

git remote add origin hg://hg.mozilla.org/l10n-central/$langId
git pull

cd $currentDir

echo "Update complete for $lang"

0 comments on commit 8da2df4

Please sign in to comment.