Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get previous version before pushing new tag #9

Merged
merged 1 commit into from
Oct 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -140,18 +140,18 @@ jobs:
echo "New Tag: ${version_tag}"
echo "::endgroup::"

git checkout ${{ steps.info.outputs.branch }}
git tag "${version_tag}"
git push origin tag "${version_tag}"

# Get all tags sorted by version, filtered by the module name
previous_tag=$(git tag --sort=-v:refname | grep -E "^[0-9]+\.[0-9]+\.[0-9]+-${module_name}$" | sed -n '2p')
previous_tag=$(git tag --sort=-v:refname | grep -E "^[0-9]+\.[0-9]+\.[0-9]+-${module_name}$" | head -n 1)

echo "previous_tag=${previous_tag}" >> $GITHUB_OUTPUT

echo "::group::Previous Tag"
echo "Previous Tag: ${previous_tag}"
echo "::endgroup::"

git checkout ${{ steps.info.outputs.branch }}
git tag "${version_tag}"
git push origin tag "${version_tag}"
shell: bash

- name: Create/Update CHANGELOG
Expand Down