Skip to content

Commit

Permalink
chore: Update tag_version workflow to use new output syntax for lates…
Browse files Browse the repository at this point in the history
…t and new tags
  • Loading branch information
alexlovelltroy committed Nov 23, 2024
1 parent 8a36078 commit b48a88d
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/tag_version.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,22 @@ jobs:
run: |
latest_tag=$(git describe --tags `git rev-list --tags --max-count=1`)
echo "Latest tag: $latest_tag"
echo "::set-output name=latest_tag::$latest_tag"
echo "latest_tag=$latest_tag" >> $GITHUB_OUTPUT
- name: Calculate next version
id: calculate_version
run: |
latest_tag=${{ steps.get_latest_tag.outputs.latest_tag }}
if [[ $latest_tag =~ ^v([0-9]+)\.([0-9]+)\.([0-9]+)$ ]]; then
major=${BASH_REMATCH[1]}
minor=${BASH_REMATCH[2]}
patch=${BASH_REMATCH[3]}
new_tag="v$major.$minor.$((patch + 1))"
major=${BASH_REMATCH[1]}
minor=${BASH_REMATCH[2]}
patch=${BASH_REMATCH[3]}
new_tag="v$major.$minor.$((patch + 1))"
else
new_tag="v1.0.0"
new_tag="v1.0.0"
fi
echo "New tag: $new_tag"
echo "::set-output name=new_tag::$new_tag"
echo "new_tag=$new_tag" >> $GITHUB_OUTPUT
- name: Create new tag
uses: actions/github-script@v6
Expand Down

0 comments on commit b48a88d

Please sign in to comment.