You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Hackathon] fix(ci): a draft PR on the deployment_status trigger gets a green check that no later event replaces #650
ci run skips every draft pull request with exit 0, and prints:
::notice title=TestSprite::Skipping draft pull request #7; the gate runs once it is ready for review.
That promise only holds for the pull_request trigger, whose types include ready_for_review. With the deployment_status shape (shape A, the one for Vercel and other platforms that deploy every PR), marking a draft ready for review does not trigger a new deployment. So no new deployment_status event arrives, and the green testsprite-tests check from the skip stays on the head commit. The PR can be marked ready and merged with no tests run, even with the check required. The skip is meant to wait for the PR to be ready; here it lets the PR through for good.
Set GITHUB_ACTIONS=true and GITHUB_EVENT_NAME=deployment_status.
Point the event payload at deployment.sha=<sha>, and stub the API so GET /repos/{owner}/{repo}/commits/<sha>/pulls returns [{number:7,state:'open',draft:true,head:{sha:<sha>}}].
Run testsprite ci run --project proj_x --target-url https://app-abc123-team.vercel.app --fail-on-skipped.
Result: exit 0, the notice above, nothing dispatched, and GITHUB_OUTPUT reads total=0 passed=0 failed=0 skipped=0 timedOut=0.
DOCUMENTATION.md says the same thing for both shapes: "skips … draft pull requests (it runs again on ready_for_review)".
Details / implementation notes
Root cause: src/commands/ci.ts (runCiRun) checks github.draft whatever the event. readGithubRunContext returns kind: 'pull_request' for both events.
Fix (PR ready): skip drafts only when GITHUB_EVENT_NAME is pull_request or pull_request_target. On deployment_status, gate the draft's preview, which already exists.
The fix also corrects the DOCUMENTATION.md sentence and adds a unit test in ci-run.spec.ts that fails before the change. The full ci specs pass.
Related, but deliberately left out of this fix: when a branch is pushed before its PR is opened, the deployment_status run skips with exit 0 ("belongs to no pull request; nothing to gate"). That leaves the same lasting green on the commit once the PR is opened. Happy to follow up if you'd like it to exit non-zero or to gate the deployment without a preview name.
Confirmations
I have searched existing issues and this is not a duplicate.
I have provided my Discord identity above for reward coordination.
Could a maintainer add the needs-triage (and hackathon) label here? I opened this through the gh CLI, and contributors without repo access can't add labels (GitHub returns a permissions error). A fix with tests is ready to go once this is triaged. Thanks!
Activity
neromtoobad commentedon Oct 23, 2026
Could a maintainer add the
needs-triage(andhackathon) label here? I opened this through the gh CLI, and contributors without repo access can't add labels (GitHub returns a permissions error). A fix with tests is ready to go once this is triaged. Thanks!