Skip to content

Custom variables and/or stable workflow ID variable #1017

@peasee

Description

@peasee

In our release process with knope, we run a PrepareRelease step and raise the release changes on a PR for the rest of the team to review.

As part of our workflow file we manually checkout a branch like so before committing:

[[workflows.steps]]
type = "Command"
command = "git switch -C knope-release"

...

[[workflows.steps]]
type = "Command"
command = "git add ."

At the end of the workflow, once pushed, we delete the local branch so a user can re-run a release next time without a branch conflict because they're the same name.

I saw in the steps reference, there's a SwitchBranches but it seems to only support changing to a branch based on a Jira issue title/name/ID. It would be cool if we could:

  1. Use another source into this step, like a variable to target a custom branch without needing Jira
  2. Have some way to tell SwitchBranches to generate a branch ID for us, to make unique release branches. Perhaps SwitchBranches always generates a short UID and passes it as a variable, so we can make our custom branch name like release-$UID or however we'd like.

I think point 2 might be more controversial, but for us it would make sense to have something like release-abcdefg because we run a monorepo with many versions so it wouldn't make sense to have a release/0.0.1 branch. The unique ID would help avoiding local branch conflicts.

What do you think of this feature?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions