ci: refactor release workflows, split pre-release handling and update release-drafter version#288
Conversation
… release-drafter version
Reviewer's GuideRefactors the release-drafter GitHub Actions workflow to separate pre-release and release drafting behavior, trigger on standard pull request events (including label changes), and pins release-drafter to version v7.3.1 with explicit prerelease configuration instead of workflow-dispatch inputs. Flow diagram for updated release-drafter CI workflowflowchart TD
subgraph Triggers
PR["pull_request\n(opened/edited/reopened/synchronize/labeled/unlabeled)"]
PushMain["push to main"]
end
subgraph Jobs
PreReleaseJob["job: update_prerelease_draft\nuses release-drafter@v7.3.1\nprerelease: true (rc)"]
ReleaseJob["job: update_release_draft\nuses release-drafter@v7.3.1\nprerelease: false"]
end
PR --> PreReleaseJob
PushMain --> ReleaseJob
subgraph Concurrency
ConcurrencyGroup["group: pr-<number> or ref\ncancel-in-progress for non-main, non-tag"]
end
PR -. uses .-> ConcurrencyGroup
PushMain -. uses .-> ConcurrencyGroup
File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
WalkthroughThe Release Drafter workflow is reconfigured to trigger automatically on pull request events with fixed prerelease behavior. Pull request triggers now include label operations, and the Release Drafter action is upgraded to v7.3.1 with prerelease settings hardcoded instead of accepting manual dispatch inputs. ChangesRelease Drafter Configuration
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 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.
Hey - I've left some high level feedback:
- Consider adding explicit
if:conditions on the two jobs soupdate_prerelease_draftruns only forpull_requestevents andupdate_release_draftonly forpushtomain, to avoid drafting both types on unintended event types. - If the intention is to only draft prereleases for certain PRs (e.g., with a specific label), it may be clearer to add an
if:condition based on labels rather than triggering on allpull_requestevents includingopenedandedited.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Consider adding explicit `if:` conditions on the two jobs so `update_prerelease_draft` runs only for `pull_request` events and `update_release_draft` only for `push` to `main`, to avoid drafting both types on unintended event types.
- If the intention is to only draft prereleases for certain PRs (e.g., with a specific label), it may be clearer to add an `if:` condition based on labels rather than triggering on all `pull_request` events including `opened` and `edited`.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
|
@coderabbitai review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
.github/workflows/release-drafter.yml (1)
21-47:⚠️ Potential issue | 🟠 MajorPrevent draft overwrites between the pre-release and release jobs in
.github/workflows/release-drafter.ymlRelease Drafter can target the same “matching” draft release for multiple jobs updating the same repo/branch, so running
prerelease: true(prerelease-identifier: rc) andprerelease: false(prerelease-identifier: '') in parallel may cause one job to overwrite the other unless the drafts are uniquely isolated (e.g., separatetag-prefix/config per job). Also,prerelease-identifier: ''is valid/supported for v7.3.1 (empty/omitted identifier is treated as the default behavior).🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.github/workflows/release-drafter.yml around lines 21 - 47, The two Release Drafter jobs (update_prerelease_draft and update_release_draft) can target the same draft and overwrite each other; fix by isolating their targets — e.g., add distinct Release Drafter inputs to each job such as setting different tag-prefix values (use tag-prefix: rc- for update_prerelease_draft and tag-prefix: '' for update_release_draft) or point each job to a separate config file (via with: config-name/config-file) so the action instances (uses: release-drafter/release-drafter@v7.3.1) create/update different draft releases instead of colliding.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In @.github/workflows/release-drafter.yml:
- Around line 21-47: The two Release Drafter jobs (update_prerelease_draft and
update_release_draft) can target the same draft and overwrite each other; fix by
isolating their targets — e.g., add distinct Release Drafter inputs to each job
such as setting different tag-prefix values (use tag-prefix: rc- for
update_prerelease_draft and tag-prefix: '' for update_release_draft) or point
each job to a separate config file (via with: config-name/config-file) so the
action instances (uses: release-drafter/release-drafter@v7.3.1) create/update
different draft releases instead of colliding.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 0f9ab7bf-d91c-44e9-a460-e61fe04c6e10
📒 Files selected for processing (1)
.github/workflows/release-drafter.yml
Closes #287
Summary by Sourcery
Refactor the release-drafter workflow to separate pre-release and full release handling while tightening its triggers and configuration.
CI:
Summary by CodeRabbit