fix(ci): use yq instead of sed for version stamp in publish workflow#943
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Enterprise Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThis PR updates the "Stamp version in docs.yml" step in the Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related PRs
Suggested labels
Suggested reviewers
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. Comment |
Summary
Replace fragile
sedpattern with structuralyqselector for the "Latest · vX.Y.Z" version stamp in the publish workflow.Motivation / Context
Fixes: #942
Related: N/A
Type of Change
Component(s) Affected
Implementation Notes
The stamp step uses
sed 's/display-name: "Latest"/display-name: "Latest · vX.Y.Z"/'but afteryqrewritesdocs.ymlin earlier steps, the YAML quoting style changes and thesedpattern no longer matches. The stamp silently fails.Replaced with the same
yqapproach used by topograph and NVSentinel:yq -i '(.products[0].versions[] | select(.slug == "latest")).display-name = "Latest · " + env(VERSION)' fern/docs.ymlAlso updated the diagnostic output from
greptoyqfor consistency.Testing
Full publish pipeline replicated locally:
Risk Assessment
Rollout notes: Requires a workflow_dispatch after merge to take effect on the live site.
Checklist
git commit -S)