github-actions[bot] commited on
Commit
f86f883
·
1 Parent(s): 62098cc

Fix(ci): Implement robust changelog generation

Browse files
Files changed (1) hide show
  1. .github/workflows/build.yml +9 -4
.github/workflows/build.yml CHANGED
@@ -60,6 +60,10 @@ jobs:
60
  with:
61
  fetch-depth: 0
62
 
 
 
 
 
63
  - name: Generate Build Version
64
  id: version
65
  shell: bash
@@ -109,11 +113,12 @@ jobs:
109
  id: changelog
110
  shell: bash
111
  run: |
112
- # Fetch the latest release tag directly from the GitHub API
113
- LAST_TAG=$(gh release list --limit 1 --json tagName --jq .[0].tagName 2>/dev/null || echo "")
114
-
 
115
  RANGE="${LAST_TAG:+$LAST_TAG..HEAD}"
116
- echo "🔍 Generating changelog for build-${{ steps.version.outputs.version }} ($RANGE)"
117
 
118
  git-cliff \
119
  --config cliff.toml \
 
60
  with:
61
  fetch-depth: 0
62
 
63
+ - name: Fetch all tags and history
64
+ shell: bash
65
+ run: git fetch --prune --unshallow --tags
66
+
67
  - name: Generate Build Version
68
  id: version
69
  shell: bash
 
113
  id: changelog
114
  shell: bash
115
  run: |
116
+ echo "▶️ All build-* tags found:"; git tag --list 'build-*'
117
+ LAST_TAG=$(git describe --tags --abbrev=0 --match="build-*" 2>/dev/null || echo "")
118
+ echo "✅ Detected most recent ancestor tag: $LAST_TAG"
119
+
120
  RANGE="${LAST_TAG:+$LAST_TAG..HEAD}"
121
+ echo "🔍 Generating changelog for range: $RANGE"
122
 
123
  git-cliff \
124
  --config cliff.toml \