Skip to content

Commit dc90034

Browse files
committed
Improve version job
1 parent dd00997 commit dc90034

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

.github/workflows/ci-cd.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ jobs:
2424
- name: Parse & check version
2525
id: parse
2626
run: |
27+
set -e # Exit on error
2728
parse_version_component() {
2829
component=$(echo "$1" | cut -f"$2" -d.)
2930
if [ -z "$component" ]; then
@@ -37,13 +38,12 @@ jobs:
3738
git show-ref --tags v$1 --quiet && echo "true" || echo "false"
3839
}
3940
exists=$(check_git_tag_exists "$VERSION")
40-
4141
echo "semver=$VERSION" >> $GITHUB_OUTPUT
4242
echo "major=$(parse_version_component "$VERSION" 1)" >> $GITHUB_OUTPUT
4343
echo "minor=$(parse_version_component "$VERSION" 2)" >> $GITHUB_OUTPUT
4444
echo "patch=$(parse_version_component "$VERSION" 3)" >> $GITHUB_OUTPUT
4545
echo "exists=$exists" >> $GITHUB_OUTPUT
46-
echo "pushable=$(( [ "$GITHUB_REF" == "refs/heads/main" ] && [ "$exists" == "false" ] ))" >> $GITHUB_OUTPUT
46+
echo "pushable=$( [ "$GITHUB_REF" == "refs/heads/main" ] && [ "$exists" == "false" ] && echo "true" || echo "false" )" >> $GITHUB_OUTPUT
4747
echo GitHub Output: $(cat $GITHUB_OUTPUT)
4848
4949
build:

0 commit comments

Comments
 (0)