Signed-off-by: Charles de Dreuille <charles.dedreuille@gmail.com>
This commit is contained in:
Charles de Dreuille
2025-09-19 07:21:25 +01:00
parent be63eb8056
commit f6b0e241a9
2 changed files with 30 additions and 1 deletions
+29
View File
@@ -58,6 +58,31 @@ jobs:
storybookBuildDir: dist-storybook
onlyChanged: true
- name: Extract Chromatic Details
if: github.event_name == 'pull_request' && steps.chromatic.outputs.url
id: extract-details
run: |
# Try to extract change count from Chromatic logs
# This is a best-effort approach as the exact log format may vary
echo "Extracting Chromatic details from logs..."
# Set default values
CHANGES_COUNT="Unknown"
STORIES_COUNT="Unknown"
# Try to find change count in various log patterns
if [ -f "$GITHUB_WORKSPACE/chromatic-output.log" ]; then
CHANGES_COUNT=$(grep -oP '(\d+)\s+changes?' "$GITHUB_WORKSPACE/chromatic-output.log" | head -1 | grep -oP '\d+' || echo "Unknown")
STORIES_COUNT=$(grep -oP '(\d+)\s+stories?' "$GITHUB_WORKSPACE/chromatic-output.log" | head -1 | grep -oP '\d+' || echo "Unknown")
fi
# Output the extracted values
echo "changes-count=$CHANGES_COUNT" >> $GITHUB_OUTPUT
echo "stories-count=$STORIES_COUNT" >> $GITHUB_OUTPUT
echo "Changes detected: $CHANGES_COUNT"
echo "Stories affected: $STORIES_COUNT"
- name: Post Chromatic Link in PR Comment
if: github.event_name == 'pull_request' && steps.chromatic.outputs.url
uses: mshick/add-pr-comment@v2
@@ -73,6 +98,10 @@ jobs:
| [**Build Details**](${{ steps.chromatic.outputs.buildUrl }}) | See detailed build information |
| [**Live Storybook**](${{ steps.chromatic.outputs.storybookUrl }}) | Browse the interactive component library |
### 📊 Build Summary
- **Changes detected**: ${{ steps.extract-details.outputs.changes-count }}
- **Stories affected**: ${{ steps.extract-details.outputs.stories-count }}
---
*This comment is automatically updated when visual tests run.*
repo-token: ${{ secrets.GITHUB_TOKEN }}
+1 -1
View File
@@ -34,7 +34,7 @@
}
.bui-Button[data-variant='primary'] {
background-color: var(--bui-bg-solid);
background-color: red;
color: var(--bui-fg-solid);
&:hover {