translations.yml 1.3 KB

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