Skip to content

Commit dcc5449

Browse files
authored
actions: Fix workflow_dispatch (#48330)
When this was added in #46895, it didn't add handling of the event.
1 parent 7603282 commit dcc5449

2 files changed

Lines changed: 16 additions & 0 deletions

File tree

.github/workflows/build-docker-monorepo.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,14 @@ jobs:
6161
elif [[ "$GITHUB_EVENT_NAME" == "pull_request" ]]; then
6262
gh_set_output tags "type=ref,event=pr"
6363
gh_set_output images "ghcr.io/automattic/jetpack-monorepo"
64+
elif [[ "$GITHUB_EVENT_NAME" == "workflow_dispatch" ]]; then
65+
if [[ "$GITHUB_REF" == "refs/heads/trunk" ]]; then
66+
gh_set_output tags "type=raw,latest"
67+
gh_set_output images $'automattic/jetpack-wordpress-dev\nghcr.io/automattic/jetpack-wordpress-dev'
68+
else
69+
echo "Workflow dispatch for non-trunk ref $GITHUB_REF is not supported"
70+
exit 1
71+
fi
6472
else
6573
echo "Unknown GITHUB_EVENT_NAME $GITHUB_EVENT_NAME"
6674
exit 1

.github/workflows/build-docker.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,14 @@ jobs:
6363
elif [[ "$GITHUB_EVENT_NAME" == "pull_request" ]]; then
6464
gh_set_output tags "type=ref,event=pr"
6565
gh_set_output images "ghcr.io/automattic/jetpack-wordpress-dev"
66+
elif [[ "$GITHUB_EVENT_NAME" == "workflow_dispatch" ]]; then
67+
if [[ "$GITHUB_REF" == "refs/heads/trunk" ]]; then
68+
gh_set_output tags "type=raw,latest"
69+
gh_set_output images $'automattic/jetpack-wordpress-dev\nghcr.io/automattic/jetpack-wordpress-dev'
70+
else
71+
echo "Workflow dispatch for non-trunk ref $GITHUB_REF is not supported"
72+
exit 1
73+
fi
6674
else
6775
echo "Unknown GITHUB_EVENT_NAME $GITHUB_EVENT_NAME"
6876
exit 1

0 commit comments

Comments
 (0)