update-translation-strings.yml 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. name: Update translation strings
  2. on:
  3. schedule:
  4. - cron: '0 5 * * *'
  5. workflow_dispatch:
  6. permissions:
  7. contents: write
  8. env:
  9. LOCALE: "en"
  10. jobs:
  11. makemessages:
  12. if: github.repository == 'netbox-community/netbox'
  13. runs-on: ubuntu-latest
  14. env:
  15. NETBOX_CONFIGURATION: netbox.configuration_testing
  16. steps:
  17. - name: Create app token
  18. uses: actions/create-github-app-token@v1
  19. id: app-token
  20. with:
  21. app-id: 1076524
  22. private-key: ${{ secrets.HOUSEKEEPING_SECRET_KEY }}
  23. - name: Check out repo
  24. uses: actions/checkout@v4
  25. with:
  26. token: ${{ steps.app-token.outputs.token }}
  27. - name: Set up Python
  28. uses: actions/setup-python@v5
  29. with:
  30. python-version: 3.11
  31. - name: Install system dependencies
  32. run: sudo apt install -y gettext
  33. - name: Install Python dependencies
  34. run: |
  35. python -m pip install --upgrade pip
  36. pip install -r requirements.txt
  37. - name: Run makemessages
  38. run: python netbox/manage.py makemessages -l ${{ env.LOCALE }}
  39. - name: Commit changes
  40. uses: EndBug/add-and-commit@v9
  41. with:
  42. add: 'netbox/translations/'
  43. default_author: github_actions
  44. message: 'Update source translation strings'