From d880b6c465657e9ece5269031fd9cbdb186e1f4d Mon Sep 17 00:00:00 2001 From: Ciaran O'Reilly Date: Sun, 29 Dec 2024 12:25:31 +0100 Subject: [PATCH] chore: allow running build and sync manually with specific tag --- .github/workflows/build.yml | 5 +++++ .github/workflows/sync-to-wp.yml | 10 +++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1061c87..5f63a3d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -7,6 +7,9 @@ on: required: false type: boolean default: false + tag: + required: false + type: string secrets: DUBBING_API_BASE_URL: required: false @@ -20,6 +23,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + with: + ref: ${{ inputs.tag || github.ref }} - name: Use Node.js uses: actions/setup-node@v4 diff --git a/.github/workflows/sync-to-wp.yml b/.github/workflows/sync-to-wp.yml index 31df9fc..198fcea 100644 --- a/.github/workflows/sync-to-wp.yml +++ b/.github/workflows/sync-to-wp.yml @@ -3,10 +3,18 @@ name: Sync to WordPress Theme on: release: types: [published] + workflow_dispatch: + inputs: + tag: + description: "Tag to sync (e.g. v1.0.0)" + required: true + type: string jobs: build: uses: ./.github/workflows/build.yml + with: + tag: ${{ inputs.tag || github.event.release.tag_name }} secrets: DUBBING_API_BASE_URL: ${{ secrets.DUBBING_API_BASE_URL }} TRANSCRIPTION_API_BASE_URL: ${{ secrets.TRANSCRIPTION_API_BASE_URL }} @@ -55,5 +63,5 @@ jobs: git config --global user.name 'github-actions[bot]' git config --global user.email 'github-actions[bot]@users.noreply.github.com' git add static/js/subdub-editor.js - git commit -m "Update subdub-editor.js to version ${{ github.event.release.tag_name }}" + git commit -m "Update subdub-editor.js to version ${{ github.event.release.tag_name || inputs.tag }}" git push origin HEAD:master