Skip to content

fix: releases.draft Config Ignored — GitHub Release Always Created as Non-Draft #140

Description

@pvandervelde

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)

[releases]
draft = true

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

  1. Add a draft: bool field to AutomatorConfig (default false).
  2. In lib.rs's handle_release_pr_merged, set
    draft: repo_config.releases.draft when constructing AutomatorConfig.
  3. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions