Skip to content

Commit

Permalink
chore: debug CI
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaeelaudibert committed Feb 25, 2025
1 parent 7d59e5c commit 7e0449e
Showing 1 changed file with 23 additions and 2 deletions.
25 changes: 23 additions & 2 deletions .github/workflows/storybook-chromatic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -190,13 +190,29 @@ jobs:
name: failure-screenshots-${{ matrix.browser }}-${{ matrix.shard }}
path: frontend/__snapshots__/__failures__/

- name: Configure git diff log
run: git config --global --add safe.directory '*'

- name: Debug diff log
run: |
echo "=== BEGIN GIT DIFF ==="
DIFF_OUTPUT=$(git diff)
echo "$DIFF_OUTPUT"
if [ -z "$DIFF_OUTPUT" ]; then
echo "No changes detected in git diff"
fi
echo "=== END GIT DIFF ==="
- name: Count and optimize updated snapshots
id: diff
# Skip on forks
if: github.event.pull_request.head.repo.full_name == github.repository
run: |
git config --global --add safe.directory '*' # Calm git down about file ownership
git diff --name-status frontend/__snapshots__/ # For debugging
echo "Current directory: $(pwd)"
FRONTEND_DIFF_OUTPUT=$(git diff --name-status frontend/__snapshots__)
echo "=== BEGIN FRONTEND GIT DIFF ==="
echo "$FRONTEND_DIFF_OUTPUT"
echo "=== END FRONTEND GIT DIFF ==="
ADDED=$(git diff --name-status frontend/__snapshots__/ | grep '^A' | wc -l)
MODIFIED=$(git diff --name-status frontend/__snapshots__/ | grep '^M' | wc -l)
DELETED=$(git diff --name-status frontend/__snapshots__/ | grep '^D' | wc -l)
Expand Down Expand Up @@ -226,6 +242,11 @@ jobs:
fi
fi
echo "Snapshot changes:"
echo "Added: $ADDED"
echo "Modified: $MODIFIED"
echo "Deleted: $DELETED"
echo "Total: $TOTAL"
echo "${{ matrix.browser }}-${{ matrix.shard }}-added=$ADDED" >> $GITHUB_OUTPUT
echo "${{ matrix.browser }}-${{ matrix.shard }}-modified=$MODIFIED" >> $GITHUB_OUTPUT
echo "${{ matrix.browser }}-${{ matrix.shard }}-deleted=$DELETED" >> $GITHUB_OUTPUT
Expand Down

0 comments on commit 7e0449e

Please sign in to comment.