Skip to content

Fix invalid previous_tag parameter in release workflow#134

Merged
brunoborges merged 2 commits intomainfrom
copilot/fix-github-actions-workflow-again
Feb 16, 2026
Merged

Fix invalid previous_tag parameter in release workflow#134
brunoborges merged 2 commits intomainfrom
copilot/fix-github-actions-workflow-again

Conversation

Copy link
Contributor

Copilot AI commented Feb 16, 2026

The release workflow fails when creating GitHub releases with HTTP 400: Invalid previous_tag parameter. Root cause: git describe --tags --abbrev=0 HEAD^ unreliably finds the previous tag on parent commit, often returning empty values.

Changes

Replace tag lookup with version-sorted filtering:

- PREV_TAG=$(git describe --tags --abbrev=0 HEAD^ 2>/dev/null || echo "")
+ CURRENT_TAG="v${VERSION}"
+ PREV_TAG=$(git tag -l 'v*' --sort=-version:refname | grep -v "^${CURRENT_TAG}$" | grep -v "^latest$" | head -n 1)

This approach:

  • Sorts all v* tags by semantic version (descending)
  • Excludes current release and latest tags
  • Returns most recent previous release
  • Handles first release (no previous tag) correctly

Added debug output for troubleshooting:

echo "Current tag: ${CURRENT_TAG}"
echo "Previous tag: ${PREV_TAG}"
Original prompt

Fix the failing GitHub Actions workflow Create GitHub Release
Analyze the workflow logs, identify the root cause of the failure, and implement a fix.
Job ID: 63754434722
Job URL: https://github.com/copilot-community-sdk/copilot-sdk-java/actions/runs/22063304621/job/63754434722


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: brunoborges <129743+brunoborges@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix failing GitHub Actions workflow for creating release Fix invalid previous_tag parameter in release workflow Feb 16, 2026
Copilot AI requested a review from brunoborges February 16, 2026 14:57
@brunoborges brunoborges marked this pull request as ready for review February 16, 2026 14:57
@brunoborges brunoborges merged commit 603c3af into main Feb 16, 2026
5 checks passed
@brunoborges brunoborges deleted the copilot/fix-github-actions-workflow-again branch February 16, 2026 15:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants