Repository navigation
ci: run CI only for trunk PRs and main pushes #40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -9,7 +9,9 @@ on: | |||||||
| jobs: | ||||||||
| compact: | ||||||||
| # Only run when PR is actually merged, not just closed | ||||||||
| if: github.event.pull_request.merged == true | ||||||||
| if: >- | ||||||||
| ((github.event_name != 'pull_request' && github.event_name != 'pull_request_target') || github.head_ref == 'trunk') && | ||||||||
| (github.event.pull_request.merged == true) | ||||||||
|
Comment on lines
+13
to
+14
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟡 Merged PR trajectories remain uncompacted When a non-trunk PR merges into main, Learn moreThis workflow runs when a PR targeting main closes. Its original merge condition compacted trajectories for every merged PR, independently of the CI workflow. The new head-branch condition skips merged PRs from other branches, so their summaries are never generated by this job. loadTrajectories only processes trajectories when the compact command runs. Example: A hotfix PR from Recommended fix: Restore the merged-only job condition. If compaction is also required for feature PRs merged into
Suggested change
Was this helpful? React with 👍 or 👎 to provide feedback. |
||||||||
| runs-on: ubuntu-latest | ||||||||
|
|
||||||||
| permissions: | ||||||||
|
|
||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| name: Trunk guard | ||
|
|
||
| # Only the `trunk` branch may merge into main. Feature branches merge into | ||
| # `trunk` (via the merge train); CI runs only on the trunk -> main PR. | ||
| on: | ||
| pull_request: | ||
| branches: [main] | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Trunk guard ignores base branch editsLow Severity
Reviewed by Cursor Bugbot for commit 6a3e425. Configure here. |
||
|
|
||
| jobs: | ||
| only-trunk-merges-to-main: | ||
| if: github.head_ref != 'trunk' | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 1 | ||
| steps: | ||
| - run: | | ||
| echo "::error::Only the 'trunk' branch may merge into main. Retarget this PR to 'trunk'." | ||
| exit 1 | ||


There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Skipped CI success passes required checks
Medium Severity
The
ci-successaggregator, used for branch protection, now skips on non-trunkPRs. GitHub treats a skipped required check as passing, so existing required checks no longer block mis-targeted PRs.trunk-guardfails under a new check name that current protection rules would not require.Reviewed by Cursor Bugbot for commit 6a3e425. Configure here.