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