Skip to content

ci: harden trunk gating - #544

Merged
kjgbot merged 1 commit into
mainfrom
trunk
Oct 8, 2026
Merged

kjgbot merged 1 commit into
mainfrom
trunk

Conversation

@kjgbot

@kjgbot kjgbot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Hardens the trunk-only CI gating per review on AgentWorkforce/relay#1932: head repo + base branch checks in every gate; guard via pull_request_target with edited; closed-only workflows ungated.

🤖 Generated with Claude Code


Note

Medium Risk
Changes merge policy enforcement and when CI runs on PRs; misconfigured conditions could block legitimate trunk→main merges or skip required checks on forks.

Overview
Tightens trunk-only CI so heavy jobs run on pull requests only when the head branch is this repo’s trunk, the PR targets main, and the head ref is not from a fork. The same if expression is applied across CI, Contract, and Relayfile Evals jobs (replacing a head-ref-only trunk check).

Hardens the trunk guard by switching from pull_request to pull_request_target (with opened, synchronize, reopened, edited), setting empty workflow permissions, and failing when the head branch is not trunk or the PR head repo is not the upstream repository. The guard workflow is documented as using base-branch workflow definitions and not checking out PR code.

Reviewed by Cursor Bugbot for commit ef5ecfc. Bugbot is set up for automated code reviews on this repo. Configure here.

- 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.
@kjgbot
kjgbot merged commit d6e122f into main Oct 8, 2026

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔍 Devin Review: 1 flag

Not posted on this PR by your GitHub settings — view it in Devin Review. (Configure)

Devin Review

@github-actions

github-actions Bot commented Oct 8, 2026

Copy link
Copy Markdown

Relayfile Eval Review

Run: .relayfile/evals/runs/2026-10-08T23-38-02-368Z-HEAD-provider
Mode: provider
Git SHA: 928aa27

Passed: 4 | Needs human: 0 | Reviewable: 0 | Missing output: 0 | Failed: 0 | Skipped: 0

Human Review Cases

No reviewable human-review cases captured Relayfile output.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant