-
Notifications
You must be signed in to change notification settings - Fork 42
42 lines (42 loc) · 1.34 KB
/
translations.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
name: Update translation widgets
on:
workflow_dispatch:
inputs:
languages:
description: 'Languages to update translation widgets for.'
required: true
default: 'i18n/*.json'
jobs:
translations:
runs-on: ubuntu-latest
steps:
- name: Load Repository
uses: actions/checkout@v4
with:
token: ${{ secrets.WIKIBOT_TOKEN }}
- name: Update Widgets
run: |
sudo apt update
sudo apt-get install inkscape
for language in ${{ github.event.inputs.languages }}
do
language=$(basename $language .json)
if [[ "$language" =~ [^[:lower:]-] ]]
then
echo "$language" is not a translation
else
wget https://translate.wikibot.de/widgets/wiki-bot/$language/discord/svg-badge.svg
convert -background none svg-badge.svg i18n/widgets/$language.png
rm svg-badge.svg
fi
done
- name: Commit changes
uses: EndBug/add-and-commit@v9
with:
author_name: WikiBot-bot
author_email: 69196528+WikiBot-bot@users.noreply.github.com
committer_name: WikiBot-bot
committer_email: 69196528+WikiBot-bot@users.noreply.github.com
message: "Update translation widgets"
add: "i18n/widgets/*.png"
github_token: ${{ secrets.WIKIBOT_TOKEN }}