123456789101112131415161718192021222324252627282930313233343536373839404142 |
- 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@v2
- 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 }}
|