Skip to content

Support optional chars in tag_format depending on if var is set or not #527

Open
@hongkongkiwi

Description

@hongkongkiwi

Description

I would like to have tags such as: v1.0.0-rc1

I can use tag_format: v$major.$minor.$patch-$prerelease but this breaks down if we don't have a prerelease var because an extra dash is added at the end.

According to dogs only v1.0.0rc1 is supported, but that breaks semantic versioning (which I'm using).

Is it possible to add this feature? Or did I miss something and we already have this?

Possible Solution

Allow the use of a bracket to show optional if set, for example in bash you can use:
${prerelease:+"-$prerelease"} which only sets the - if the variable is not empty.

If supporting this, I also recommend to support the opposing which can set a value if the variable is empty:
${prerelease:-"empty"}

To be clear, I don't recommend to support bash expansion, just these two specific use cases in whatever syntax seems appropriate :)

Additional context

No response

Additional context

No response

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