fix(ci): detect workflow_run trigger correctly for dev publish mode - #2289
Conversation
After switching from 'push' to 'workflow_run' trigger, the MODE detection still checked for 'push' — causing MODE to be empty on automatic runs, which then fell into the PR branch and tried to publish '4.4.2-pr.' (invalid version). Fix: check for 'workflow_run' instead of 'push'.
📝 WalkthroughWalkthroughThe Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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 (1)
.github/workflows/publish.yml (1)
120-121: Stale comment references old trigger.The comment on line 120 still says "push to master = dev" but the condition now checks for
workflow_run. Consider updating the comment to match the actual logic.📝 Suggested comment update
- # Determine mode: push to master = dev, workflow_dispatch = use input + # Determine mode: workflow_run (after tests pass on master) = dev, workflow_dispatch = use input🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.github/workflows/publish.yml around lines 120 - 121, Update the stale inline comment that reads "push to master = dev" to reflect the actual condition being checked (the string if [ "${{ github.event_name }}" = "workflow_run" ]); change it to something like "workflow_run = dev, workflow_dispatch = use input" so the comment matches the conditional logic around github.event_name.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In @.github/workflows/publish.yml:
- Around line 120-121: Update the stale inline comment that reads "push to
master = dev" to reflect the actual condition being checked (the string if [
"${{ github.event_name }}" = "workflow_run" ]); change it to something like
"workflow_run = dev, workflow_dispatch = use input" so the comment matches the
conditional logic around github.event_name.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: c1795e0e-fda8-445c-92ac-a8026d529e7c
📒 Files selected for processing (1)
.github/workflows/publish.yml
Bug
After switching from
pushtoworkflow_runtrigger in #2288, the MODE detection inside the script still checked for'push':This caused
MODEto be empty on automaticworkflow_runtriggers, which fell into the PR branch and tried to publish version4.4.2-pr.(missing PR number → invalid semver).Error from the failed run:
Fix
Check for
workflow_runinstead ofpush:Summary by CodeRabbit