Skip to content
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
13 changes: 4 additions & 9 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,23 +29,18 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true

- name: Compute version from commits like release please
id: tag
run: |
# ── Find latest stable tag reachable from HEAD ──
LATEST_TAG=""
for t in $(git tag -l 'v[0-9]*.[0-9]*.[0-9]*' --sort=-version:refname | grep -v '-'); do
if git merge-base --is-ancestor "$t" HEAD 2>/dev/null; then
LATEST_TAG="$t"; break
fi
done
LATEST_TAG=$(git tag -l 'v[0-9]*.[0-9]*.[0-9]*' --sort=-version:refname | grep -v '-' | head -1)
if [ -z "$LATEST_TAG" ]; then
echo "::error::No stable release tag found in branch history"
echo "::error::No stable release tag found"
exit 1
fi
LATEST_VERSION="${LATEST_TAG#v}"
echo "Latest ancestor release: $LATEST_TAG"
echo "Latest release: $LATEST_TAG"

# ── Analyse conventional commits since that tag ──
COMMITS=$(git log "${LATEST_TAG}..HEAD" --format="%s")
Expand Down
Loading