Skip to content

Commit e40af1a

Browse files
committed
updating workflow
1 parent df2fee5 commit e40af1a

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

.github/workflows/main.yaml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,32 +31,28 @@ jobs:
3131
cd .github/scripts
3232
go mod download
3333
go run .
34-
3534
# Conditional step: Bump version and create tag only if the comparison script passes
3635
- name: Bump Version and Create Tag
3736
if: ${{ success() && steps.compare_control.outcome == 'success' }}
3837
id: versioning
3938
run: |
4039
# Fetch tags from the repository
4140
git fetch --tags
42-
4341
# Get the latest tag and increment based on semantic versioning rules
4442
latest_tag=$(git tag --sort=-v:refname | head -n 1)
4543
if [ -z "$latest_tag" ]; then
4644
# If no tags exist, start at v0.1.0
4745
new_tag="v0.1.0"
4846
else
4947
# Split the latest tag into major, minor, and patch
50-
IFS='.' read -r major minor patch <<< "${latest_tag//v/}"
48+
echo "${latest_tag//v/}" | IFS='.' read -r major minor patch
5149
# Increment the patch version
5250
patch=$((patch + 1))
5351
new_tag="v${major}.${minor}.${patch}"
5452
fi
55-
5653
# Create and push the new tag
5754
git tag "$new_tag"
5855
git push origin "$new_tag"
59-
6056
# Set the new_tag as an output
6157
echo "new_tag=$new_tag" >> $GITHUB_OUTPUT
6258
env:
@@ -65,4 +61,4 @@ jobs:
6561
# Output the new tag
6662
- name: Display new tag
6763
if: ${{ success() && steps.versioning.outcome == 'success' }}
68-
run: echo "Created new tag: ${{ steps.versioning.outputs.new_tag }}"
64+
run: echo "Created new tag: ${{ steps.versioning.outputs.new_tag }}"

0 commit comments

Comments
 (0)