Skip to content

Commit 603c3af

Browse files
authored
Merge pull request #134 from copilot-community-sdk/copilot/fix-github-actions-workflow-again
Fix invalid previous_tag parameter in release workflow
2 parents 011936d + 6264fe9 commit 603c3af

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

.github/workflows/publish-maven.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,12 @@ jobs:
183183
RELEASE_NOTES=$(envsubst < .github/workflows/notes.template)
184184
185185
# Get the previous tag for generating notes
186-
PREV_TAG=$(git describe --tags --abbrev=0 HEAD^ 2>/dev/null || echo "")
186+
# Fetch all tags and find the previous version tag (excluding 'latest' and the current tag)
187+
CURRENT_TAG="v${VERSION}"
188+
PREV_TAG=$(git tag -l 'v*' --sort=-version:refname | grep -v "^${CURRENT_TAG}$" | grep -v "^latest$" | head -n 1)
189+
190+
echo "Current tag: ${CURRENT_TAG}"
191+
echo "Previous tag: ${PREV_TAG}"
187192
188193
# Build the gh release command
189194
GH_ARGS=("v${VERSION}")

0 commit comments

Comments
 (0)