From 3006271465ef4ece8cdcec85073c395214011c9f Mon Sep 17 00:00:00 2001 From: Brad Jorsch Date: Mon, 27 Apr 2026 15:13:40 -0400 Subject: [PATCH] actions: Fix workflow_dispatch When this was added in #46895, it didn't add handling of the event. --- .github/workflows/build-docker-monorepo.yml | 8 ++++++++ .github/workflows/build-docker.yml | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/.github/workflows/build-docker-monorepo.yml b/.github/workflows/build-docker-monorepo.yml index 325a439199e1..becf603926d1 100644 --- a/.github/workflows/build-docker-monorepo.yml +++ b/.github/workflows/build-docker-monorepo.yml @@ -61,6 +61,14 @@ jobs: elif [[ "$GITHUB_EVENT_NAME" == "pull_request" ]]; then gh_set_output tags "type=ref,event=pr" gh_set_output images "ghcr.io/automattic/jetpack-monorepo" + elif [[ "$GITHUB_EVENT_NAME" == "workflow_dispatch" ]]; then + if [[ "$GITHUB_REF" == "refs/heads/trunk" ]]; then + gh_set_output tags "type=raw,latest" + gh_set_output images $'automattic/jetpack-wordpress-dev\nghcr.io/automattic/jetpack-wordpress-dev' + else + echo "Workflow dispatch for non-trunk ref $GITHUB_REF is not supported" + exit 1 + fi else echo "Unknown GITHUB_EVENT_NAME $GITHUB_EVENT_NAME" exit 1 diff --git a/.github/workflows/build-docker.yml b/.github/workflows/build-docker.yml index 0eea8672abbf..7e8304082408 100644 --- a/.github/workflows/build-docker.yml +++ b/.github/workflows/build-docker.yml @@ -63,6 +63,14 @@ jobs: elif [[ "$GITHUB_EVENT_NAME" == "pull_request" ]]; then gh_set_output tags "type=ref,event=pr" gh_set_output images "ghcr.io/automattic/jetpack-wordpress-dev" + elif [[ "$GITHUB_EVENT_NAME" == "workflow_dispatch" ]]; then + if [[ "$GITHUB_REF" == "refs/heads/trunk" ]]; then + gh_set_output tags "type=raw,latest" + gh_set_output images $'automattic/jetpack-wordpress-dev\nghcr.io/automattic/jetpack-wordpress-dev' + else + echo "Workflow dispatch for non-trunk ref $GITHUB_REF is not supported" + exit 1 + fi else echo "Unknown GITHUB_EVENT_NAME $GITHUB_EVENT_NAME" exit 1