From b99e451f91157671d4fc224a573852a4c5c5d213 Mon Sep 17 00:00:00 2001 From: Benjamin Lu Date: Sun, 31 Aug 2025 13:42:09 -0400 Subject: [PATCH] [fix] Improve Storybook comment workflow status handling (#5273) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add condition to only run on version-bump branches - Handle additional build statuses (skipped, cancelled) with appropriate icons and messages - Improve readability by breaking long conditionals across multiple lines 🤖 Generated with [Claude Code](https://claude.ai/code) Co-authored-by: Claude --- .github/workflows/pr-storybook-comment.yaml | 24 ++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pr-storybook-comment.yaml b/.github/workflows/pr-storybook-comment.yaml index ab4d5ab46..53691d826 100644 --- a/.github/workflows/pr-storybook-comment.yaml +++ b/.github/workflows/pr-storybook-comment.yaml @@ -8,7 +8,10 @@ on: jobs: comment-storybook: runs-on: ubuntu-latest - if: github.repository == 'Comfy-Org/ComfyUI_frontend' && github.event.workflow_run.event == 'pull_request' + if: >- + github.repository == 'Comfy-Org/ComfyUI_frontend' + && github.event.workflow_run.event == 'pull_request' + && startsWith(github.event.workflow_run.head_branch, 'version-bump-') permissions: pull-requests: write actions: read @@ -97,7 +100,17 @@ jobs: ## 🎨 Storybook Build Status - ${{ fromJSON(steps.workflow-run.outputs.result).conclusion == 'success' && '✅' || '❌' }} **${{ fromJSON(steps.workflow-run.outputs.result).conclusion == 'success' && 'Build completed successfully!' || 'Build failed!' }}** + ${{ + fromJSON(steps.workflow-run.outputs.result).conclusion == 'success' && '✅' + || fromJSON(steps.workflow-run.outputs.result).conclusion == 'skipped' && 'â­ī¸' + || fromJSON(steps.workflow-run.outputs.result).conclusion == 'cancelled' && 'đŸšĢ' + || '❌' + }} **${{ + fromJSON(steps.workflow-run.outputs.result).conclusion == 'success' && 'Build completed successfully!' + || fromJSON(steps.workflow-run.outputs.result).conclusion == 'skipped' && 'Build skipped.' + || fromJSON(steps.workflow-run.outputs.result).conclusion == 'cancelled' && 'Build cancelled.' + || 'Build failed!' + }}** ⏰ Completed at: ${{ steps.completion-time.outputs.time }} UTC @@ -105,4 +118,9 @@ jobs: - [📊 View Workflow Run](${{ fromJSON(steps.workflow-run.outputs.result).html_url }}) --- - ${{ fromJSON(steps.workflow-run.outputs.result).conclusion == 'success' && '🎉 Your Storybook is ready for review!' || 'âš ī¸ Please check the workflow logs for error details.' }} + ${{ + fromJSON(steps.workflow-run.outputs.result).conclusion == 'success' && '🎉 Your Storybook is ready for review!' + || fromJSON(steps.workflow-run.outputs.result).conclusion == 'skipped' && 'â„šī¸ Chromatic was skipped for this PR.' + || fromJSON(steps.workflow-run.outputs.result).conclusion == 'cancelled' && 'â„šī¸ The Chromatic run was cancelled.' + || 'âš ī¸ Please check the workflow logs for error details.' + }}