Avoid large Component Fixtures step outputs

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: d04b3d01-1bb4-4c9e-af2a-86b97a8934c5
This commit is contained in:
Henning Dieterichs
2026-08-04 18:19:01 +02:00
committed by Henning Dieterichs
parent e81c3289cc
commit fc2e19ea36
+18 -26
View File
@@ -164,14 +164,8 @@ jobs:
|| {
echo "match=false" >> "$GITHUB_OUTPUT"
cat /tmp/blocks-ci-stderr.txt >&2
CONTENT=$(cat /tmp/blocks-ci-updated.md)
echo "content<<BLOCKS_CI_EOF" >> "$GITHUB_OUTPUT"
echo "$CONTENT" >> "$GITHUB_OUTPUT"
echo "BLOCKS_CI_EOF" >> "$GITHUB_OUTPUT"
PATCH=$(diff -u test/componentFixtures/blocks-ci-screenshots.md /tmp/blocks-ci-updated.md || true)
echo "patch<<BLOCKS_CI_PATCH_EOF" >> "$GITHUB_OUTPUT"
echo "$PATCH" >> "$GITHUB_OUTPUT"
echo "BLOCKS_CI_PATCH_EOF" >> "$GITHUB_OUTPUT"
diff -u test/componentFixtures/blocks-ci-screenshots.md /tmp/blocks-ci-updated.md \
> /tmp/blocks-ci.patch || true
}
- name: Upload screenshots as artifact
@@ -258,17 +252,15 @@ jobs:
id: diff
if: always()
run: |
BODY=$(node build/lib/screenshotDiffReport.ts \
node build/lib/screenshotDiffReport.ts \
https://hediet-screenshots.azurewebsites.net \
"${{ steps.base.outputs.base_sha }}" \
${{ github.sha }} \
"${{ steps.base_manifest.outputs.path }}" \
test/componentFixtures/.screenshots/current/manifest.json)
if [ -n "$BODY" ]; then
test/componentFixtures/.screenshots/current/manifest.json \
> /tmp/screenshot-diff-comment.md
if [ -s /tmp/screenshot-diff-comment.md ]; then
echo "has_changes=true" >> "$GITHUB_OUTPUT"
echo "body<<SCREENSHOT_EOF" >> "$GITHUB_OUTPUT"
echo "$BODY" >> "$GITHUB_OUTPUT"
echo "SCREENSHOT_EOF" >> "$GITHUB_OUTPUT"
else
echo "No screenshot changes to report."
fi
@@ -283,33 +275,33 @@ jobs:
if: always() && (steps.diff.outputs.has_changes == 'true' || steps.blocks-ci.outputs.match == 'false')
# Single source of truth for the markdown body shared by the job
# summary (the only surface fork PRs see) and the non-fork PR comment.
# Fixture rendering errors are already part of COMMENT_BODY via the
# Fixture rendering errors are already part of the screenshot diff via the
# "Errored" section emitted by screenshotDiffReport.ts, so reporting
# errors is not tied to blocks-ci here.
run: |
{
if [ -n "$COMMENT_BODY" ]; then
printf '%s\n' "$COMMENT_BODY"
if [ -s /tmp/screenshot-diff-comment.md ]; then
cat /tmp/screenshot-diff-comment.md
fi
if [ -n "$BLOCKS_CI_CONTENT" ]; then
if [ -n "$COMMENT_BODY" ]; then printf '\n---\n\n'; fi
if [ -s /tmp/blocks-ci-updated.md ]; then
if [ -s /tmp/screenshot-diff-comment.md ]; then printf '\n---\n\n'; fi
printf '### blocks-ci screenshots changed\n\n'
printf 'Replace the contents of `test/componentFixtures/blocks-ci-screenshots.md` with:\n\n'
printf '<details>\n<summary>Updated blocks-ci-screenshots.md</summary>\n\n'
printf '```md\n%s\n```\n\n' "$BLOCKS_CI_CONTENT"
printf '```md\n'
cat /tmp/blocks-ci-updated.md
printf '```\n\n'
printf '</details>\n'
if [ -n "$BLOCKS_CI_PATCH" ]; then
if [ -s /tmp/blocks-ci.patch ]; then
printf '\n<details open>\n<summary>Patch</summary>\n\n'
printf '```diff\n%s\n```\n\n' "$BLOCKS_CI_PATCH"
printf '```diff\n'
cat /tmp/blocks-ci.patch
printf '```\n\n'
printf '</details>\n'
fi
fi
} > /tmp/comment-body.md
echo "path=/tmp/comment-body.md" >> "$GITHUB_OUTPUT"
env:
COMMENT_BODY: ${{ steps.diff.outputs.body }}
BLOCKS_CI_CONTENT: ${{ steps.blocks-ci.outputs.content }}
BLOCKS_CI_PATCH: ${{ steps.blocks-ci.outputs.patch }}
- name: Write job summary
if: always() && steps.comment_body.outputs.path