Repository: pvandervelde/release_regent
Affects: GitHub release creation on release PR merge
Date: 2026-05-18
Summary
When a release PR is merged, release-regent always creates the GitHub release as a
non-draft, regardless of the releases.draft setting in release-regent.toml. Setting
draft = true under [releases] has no effect.
Configuration (correct — not the cause)
The key releases.draft maps to ReleasesConfig.draft in crates/core/src/config.rs
and is correctly parsed and stored. The configuration is not the problem.
Root Cause
ReleaseAutomator::automate() hardcodes draft: false
In crates/core/src/release_automator.rs, the CreateReleaseParams literal always sets
draft: false:
let release = self
.github
.create_release(
owner,
repo,
CreateReleaseParams {
tag_name: tag_name.clone(),
name: Some(tag_name.clone()),
body: Some(changelog),
draft: false, // ← always false
prerelease: is_prerelease,
generate_release_notes: false,
target_commitish: Some(merge_sha),
},
)
.await?;
AutomatorConfig has no draft field
AutomatorConfig (the struct wired into ReleaseAutomator) contains no draft field,
so there is nowhere to thread the config value even if lib.rs were to read it.
lib.rs never reads repo_config.releases.draft
In handle_release_pr_merged, the AutomatorConfig is constructed without any
reference to repo_config.releases:
let config = AutomatorConfig {
branch_prefix: default_orch.branch_prefix,
changelog_header: default_orch.changelog_header,
version_prefix: repo_config.core.version_prefix.clone(),
};
Impact
Users who want to review the GitHub release before it becomes public (e.g. to edit the
release notes, attach artifacts, or gate a deployment) cannot use the draft release
workflow. The releases.draft setting is silently ignored.
Fix
- Add a
draft: bool field to AutomatorConfig (default false).
- In
lib.rs's handle_release_pr_merged, set
draft: repo_config.releases.draft when constructing AutomatorConfig.
- In
ReleaseAutomator::automate(), replace the hardcoded draft: false with
draft: self.config.draft.
Files to Change
crates/core/src/release_automator.rs — add field, use it in create_release call
crates/core/src/lib.rs — thread repo_config.releases.draft into AutomatorConfig
crates/core/src/release_automator_tests.rs — add tests for draft: true path
Repository:
pvandervelde/release_regentAffects: GitHub release creation on release PR merge
Date: 2026-05-18
Summary
When a release PR is merged,
release-regentalways creates the GitHub release as anon-draft, regardless of the
releases.draftsetting inrelease-regent.toml. Settingdraft = trueunder[releases]has no effect.Configuration (correct — not the cause)
The key
releases.draftmaps toReleasesConfig.draftincrates/core/src/config.rsand is correctly parsed and stored. The configuration is not the problem.
Root Cause
ReleaseAutomator::automate()hardcodesdraft: falseIn
crates/core/src/release_automator.rs, theCreateReleaseParamsliteral always setsdraft: false:AutomatorConfighas nodraftfieldAutomatorConfig(the struct wired intoReleaseAutomator) contains nodraftfield,so there is nowhere to thread the config value even if
lib.rswere to read it.lib.rsnever readsrepo_config.releases.draftIn
handle_release_pr_merged, theAutomatorConfigis constructed without anyreference to
repo_config.releases:Impact
Users who want to review the GitHub release before it becomes public (e.g. to edit the
release notes, attach artifacts, or gate a deployment) cannot use the draft release
workflow. The
releases.draftsetting is silently ignored.Fix
draft: boolfield toAutomatorConfig(defaultfalse).lib.rs'shandle_release_pr_merged, setdraft: repo_config.releases.draftwhen constructingAutomatorConfig.ReleaseAutomator::automate(), replace the hardcodeddraft: falsewithdraft: self.config.draft.Files to Change
crates/core/src/release_automator.rs— add field, use it increate_releasecallcrates/core/src/lib.rs— threadrepo_config.releases.draftintoAutomatorConfigcrates/core/src/release_automator_tests.rs— add tests fordraft: truepath