Update po files
[phpmyadmin.git] / .github / workflows / update-po.yml
blob2bea1125649046615e4d90fe28e17b64d5b6559e
1 name: Update translation files
3 on:
4   workflow_dispatch:
5   schedule:
6     - cron: '0 0 * * 0'
8 permissions:
9   contents: read
11 jobs:
12   update-po:
13     permissions:
14       contents: write  # for Git to git push
15     name: Update po files
16     runs-on: ubuntu-latest
17     # Source: https://github.community/t/do-not-run-cron-workflows-in-forks/17636/2?u=williamdes
18     if: (github.event_name == 'schedule' && github.repository == 'phpmyadmin/phpmyadmin') || (github.event_name != 'schedule')
19     strategy:
20       matrix:
21         php-version: ["8.2"]
22     steps:
23       - name: Checkout code
24         uses: actions/checkout@v4
26       - name: Install Gettext
27         run: |
28           sudo apt-get install -y gettext
30       - name: Set up PHP ${{ matrix.php-version }}
31         uses: shivammathur/setup-php@v2
32         with:
33           php-version: ${{ matrix.php-version }}
34           tools: composer:v2
36       - name: Install Composer dependencies
37         uses: ramsey/composer-install@v3
39       - name: Set up git config
40         run: |
41           git config user.name "phpMyAdmin bot"
42           git config user.email bot@phpmyadmin.net
44       - name: Update PO files
45         run: |
46           ./bin/update-po
48       - name: Push changes
49         run: |
50           git push