Skip to content

Add branch check to release script to prevent accidental releases from non-configured branches #179

@ticaki

Description

@ticaki

The release script should only run on a specific configured branch (e.g. main). At the moment it can be executed from any branch, which can lead to accidental releases from open PR branches or outdated feature branches. This leaves main behind while the release is created from the wrong branch.

To avoid this, the release script should:

  • Check that the current branch is main (or another configurable default branch, e.g. master).
  • If not on the correct branch, abort with a clear error message like:
    "Release can only be triggered from main. Current branch: ".
  • Optionally allow overriding with a flag if someone really wants to release from another branch.

This would reduce mistakes and ensure releases are only cut from the intended base branch.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions