Skip to content

Commit

Permalink
SCANDOCKER-3 Change Release pipeline to support the new version format
Browse files Browse the repository at this point in the history
  • Loading branch information
csaba-feher-sonarsource authored and henryju committed May 17, 2024
1 parent 59faabc commit bdf9915
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,16 @@ jobs:
- name: Get the version
id: get_version
run: |
IFS=. read major minor micro build <<<"${{ github.event.release.tag_name }}"
echo "major_version=${major}" >> $GITHUB_OUTPUT
echo "major_minor=${major}.${minor}" >> $GITHUB_OUTPUT
echo "major_minor_patch=${major}.${minor}.${micro}" >> $GITHUB_OUTPUT
full_image_tag=${{ github.event.release.tag_name }}
if [[ ! ${full_image_tag} =~ ^[1-9][0-9]+.[0-9]+.[0-9]+_[0-9]+.[0-9]+.[0-9]+ ]]; then
echo "The release tag should be in the format of {major}.{minor}.{patch}_{scanner_major}.{scanner_minor}.{scanner_patch} but it was ${full_image_tag}"
exit 1
fi
IFS=. read docker_major docker_minor rest <<<"${full_image_tag}"
echo "major_version=${docker_major}" >> $GITHUB_OUTPUT
echo "major_minor=${docker_major}.${docker_minor}" >> $GITHUB_OUTPUT
echo "major_minor_patch=${full_image_tag}" >> $GITHUB_OUTPUT
shell: bash
- uses: actions/checkout@v2
with:
Expand Down

0 comments on commit bdf9915

Please sign in to comment.