diff --git a/.github/workflows/prepare-release.yml b/.github/workflows/prepare-release.yml index 5074ed2acfe..cf0fd7621d3 100644 --- a/.github/workflows/prepare-release.yml +++ b/.github/workflows/prepare-release.yml @@ -25,6 +25,7 @@ jobs: steps: - name: Validate version format + shell: bash run: | validate_beta_version() { local regex_pattern_beta='^[0-9]+\.[0-9]+\.[0-9]+$' @@ -42,13 +43,20 @@ jobs: fi } - validate_beta_version "${{ inputs.candidate-beta }}" "candidate-beta" + if [[ ! -z "${{ inputs.candidate-beta }}" ]]; then + validate_beta_version "${{ inputs.candidate-beta }}" "candidate-beta" + fi validate_beta_version "${{ inputs.current-beta }}" "current-beta" + if [[ ! -z "${{ inputs.candidate-stable }}" ]]; then validate_stable_version "${{ inputs.candidate-stable }}" "candidate-stable" fi validate_stable_version "${{ inputs.current-stable }}" "current-stable" - shell: bash + + if [[ -z "${{ inputs.candidate-beta }}" && -z "${{ inputs.candidate-stable }}" ]]; then + echo "Candidate version is not set for beta or stable. Please set a version to proceed." + exit 1 + fi # Releasing opentelemetry-collector prepare-release: