Skip to content

Fix CI/auto-label race condition on PR open#9

Merged
TGPSKI merged 3 commits intomainfrom
fix/ci-label-race
Apr 10, 2026
Merged

Fix CI/auto-label race condition on PR open#9
TGPSKI merged 3 commits intomainfrom
fix/ci-label-race

Conversation

@TGPSKI
Copy link
Copy Markdown
Owner

@TGPSKI TGPSKI commented Apr 10, 2026

Summary

Fixes the race condition where CI triggers on pull_request: opened before the auto-label workflow has added the ok-to-test label, causing CI to skip and the required status checks to block merge.

Root cause

  1. PR opens → pull_request: opened fires CI and pull_request_target: opened fires auto-label simultaneously
  2. CI evaluates if: contains(labels, 'ok-to-test') → label doesn't exist yet → skipped
  3. Auto-label adds ok-to-testpull_request: labeled fires CI again
  4. But the first skipped run already registered against the required status checks, blocking merge

Fix

Remove opened from CI's pull_request trigger types. CI now only triggers on:

  • labeled — fires after auto-label adds ok-to-test
  • synchronize — fires on new pushes (label already present)
  • reopened — fires on PR reopen (label already present)

This guarantees CI never evaluates before the label exists.

Remove `opened` from CI pull_request triggers so CI does not fire
before the auto-label workflow has added `ok-to-test`. CI now triggers
on `labeled` (after auto-label), `synchronize`, and `reopened` only.

Made-with: Cursor
Restructure action-integration-test workflow so the required status
check always reports. A `changes` job detects whether action-related
files changed; `test-action` runs conditionally; `test-action-result`
always runs and gates on the outcome. Ruleset updated to require
`test-action-result` instead of `test-action`.

Also removes `opened` trigger (same auto-label race fix as ci.yml).

Made-with: Cursor
fetch-depth: 0 so git diff BASE...HEAD can resolve both SHAs.
Made-with: Cursor
@TGPSKI TGPSKI merged commit 2c38945 into main Apr 10, 2026
6 checks passed
@TGPSKI TGPSKI deleted the fix/ci-label-race branch April 10, 2026 07:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant