Skip to content

Commit 5a925af

Browse files
committed
Only force-refresh all snapshots on manual trigger
Scheduled runs now only refresh snapshots older than 24h (the existing default behavior of refresh-snapshots.js), and workflow_dispatch gains a force_all input to refresh everything on demand from the GitHub UI. Refs #22
1 parent d7b0ad8 commit 5a925af

1 file changed

Lines changed: 11 additions & 4 deletions

File tree

.github/workflows/refresh-snapshots.yml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,12 @@ name: Refresh snapshots
55
on:
66
schedule:
77
- cron: "0 6 * * *" # daily at 06:00 UTC
8-
workflow_dispatch: {}
8+
workflow_dispatch:
9+
inputs:
10+
force_all:
11+
description: "Force-refresh all snapshots, even ones less than 24h old"
12+
type: boolean
13+
default: false
914

1015
permissions:
1116
contents: write
@@ -24,9 +29,11 @@ jobs:
2429
- name: Install dependencies
2530
run: npm ci
2631

27-
# Force a fresh fetch of every snapshot regardless of age.
28-
- name: Refresh all HTML snapshots
29-
run: npm run refresh -- --force
32+
# Scheduled runs only refresh snapshots older than 24h. Manually
33+
# triggered runs can opt into refreshing every snapshot via the
34+
# "force_all" input.
35+
- name: Refresh HTML snapshots
36+
run: npm run refresh -- ${{ inputs.force_all && '--force' || '' }}
3037

3138
# Run the live assertions against the freshly fetched pages, so a site
3239
# that changed its markup turns this scheduled run red.

0 commit comments

Comments
 (0)