Skip to content

Commit

Permalink
[chore] improve release version validations (#10826)
Browse files Browse the repository at this point in the history
#### Description
This PR improves the version validation during the release preparation
workflow.

#### Link to tracking issue
Fixes #10735

---------

Signed-off-by: Moritz Wiesinger <[email protected]>
  • Loading branch information
mowies authored Aug 9, 2024
1 parent 8abfa02 commit 4889aef
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions .github/workflows/prepare-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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]+$'
Expand All @@ -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:
Expand Down

0 comments on commit 4889aef

Please sign in to comment.