Diffinery

codician/diffinerypublic

Open-source, agent-first GitHub and GitHub Actions alternative that runs on your own Cloudflare account: git hosting, pull requests, code review and drop-in GitHub Actions YAML on Workers, Durable Objects, R2 and Containers.

Live test: skip when the Deploy run it follows deployed nothing

Deploy's gate skips a commit that is no longer main's tip; the Live test then has nothing
new to test, so it ends with a notice instead of a green run against the older site.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014R3J2i3cD96PEceUzqjks8
Claude authored signed1 parent da645f6commit 2fabb8eec4ca51720e91001eea0b0d52fb9e7b78Browse files
1 file changed+15−0
modified.github/workflows/live-test.yml+15−0View file
@@ -19,6 +19,8 @@
1919
2020 permissions:
2121 contents: read
22+ # To see whether the Deploy run it follows deployed anything.
23+ actions: read
2224
2325 concurrency:
2426 group: live-test
@@ -40,7 +42,20 @@
4042 steps:
4143 - name: Check the token
4244 id: token
45+ env:
46+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
47+ DEPLOY_RUN: ${{ github.event.workflow_run.id }}
4348 run: |
49+ if [ "$GITHUB_EVENT_NAME" = workflow_run ]; then
50+ # Deploy's gate skips a commit that is no longer main's tip (the newer commit's run deploys it):
51+ # then nothing new is live, and this run would only test the site as it was.
52+ deployed=$(curl -fsS "$GITHUB_API_URL/repos/$GITHUB_REPOSITORY/actions/runs/$DEPLOY_RUN/jobs" -H "Authorization: Bearer $GH_TOKEN" | jq -r '[.jobs[] | select(.name == "Deploy to Cloudflare") | .conclusion][0] // "unknown"' || echo unknown)
53+ if [ "$deployed" = skipped ]; then
54+ echo "::notice::Deploy deployed nothing for $HEAD_SHA (main has moved on), so there is nothing new to test"
55+ echo "skip=true" >> "$GITHUB_OUTPUT"
56+ exit 0
57+ fi
58+ fi
4459 if [ -z "$TOKEN" ]; then
4560 # After a deploy of diffinery.com a missing token is an error: a green run would mean nothing was tested.
4661 if [ "$GITHUB_EVENT_NAME" = workflow_run ]; then