From 368258ec66927c00e9760efeb4735050740d9063 Mon Sep 17 00:00:00 2001 From: Vitor Mattos Date: Mon, 21 Sep 2026 21:59:17 -0300 Subject: [PATCH 1/2] fix: make screenshot report workflow valid Signed-off-by: Vitor Mattos --- .github/workflows/screenshot-failure-comment.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/screenshot-failure-comment.yml b/.github/workflows/screenshot-failure-comment.yml index 5c748b4..1ff8bd6 100644 --- a/.github/workflows/screenshot-failure-comment.yml +++ b/.github/workflows/screenshot-failure-comment.yml @@ -43,7 +43,6 @@ jobs: GH_REPO: ${{ github.repository }} PR_NUMBER: ${{ github.event.workflow_run.pull_requests[0].number }} RUN_ID: ${{ github.event.workflow_run.id }} - RUN_URL: ${{ github.event.workflow_run.html_url }} REPORT_BRANCH: screenshot-reports shell: bash run: | @@ -106,6 +105,7 @@ jobs: fi raw_base="https://raw.githubusercontent.com/$GH_REPO/$REPORT_BRANCH/$report_path" + run_url="https://github.com/$GH_REPO/actions/runs/$RUN_ID" marker='' summary_line="Screenshot output differs from the committed README image." @@ -131,7 +131,7 @@ $changed_pixels of $total_pixels pixels differ." $summary_line - [View workflow run]($RUN_URL) + [View workflow run]($run_url) ### Visual diff EOF @@ -166,7 +166,7 @@ $changed_pixels of $total_pixels pixels differ." If the visual change is expected, run: - `npm run screenshots:update` + \`npm run screenshots:update\` EOF existing_comment_id="$( @@ -187,7 +187,7 @@ $changed_pixels of $total_pixels pixels differ." $summary_line - [Open pull request](https://github.com/$GH_REPO/pull/$PR_NUMBER) · [View workflow run]($RUN_URL) + [Open pull request](https://github.com/$GH_REPO/pull/$PR_NUMBER) · [View workflow run]($run_url) ### Visual diff EOF From 293a036ca4e29a11ac768aa9ce3adc4605496e78 Mon Sep 17 00:00:00 2001 From: Vitor Mattos Date: Mon, 21 Sep 2026 21:59:50 -0300 Subject: [PATCH 2/2] fix: keep screenshot summary inside YAML block Signed-off-by: Vitor Mattos --- .github/workflows/screenshot-failure-comment.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/screenshot-failure-comment.yml b/.github/workflows/screenshot-failure-comment.yml index 1ff8bd6..01b2dc0 100644 --- a/.github/workflows/screenshot-failure-comment.yml +++ b/.github/workflows/screenshot-failure-comment.yml @@ -116,8 +116,7 @@ jobs: total_pixels="$(jq -r '.totalPixels' screenshot-artifacts/demo-screenshot-report.json)" ratio="$(jq -r '.ratio * 100' screenshot-artifacts/demo-screenshot-report.json)" max_ratio="$(jq -r '.maxDiffRatio * 100' screenshot-artifacts/demo-screenshot-report.json)" - summary_line="**Difference:** $(printf '%.4f' "$ratio")% · **Allowed:** $(printf '%.4f' "$max_ratio")% -$changed_pixels of $total_pixels pixels differ." + summary_line="$(printf '**Difference:** %.4f%% · **Allowed:** %.4f%% \\n%s of %s pixels differ.' "$ratio" "$max_ratio" "$changed_pixels" "$total_pixels")" elif [[ "$report_type" == "size" ]]; then committed_size="$(jq -r '"\(.committed.width)x\(.committed.height)"' screenshot-artifacts/demo-screenshot-report.json)" generated_size="$(jq -r '"\(.generated.width)x\(.generated.height)"' screenshot-artifacts/demo-screenshot-report.json)"