diff --git a/.github/workflows/4_bumper_repository.yml b/.github/workflows/4_bumper_repository.yml index 591294fa..c932fc35 100644 --- a/.github/workflows/4_bumper_repository.yml +++ b/.github/workflows/4_bumper_repository.yml @@ -14,6 +14,11 @@ on: default: '' required: false type: string + tag: + description: 'Change branches references to tag-like references (e.g. v4.12.0-alpha7)' + default: false + required: false + type: boolean issue-link: description: 'Issue link in format https://github.com/wazuh//issues/' required: true @@ -76,16 +81,18 @@ jobs: env: VERSION: ${{ inputs.version }} STAGE: ${{ inputs.stage }} + TAG: ${{ inputs.tag }} run: | script_params="" version=${{ env.VERSION }} stage=${{ env.STAGE }} + tag=${{ env.TAG }} # Both version and stage provided - if [[ -n "$version" && -n "$stage" ]]; then + if [[ -n "$version" && -n "$stage" && "$tag" != "true" ]]; then script_params="--version ${version} --stage ${stage}" - elif [[ -z "$version" && -n "$stage" ]]; then - script_params="--stage ${stage}" + elif [[ -n "$version" && -n "$stage" && "$tag" == "true" ]]; then + script_params="--version ${version} --stage ${stage} --tag ${tag}" fi issue_number=$(echo "${{ inputs.issue-link }}" | awk -F'/' '{print $NF}') diff --git a/.github/workflows/5_bumper_repository.yml b/.github/workflows/5_bumper_repository.yml index 04985874..10514900 100644 --- a/.github/workflows/5_bumper_repository.yml +++ b/.github/workflows/5_bumper_repository.yml @@ -14,6 +14,11 @@ on: default: '' required: false type: string + tag: + description: 'Change branches references to tag-like references (e.g. v4.12.0-alpha7)' + default: false + required: false + type: boolean set_as_main: description: "Enable main branch mode: bump version values only, keep branch references pointing to main" required: false @@ -81,10 +86,12 @@ jobs: env: VERSION: ${{ inputs.version }} STAGE: ${{ inputs.stage }} + TAG: ${{ inputs.tag }} run: | script_params="" version=${{ env.VERSION }} stage=${{ env.STAGE }} + tag=${{ env.TAG }} set_as_main=${{ inputs.set_as_main }} @@ -93,11 +100,10 @@ jobs: fi # Both version and stage provided - if [[ -n "$version" && -n "$stage" ]]; then - script_params+=" --version ${version} --stage ${stage}" - elif [[ -z "$version" && -n "$stage" ]]; then - script_params+=" --stage ${stage}" - fi + if [[ -n "$version" && -n "$stage" && "$tag" != "true" ]]; then + script_params="--version ${version} --stage ${stage}" + elif [[ -n "$version" && -n "$stage" && "$tag" == "true" ]]; then + script_params="--version ${version} --stage ${stage} --tag ${tag}" issue_number=$(echo "${{ inputs.issue-link }}" | awk -F'/' '{print $NF}') BRANCH_NAME="enhancement/wqa${issue_number}-bump-${{ github.ref_name }}"