Skip to content

Commit

Permalink
chore: update translations ci
Browse files Browse the repository at this point in the history
  • Loading branch information
arzola committed Jun 1, 2023
1 parent 56d2d0d commit f32f95d
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 10 deletions.
23 changes: 18 additions & 5 deletions .github/workflows/update-pot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,25 @@ jobs:
- name: Setup PHP with tools
uses: shivammathur/setup-php@v2
with:
php-version: '8.0'
php-version: '8.1'
tools: composer, wp-cli/wp-cli-bundle
- name: Update POT file
run: wp i18n make-pot . languages/pressbooks-aldine.pot --domain=pressbooks-aldine --slug=pressbooks-aldine --package-name="Aldine" --headers="{\"Report-Msgid-Bugs-To\":\"https://github.com/pressbooks/pressbooks-aldine/issues\"}"
- name: Commit updated POT file
uses: stefanzweifel/git-auto-commit-action@v4.16.0
- name: Create Pull Request for POT file
id: cprpot
uses: peter-evans/create-pull-request@v5
with:
commit_message: 'chore(l10n): update languages/pressbooks-aldine.pot'
file_pattern: '*.pot'
token: ${{ secrets.PAT_FOR_GITHUB_ACTIONS }}
labels: automerge-pot
commit-message: 'chore(l10n): update languages/pressbooks.pot'
title: 'chore(l10n): update languages/pressbooks.pot'
body: 'This pull request updates the POT file for the Pressbooks project.'
branch: chore/update-pot-file
- name: Merge pull request with updated POT file
if: ${{ steps.cprpot.outputs.pull-request-number }}
uses: "pascalgn/automerge-action@v0.15.6"
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
MERGE_LABELS: automerge-pot
MERGE_METHOD: squash
PULL_REQUEST: "${{ steps.cprpot.outputs.pull-request-number }}"
23 changes: 18 additions & 5 deletions .github/workflows/update-translations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,25 @@ jobs:
- name: Setup PHP with tools
uses: shivammathur/setup-php@v2
with:
php-version: '8.0'
php-version: '8.1'
tools: composer, wp-cli/wp-cli-bundle
- name: Generate MO files
run: wp i18n make-mo languages
- name: Commit updated translation files
uses: stefanzweifel/git-auto-commit-action@v4.16.0
- name: Create Pull Request for MO files
id: cprtransifex
uses: peter-evans/create-pull-request@v5
with:
commit_message: 'chore(l10n): update translations'
file_pattern: '*.mo'
token: ${{ secrets.PAT_FOR_GITHUB_ACTIONS }}
commit-message: 'chore(l10n): update languages/*.mo'
labels: automerge-mo
title: 'chore(l10n): update languages/*.mo'
body: 'This pull request updates the MO files for the latest changes in the POT file.'
branch: chore/update-mo-files
- name: Merge pull request with updated MO files
if: ${{ steps.cprtransifex.outputs.pull-request-number }}
uses: "pascalgn/automerge-action@v0.15.6"
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
MERGE_LABELS: automerge-mo
MERGE_METHOD: squash
PULL_REQUEST: "${{ steps.cprtransifex.outputs.pull-request-number }}"

0 comments on commit f32f95d

Please sign in to comment.