Repository navigation
Conversation
- CI gates also require the head repo to be this repository and the base to be main (a fork branch named trunk, or trunk into another branch, no longer runs CI). - Trunk guard runs via pull_request_target (loaded from the base branch, so a PR cannot edit it to pass), re-runs on base edits, and checks head repo. - Workflows that only react to a PR closing are no longer gated.
|
Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configuration
📒 Files selected for processing (4)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
| name: Cleanup Preview | ||
| if: >- | ||
| ((github.event_name != 'pull_request' && github.event_name != 'pull_request_target') || github.head_ref == 'trunk') && | ||
| ((github.event_name != 'pull_request' && github.event_name != 'pull_request_target') || (github.head_ref == 'trunk' && github.event.pull_request.head.repo.full_name == github.repository && github.base_ref == 'main')) && |
There was a problem hiding this comment.
🟡 Closed preview workers remain deployed
When a feature PR with a preview worker closes, cleanup-preview skips deletion because its head is not trunk. The worker remains deployed after the PR closes.
Learn more
Preview workers were previously deployed for same-repository feature PRs by the deploy-preview job before trunk gating removed it. The current cleanup job runs only on closed events, but the trunk-only predicate discards those events for feature PRs. The remaining predicate already restricts deletion to same-repository PRs, and a closed PR always has a closed state. This leaves previously deployed workers active unless the separate audit runs in removal mode.
Example: PR #400 deployed relaycast-pr-400 before trunk gating. Closing PR #400 from feature/search skips cleanup, leaving the worker active instead of deleting it.
Recommended fix: Gate cleanup-preview only on a closed event from the same repository. Keep the existing same-repository restriction and delete both worker names as before.
| ((github.event_name != 'pull_request' && github.event_name != 'pull_request_target') || (github.head_ref == 'trunk' && github.event.pull_request.head.repo.full_name == github.repository && github.base_ref == 'main')) && | |
| (github.event.action == 'closed' && github.event.pull_request.head.repo.full_name == github.repository) && |
Was this helpful? React with 👍 or 👎 to provide feedback.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 37c3236. Configure here.
| name: Cleanup Preview | ||
| if: >- | ||
| ((github.event_name != 'pull_request' && github.event_name != 'pull_request_target') || github.head_ref == 'trunk') && | ||
| ((github.event_name != 'pull_request' && github.event_name != 'pull_request_target') || (github.head_ref == 'trunk' && github.event.pull_request.head.repo.full_name == github.repository && github.base_ref == 'main')) && |
There was a problem hiding this comment.
Closed cleanup remains trunk-gated
Medium Severity
cleanup-preview still requires a same-repo trunk → main pull request, so closing any other PR skips teardown. This change was supposed to ungate closed-only workflows, but the job kept the trunk gate and added base_ref plus head-repo checks.
Reviewed by Cursor Bugbot for commit 37c3236. Configure here.


Hardens the trunk-only CI gating per review on AgentWorkforce/relay#1932: head repo + base branch checks in every gate; guard via
pull_request_targetwithedited; closed-only workflows ungated.🤖 Generated with Claude Code
Note
Low Risk
Workflow-only changes that restrict when CI runs and strengthen merge policy; no application or secrets logic changes.
Overview
Tightens trunk → main CI so expensive jobs only run when the PR is this repo’s
trunkbranch targetingmain, not merely when the head ref is namedtrunk(e.g. forks or wrong bases).The shared job
ifin CI, container-integration, and preview cleanup now requiresgithub.event.pull_request.head.repo.full_name == github.repositoryandgithub.base_ref == 'main'alongsidegithub.head_ref == 'trunk'.Trunk guard switches to
pull_request_target(withedited), emptypermissions, and fails when the head isn’ttrunkor the head repo isn’t the upstream repository—so the guard runs from base-branch workflow code and blocks fork or non-trunk merges intomain.Reviewed by Cursor Bugbot for commit 37c3236. Bugbot is set up for automated code reviews on this repo. Configure here.