← Back to Pull requests

ci: link discussions on push to main so merged pull requests update them again #1073

Closed
unknown closed this pull request without merging on Dec 03, 2026 21:25 UTC
View on GitHub
unknown unknown commented on Dec 03, 2026 20:57 UTC
Author

Since December 2, GitHub blocks pull_request_target in public repositories unless an Actions policy allows it, so runs that use it end in startup_failure (GitHub docs).

link-discussions now runs on the push to main that a merge makes, looks up the pull request whose merge commit is the pushed SHA, and passes its number to the same pinned shared workflow as pr_number. Discussions named by merged pull requests, including ones from forks, are commented on and closed again without a policy exception. This relies on squash merges (one pull request per push).

Validation: jactionlint, zizmor and gh actions-lock --no-fix report no errors. The same lookup script, run locally against jdx/fnox, returned the right number for two merge commits and nothing for a non-merge commit. The push trigger can only be verified after merge. Merges that happened during the failures are not backfilled.

AI-assisted — Tool: Claude Code; model: anthropic/claude-sonnet-5-5; version: 2.1.334.

🤖 Generated with Claude Code

<!-- CURSOR_SUMMARY -->
---

[!NOTE]

Low Risk

CI-only workflow trigger and lookup logic; no application or security-sensitive runtime code changes.

> Overview

Replaces pull_request_target on closed PRs with a push to main trigger so discussion linking works again under GitHub’s default policy that blocks pull_request_target on public repos.

> A new find-pull-request job resolves the merged PR for the pushed commit (API lookup with up to five retries), and the shared link-discussions workflow runs only when that number is found, receiving pr_number explicitly instead of event context. Concurrency is keyed by github.sha and cancel-in-progress is disabled so in-flight runs aren’t dropped mid-merge.

> <sup>Reviewed by Cursor Bugbot for commit 69ad2657de316e0eac979719d985b82bbdec9985. Bugbot is set up for automated code reviews on this repo. Configure here.</sup>

<!-- /CURSOR_SUMMARY -->

<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
<!-- coderabbit-ai-generated:v1 -->

Summary by CodeRabbit

Chores
Updated discussion-linking automation to check pushes to the main branch and associate a discussion only when it finds a matching merged pull request. If the matching pull request is not immediately available, the check retries briefly before proceeding. When no match is found, no discussion is linked. Concurrent checks for the same commit are coordinated without canceling in-progress runs.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

Diff: 350 lines (+262 / -88) across 4 files Reviewer: jdx Review duration: 28m
All Vouch review confidence checks passed
Residual risk 0.17 = Change Risk (0.42) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.42 · 350 lines diff across 4 files
0.42
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
0.17
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
60%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size diff_size
0.351
Shallow Review Depth shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #1073"
general weight: 0.35
Reviewers
Assignees
Unassigned
Labels
risk: low confidence: 60.5% reviewed
Vouch Risk Breakdown
AI-powered review risk analysis
Change Risk
Change Risk · Model 1 (XGBoost)
Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
Score: 42.4% (MEDIUM) · Higher = larger blast radius
42.4%
Review Confidence
Review Confidence · Models 2 & 3
Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
Score: 60.5% · Lower = rushed or shallow review
60.5%
Residual Risk
Residual Risk · Core Equation
Residual = Change × (1 − Confidence)
Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
Score: 16.8% · Safe to merge
16.8%