Skip to content
This repository has been archived by the owner on Feb 22, 2023. It is now read-only.

Commit

Permalink
Fix PO generation workflow (#1550)
Browse files Browse the repository at this point in the history
* Checkout using checkout action

* Remove workflow testing code

* Re-checkout main branch

Because the `translations` branch has nothing in it except for the
README and the openverse.pot file, the post-run actions for our
`setup-node-env` action is unable to run (it won't be able to find the
files it needs). Therefore, we need to recheckout the `main` branch.
I've gone ahead and updated the initial checkout to also be explicit
about the branch it checks out so that the intention here is clear.
  • Loading branch information
sarayourfriend authored Jul 1, 2022
1 parent 1e6e641 commit f99feec
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions .github/workflows/generate_pot.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Generate translation POT file
name: Generate translation PO file

on:
push:
Expand All @@ -11,21 +11,32 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: main

- uses: ./.github/actions/setup-node-env

- name: Generate POT
- name: Generate PO
run: pnpm i18n:generate-pot

- name: Copy to root
run: cp ./openverse.pot /tmp/openverse.pot

- name: Update POT on translations branch
- name: Checkout `translations` branch
uses: actions/checkout@v3
with:
ref: translations

- name: Update POT on `translations` branch
run: |
git checkout translations
rm openverse.pot
cp /tmp/openverse.pot openverse.pot
git config --global user.name 'POT Updater'
git config --global user.email 'openverse@wordpress.org'
git commit -am 'Update POT file'
git push
- name: Re-checkout `main` branch to allow for cleanup to work
uses: actions/checkout@v3
with:
ref: main

0 comments on commit f99feec

Please sign in to comment.