Repository navigation
ci(release-cut): always show resolved commit, branch, and tag in summary - #10482
Conversation
Replace the third-party inputs-summary action with an inlined table (avoids executing an external action in a contents:write job) and, after ref resolution, append a Resolved source section that always includes the commit SHA plus any branches/tags whose tip is that commit. Commit, branch, and tag values are clickable GitHub links for faster RC cut audit.
📝 WalkthroughWalkthroughThe release workflow now renders 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
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 |
There was a problem hiding this comment.
🧹 Nitpick comments (2)
.github/workflows/release-cut.yml (2)
114-138: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winpush_main logic is still present and used — contradicts the summary; also now duplicates the new branch lookup.
The
push_maincomputation (git fetch origin main --quiet/rev-parse origin/main/ echopush_main=true|false) at lines 129-138 is unchanged in this diff and is still consumed downstream atsteps.resolve.outputs.push_main(line 662,Push tagstep). Both the AI summary ("The previouspush_maincalculation is removed") and the line-range change details ("it no longer includes the previouspush_maindetermination logic...") claim this was removed, but it clearly still exists and is load-bearing.Separately: now that the new code below (lines 148-154) already computes every origin branch pointing at
$sha, this fetch+compare is redundant —push_mainis just "ismainamong those branches". Worth folding into the new lookup instead of doing two separate origin traversals.♻️ Illustrative consolidation (move after branches computed)
- # Why: only push the version-bump commit back to main when the - # caller is releasing the exact tip of main. For any older or - # off-main ref we leave main alone and only publish the tag. - git fetch origin main --quiet - main_sha="$(git rev-parse origin/main)" - if [[ "$sha" == "$main_sha" ]]; then - echo "push_main=true" >>"$GITHUB_OUTPUT" - else - echo "push_main=false" >>"$GITHUB_OUTPUT" - fi + # push_main is computed after `branches` below, reusing the same + # origin ref lookup instead of a second git fetch/rev-parse.then, after
branchesis computed further down:+ # Why: only push the version-bump commit back to main when the + # caller is releasing the exact tip of main. + if grep -qx 'main' <<<"$branches"; then + echo "push_main=true" >>"$GITHUB_OUTPUT" + else + echo "push_main=false" >>"$GITHUB_OUTPUT" + fi
140-230: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winConsider extracting this into a dedicated script file.
This step is now ~90 lines of bash embedded in YAML (ref-kind detection, branch/tag lookup, a linkify helper, a name-rev fallback, and markdown assembly) — matches the
code_block_complexity_highflag. Moving it to e.g.config/scripts/resolve-ref-summary.sh(invoked withsha,input_ref,repo_urlas args/env) would make it independently testable and easier to review going forward, without changing behavior.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: c9cf8d28-ad20-4069-bcae-1c39137fdb94
📒 Files selected for processing (1)
.github/workflows/release-cut.yml
Summary
Improves the Cut Release job summary so RC (and other) cuts are easy to audit:
refis checked out — not just the rawrefinput.name-revhint likemain~3.m-s-abeer/update-gha-summary-with-workflow-inputs@v1(same motivation as Inline release-cut workflow inputs summary for security #10041: avoid an external action in acontents:writejob; inputs stay data viatoJSON+jq).Example summary shape:
Workflow inputs
kindrcrefhotfix/1.4.153-rc.4-from-rc.2Resolved source
hotfix/...(branch)abc1234hotfix/...Screenshots
No product UI change. Job summary on Cut Release runs gains a Resolved source section with links.
Testing
pnpm lintN/A (workflow-only)pnpm typecheckN/Apnpm testN/Apnpm buildN/Adry_run=trueand confirm the job summaryAI Review Report
Reviewed for:
ref(kept as env data; not interpolated into the script body)/for-each-ref --points-atubuntu-latestin this job (no macOS/Windows/Electron surface)Security Audit
contents: write).jq(same pattern as Inline release-cut workflow inputs summary for security #10041).Notes
Related/supersedes the inputs-inlining approach in #10041 (this PR also adds the resolved commit/branch/tag enrichment). Happy to coordinate if that PR lands first.