Skip to content

Commit 09144fb

Browse files
sserrataclaude
andcommitted
ci(deploy-preview): include capture script hash in prod-screenshots cache key
The cached production screenshots survive across runs. When the capture script changes (settle waits, scrollbar handling, crop-vs-pad, etc.), a new run's fresh preview captures are compared against prod screenshots taken under the old algorithm, producing asymmetric phantom diffs. Adding the script's content hash to the cache key auto-busts the cache on any change to capture behavior, eliminating the need for manual cache deletion after script updates. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent 82b553a commit 09144fb

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

.github/workflows/deploy-preview.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,12 @@ jobs:
255255
uses: actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
256256
with:
257257
path: visual_diffs/prod
258-
key: prod-screenshots-${{ steps.sitemap-hash.outputs.hash }}
258+
# The capture script's content is part of the cache key so changes to
259+
# capture behavior (settle waits, scrollbar handling, etc.) bust the
260+
# cache automatically. Without this, cached prod screenshots taken
261+
# under an older algorithm would be compared against fresh previews
262+
# taken under a newer one, producing asymmetric phantom diffs.
263+
key: prod-screenshots-${{ hashFiles('scripts/sitemap-visual-diff.ts') }}-${{ steps.sitemap-hash.outputs.hash }}
259264

260265
- name: Run visual diff
261266
run: yarn ts-node scripts/sitemap-visual-diff.ts --preview-url "$PREVIEW_URL" --summary-file visual_diffs/results.json --concurrency 4 --paths "/tests/"

0 commit comments

Comments
 (0)