Skip to content

Commit

Permalink
Add new job to publish workflow to check version number precondition
Browse files Browse the repository at this point in the history
  • Loading branch information
khoi-nguyen-2359 committed Sep 15, 2023
1 parent 16e66ad commit 000058c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .github/workflows/publish_on_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,15 @@ jobs:
version_nums: ${{ steps.parse.outputs.version_nums }}
steps:
- id: parse
shell: bash
run: |
tag_name="${{ github.ref_name }}"
if ! [[ $tag_name =~ ^(([0-9]{1}|[1-9]{1}[0-9]{1}))\.(([0-9]{1}|[1-9]{1}[0-9]{1}))\.(([0-9]{1}|[1-9]{1}[0-9]{1}))$ ]]; then
echo "Wrong format tag name ${tag_name}"
exit 1
fi
parts=(${tag_name//./ })
partsJson="[" + parts[0] + "," + parts[1] + "," + parts[2] + "]"
partsJson="[${parts[0]},${parts[1]},${parts[2]}]"
echo "version_nums=${partsJson}" >> $GITHUB_OUTPUT
# publish:
Expand Down

0 comments on commit 000058c

Please sign in to comment.