translations.yml 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. name: Update translations
  2. on:
  3. push:
  4. branches:
  5. - translations
  6. paths:
  7. - 'i18n/*.json'
  8. jobs:
  9. translations:
  10. runs-on: ubuntu-latest
  11. steps:
  12. - name: Load Repository
  13. uses: actions/checkout@v2
  14. with:
  15. token: ${{ secrets.WIKIBOT_TOKEN }}
  16. - name: Update Widgets
  17. run: |
  18. sudo apt-get install inkscape
  19. for language in i18n/*.json
  20. do
  21. language=$(basename $language .json)
  22. if [[ "$language" =~ [^[:lower:]-] ]]
  23. then
  24. echo "$language" is not a translation
  25. else
  26. wget https://translate.wikibot.de/widgets/wiki-bot/$language/discord/svg-badge.svg
  27. convert -background none svg-badge.svg i18n/widgets/$language.png
  28. rm svg-badge.svg
  29. fi
  30. done
  31. - name: Commit changes
  32. uses: EndBug/add-and-commit@v4
  33. with:
  34. author_name: WikiBot-bot
  35. author_email: 69196528+WikiBot-bot@users.noreply.github.com
  36. message: "Update translation widgets"
  37. add: "i18n/widgets/*.png"
  38. - name: Create Pull Request
  39. uses: repo-sync/pull-request@v2
  40. with:
  41. pr_title: "Update translations"
  42. pr_body: "Update translations from https://translate.wikibot.de/engage/wiki-bot/"
  43. pr_label: "translation"
  44. github_token: ${{ secrets.WIKIBOT_TOKEN }}