Repository navigation
revert: trunk-only CI gating (repo not in merge-train core set) #41
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,9 +9,7 @@ on: | |
| jobs: | ||
| compact: | ||
| # Only run when PR is actually merged, not just closed | ||
| if: >- | ||
| ((github.event_name != 'pull_request' && github.event_name != 'pull_request_target') || github.head_ref == 'trunk') && | ||
| (github.event.pull_request.merged == true) | ||
| if: github.event.pull_request.merged == true | ||
|
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. 🟡 Squash-merged PR trajectories go missing When a squash-merged branch is deleted, Learn moreThe newly eligible ordinary PRs can be squash-merged and their source branches deleted. The workflow checks out main and selects original PR commits using the PR head SHA. If the head is not reachable through any fetched branch, Example: A feature branch containing commit A is squash-merged as commit B, then deleted. A completed trajectory records A but not Recommended fix: Preserve or explicitly fetch the PR head commit before it becomes unavailable, or identify the merged PR's trajectories through durable metadata that survives squash and branch deletion. Ensure failure to resolve the commit list does not silently substitute an unrelated filter. Was this helpful? React with 👍 or 👎 to provide feedback. |
||
| runs-on: ubuntu-latest | ||
|
|
||
| permissions: | ||
|
|
||
This file was deleted.
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.
🟡 Fork PR summaries cannot be pushed
When a forked PR merges,
compactruns with the read-only token granted topull_requestworkflows. The commit step cannot push a generated summary to main.Learn more
A merged fork PR now passes the compact job's gate. GitHub limits the token in fork-originated
pull_requestworkflows to read permissions unless an administrator explicitly permits write tokens. The job requestscontents: write, but its commit step cannot push when compaction produced an artifact.Example: A contributor merges a fork PR with a matching trajectory. The job creates a summary, commits it locally, then
git pushfails with insufficient permissions instead of saving the summary on main.Recommended fix: Trigger the merged-PR automation through a trusted event with write access, such as
pull_request_targetforclosedevents, while checking out and executing only trusted base-branch code. Check the job's permission model for fork merges before relying oncontents: write.Was this helpful? React with 👍 or 👎 to provide feedback.