From bdc2f3123a9e5478f8ac169c3b9dd723dedd9ddb Mon Sep 17 00:00:00 2001 From: Skydust Date: Wed, 22 Jan 2025 21:30:29 +0100 Subject: [PATCH] Adding choice --- action.yml | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/action.yml b/action.yml index 816c5ae..1a9e1d9 100644 --- a/action.yml +++ b/action.yml @@ -11,6 +11,15 @@ inputs: - "Major - Incompatible API changes" - "Minor - Adding functionality in a backward compatible manner" - "Patch - Backward compatible bug fixes" + new_branch_on: + type: choice + description: Makes a new branch on + options: + - "Major" + - "Minor" + - "Never" + required: false + default: "Major" token: description: 'A Gitea PAT' required: true @@ -74,8 +83,11 @@ runs: git tag -a "v${NEW_VERSION}" -m "Release version ${NEW_VERSION}" git push origin "v${NEW_VERSION}" - if [[ "${{ inputs.semver }}" == "Major"* ]]; then - log_info "Major version, creating release branch for backports" + if { [[ "${{ inputs.new_branch_on }}" == "Major"* ]] && + { [[ "${{ inputs.semver }}" == "Major"* ]] || [[ "${{ inputs.semver }}" == "Minor"* ]]; }; } || + { [[ "${{ inputs.new_branch_on }}" == "Minor"* ]] && [[ "${{ inputs.semver }}" == "Minor"* ]]; }; then + + log_info "${{ inputs.new_branch_on }} version, creating release branch for backports" git branch "release/v${NEW_VERSION}" git push origin "release/v${NEW_VERSION}" fi