From adc12bb1ed0eed856db52c91909be160cdd1e5af Mon Sep 17 00:00:00 2001 From: Charles de Dreuille Date: Fri, 19 Sep 2025 10:50:03 +0100 Subject: [PATCH] Update verify_chromatic.yml Signed-off-by: Charles de Dreuille --- .github/workflows/verify_chromatic.yml | 46 ++++++++++++-------------- 1 file changed, 22 insertions(+), 24 deletions(-) diff --git a/.github/workflows/verify_chromatic.yml b/.github/workflows/verify_chromatic.yml index 6adf405f28..d2a684ec96 100644 --- a/.github/workflows/verify_chromatic.yml +++ b/.github/workflows/verify_chromatic.yml @@ -56,35 +56,12 @@ jobs: # https://www.chromatic.com/docs/custom-ci-provider#run-chromatic-on-external-forks-of-open-source-projects projectToken: chpt_dab72dc0f97d55b storybookBuildDir: dist-storybook - onlyChanged: false + onlyChanged: true externals: | packages/ui/**/*.css packages/ui/css/** packages/ui/src/**/*.css - - name: Debug - Show changed files - if: github.event_name == 'pull_request' - run: | - echo "=== Changed files in this PR ===" - git diff --name-only HEAD~1 HEAD || echo "No previous commit to compare" - echo "" - echo "=== CSS files in packages/ui ===" - find packages/ui -name "*.css" -type f || echo "No CSS files found" - echo "" - echo "=== Recent changes to CSS files ===" - git log --oneline --name-only -10 -- "packages/ui/**/*.css" || echo "No recent CSS changes" - echo "" - echo "=== Git diff for CSS files ===" - git diff HEAD~1 HEAD -- "packages/ui/**/*.css" || echo "No CSS changes in diff" - echo "" - echo "=== Chromatic config check ===" - if [ -f "chromatic.config.js" ]; then - echo "chromatic.config.js exists" - cat chromatic.config.js - else - echo "No chromatic.config.js found" - fi - - name: Post Chromatic Link in PR Comment if: github.event_name == 'pull_request' && steps.chromatic.outputs.url uses: mshick/add-pr-comment@v2 @@ -118,3 +95,24 @@ jobs: repo-token: ${{ secrets.GITHUB_TOKEN }} + + - name: Post Debug Comment (if Chromatic failed) + if: github.event_name == 'pull_request' && steps.chromatic.outputs.url == '' + uses: mshick/add-pr-comment@v2 + with: + message: | + ## 🚨 Chromatic Debug Info + + The Chromatic workflow ran but didn't produce a URL. This could mean: + - Chromatic failed to run + - No changes were detected + - Configuration issue + + **Debug Info:** + - Workflow triggered: ✅ + - Chromatic URL: `${{ steps.chromatic.outputs.url }}` + - Exit Code: `${{ steps.chromatic.outputs.code }}` + - Changed files: See workflow logs above + + Please check the [workflow logs](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}) for more details. + repo-token: ${{ secrets.GITHUB_TOKEN }}