Skip to content

Commit 9c8f287

Browse files
ryan-williamsclaude
andcommitted
www.yml: Slack range floor only counts runs that actually deployed
The screenshot-regen branch of this workflow finishes with `success` but skips the Deploy step (gated on `steps.screenshots.outputs.REGENERATED != 'true'`). The previous "since last green deploy" logic just queried `workflow_runs?status=success` — which silently picked the no-op screenshot-regen run as the range floor, undercounting commits. Walk up to 10 recent successes and check each run's `Deploy to GH Pages` step conclusion; pick the first one that actually deployed. Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 73e1b88 commit 9c8f287

1 file changed

Lines changed: 15 additions & 8 deletions

File tree

.github/workflows/www.yml

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -143,19 +143,26 @@ jobs:
143143
with urllib.request.urlopen(req) as r:
144144
return json.load(r)
145145
146-
# Range floor = last *successful* run of this workflow on `www`,
147-
# NOT this push's `event.before`. Failed deploys can pile up
148-
# between successful ones; the user-facing site only changed at
149-
# the last green run, so the range should reflect that.
150-
# (The current run is in-progress when this step runs, so the
151-
# `status=success` filter naturally excludes it.)
146+
# Range floor = last run that *actually deployed* (not just
147+
# passed). Failed deploys stack between successes; the
148+
# screenshot-regen branch of this workflow finishes successfully
149+
# but skips the Deploy step. Querying `status=success` alone
150+
# would pick up those no-op runs, so we additionally check each
151+
# run's `Deploy to GH Pages` step conclusion.
152152
prev_sha = None
153153
runs = gh(f'/repos/{repo_slug}/actions/workflows/www.yml/runs?status=success&branch=www&per_page=10')
154154
for r in runs.get('workflow_runs', []):
155155
if str(r['id']) == run_id:
156156
continue # belt-and-suspenders; shouldn't appear
157-
prev_sha = r['head_sha']
158-
break
157+
jobs = gh(f'/repos/{repo_slug}/actions/runs/{r["id"]}/jobs')
158+
deployed = any(
159+
s.get('name') == 'Deploy to GH Pages' and s.get('conclusion') == 'success'
160+
for j in jobs.get('jobs', [])
161+
for s in j.get('steps', [])
162+
)
163+
if deployed:
164+
prev_sha = r['head_sha']
165+
break
159166
160167
commits = []
161168
if prev_sha and prev_sha != sha:

0 commit comments

Comments
 (0)