From f99feec7a2163c90d408cf3137738e931aedbf49 Mon Sep 17 00:00:00 2001 From: sarayourfriend <24264157+sarayourfriend@users.noreply.github.com> Date: Fri, 1 Jul 2022 11:06:41 +1000 Subject: [PATCH] Fix PO generation workflow (#1550) * 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. --- .github/workflows/generate_pot.yml | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/.github/workflows/generate_pot.yml b/.github/workflows/generate_pot.yml index ce8fae691a..9ff6d80cdb 100644 --- a/.github/workflows/generate_pot.yml +++ b/.github/workflows/generate_pot.yml @@ -1,4 +1,4 @@ -name: Generate translation POT file +name: Generate translation PO file on: push: @@ -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