Skip to content

Commit

Permalink
validate version format to prepre-release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Sanket-0510 committed Jan 27, 2024
1 parent 8b95295 commit 6051952
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/prepare-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,32 @@ on:
required: true
description: Current version (beta, like 0.69.1). Don't include `v`.
jobs:
#validate-version format
validate-version:
runs-on: ubuntu-latest
steps:
- name: Validate version format
run: |
if [[ ! "${{ inputs.candidate-stable }}" =~ ^[0-9]+\.[0-9]+\.[0-9]+-rcv[0-9]+$ ]]; then
echo "Invalid candidate-stable version format. It should be like 1.0.0-rcv0014."
exit 1
fi
if [[ ! "${{ inputs.current-stable }}" =~ ^[0-9]+\.[0-9]+\.[0-9]+-rcv[0-9]+$ ]]; then
echo "Invalid current-stable version format. It should be like 1.0.0-rcv0014."
exit 1
fi
if [[ ! "${{ inputs.candidate-beta }}" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "Invalid candidate-beta version format. It should be like 0.70.0."
exit 1
fi
if [[ ! "${{ inputs.current-beta }}" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "Invalid current-beta version format. It should be like 0.69.1."
exit 1
fi
shell: bash
# Releasing opentelemetry-collector
prepare-release:
runs-on: ubuntu-latest
Expand Down

0 comments on commit 6051952

Please sign in to comment.