From 4e5bb3e540626a16a99a6f21612df0aee94acb33 Mon Sep 17 00:00:00 2001 From: Hunter Date: Mon, 9 Mar 2026 18:55:53 -0400 Subject: [PATCH] fix: dispatch cloud build on synchronize for preview-labeled PRs (#9636) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Summary Cloud build dispatch was only triggering on the `labeled` event, not on subsequent pushes to PRs that already had a preview label. ## Changes - **What**: Add `synchronize` to `pull_request` event types and update the `if` condition to support all three preview labels (`preview`, `preview-cpu`, `preview-gpu`). For `labeled` events, check the added label name; for `synchronize` events, check existing PR labels. ## Review Focus The `if` condition now branches on `github.event.action` to use the correct label-checking mechanism for each event type. ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-9636-fix-dispatch-cloud-build-on-synchronize-for-preview-labeled-PRs-31e6d73d3650814e9069e37d6199ffc9) by [Unito](https://www.unito.io) --- .github/workflows/cloud-dispatch-build.yaml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/workflows/cloud-dispatch-build.yaml b/.github/workflows/cloud-dispatch-build.yaml index 2302e40c77..16bb04c768 100644 --- a/.github/workflows/cloud-dispatch-build.yaml +++ b/.github/workflows/cloud-dispatch-build.yaml @@ -14,7 +14,7 @@ on: - 'cloud/*' - 'main' pull_request: - types: [labeled] + types: [labeled, synchronize] workflow_dispatch: permissions: {} @@ -26,11 +26,18 @@ concurrency: jobs: dispatch: # Fork guard: prevent forks from dispatching to the cloud repo. - # For pull_request events, only dispatch when the 'preview' label is added. + # For pull_request events, only dispatch for preview labels. + # - labeled: fires when a label is added; check the added label name. + # - synchronize: fires on push; check existing labels on the PR. if: > github.repository == 'Comfy-Org/ComfyUI_frontend' && (github.event_name != 'pull_request' || - github.event.label.name == 'preview') + (github.event.action == 'labeled' && + contains(fromJSON('["preview","preview-cpu","preview-gpu"]'), github.event.label.name)) || + (github.event.action == 'synchronize' && + (contains(github.event.pull_request.labels.*.name, 'preview') || + contains(github.event.pull_request.labels.*.name, 'preview-cpu') || + contains(github.event.pull_request.labels.*.name, 'preview-gpu')))) runs-on: ubuntu-latest steps: - name: Build client payload