Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[chore] improve release version validations #10826

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading