Skip to content

Commit 254f2da

Browse files
committed
fix(workflow): ensure all jobs use complete git history after filter-repo rewrite (refs #68)
1 parent 12eeba4 commit 254f2da

1 file changed

Lines changed: 67 additions & 0 deletions

File tree

.github/workflows/release-automation.yml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ jobs:
2323
runs-on: ubuntu-latest
2424
steps:
2525
- uses: actions/checkout@v4
26+
with:
27+
fetch-depth: 0
2628

2729
- name: Debug Information
2830
run: |
@@ -53,6 +55,8 @@ jobs:
5355
needs: validate-version
5456
steps:
5557
- uses: actions/checkout@v4
58+
with:
59+
fetch-depth: 0
5660

5761
- name: Setup zsh
5862
run: |
@@ -85,6 +89,8 @@ jobs:
8589
needs: [validate-version, run-tests]
8690
steps:
8791
- uses: actions/checkout@v4
92+
with:
93+
fetch-depth: 0
8894

8995
- name: Create release tarball
9096
run: |
@@ -143,6 +149,49 @@ jobs:
143149
with:
144150
fetch-depth: 0
145151

152+
- name: Verify Git History
153+
run: |
154+
echo "=== GIT HISTORY VERIFICATION ==="
155+
echo "Checking if we have the correct rewritten history..."
156+
157+
# Check if filter-repo evidence exists
158+
if [[ -d ".git/filter-repo" ]]; then
159+
echo "✅ Filter-repo evidence found - using rewritten history"
160+
else
161+
echo "❌ No filter-repo evidence found - may be using old history"
162+
fi
163+
164+
# Verify the tag exists and is reachable
165+
if git rev-parse v${{ inputs.prev_version }} >/dev/null 2>&1; then
166+
echo "✅ Tag v${{ inputs.prev_version }} exists and is reachable"
167+
else
168+
echo "❌ Tag v${{ inputs.prev_version }} not found or not reachable"
169+
exit 1
170+
fi
171+
172+
# Show commit range analysis
173+
echo ""
174+
echo "=== COMMIT RANGE ANALYSIS ==="
175+
echo "Base version: v${{ inputs.prev_version }}"
176+
echo "Current version: v${{ inputs.version }}"
177+
echo ""
178+
echo "Total commits since v${{ inputs.prev_version }}:"
179+
git log --oneline v${{ inputs.prev_version }}..HEAD | wc -l
180+
echo ""
181+
echo "Commits with issue references:"
182+
git log --oneline v${{ inputs.prev_version }}..HEAD | grep "(refs #" | wc -l
183+
echo ""
184+
echo "Unique issues referenced:"
185+
git log --oneline v${{ inputs.prev_version }}..HEAD | grep -o "(refs #[0-9]*)" | sort | uniq | wc -l
186+
echo ""
187+
echo "Issues with commits since v${{ inputs.prev_version }}:"
188+
git log --oneline v${{ inputs.prev_version }}..HEAD | grep -o "(refs #[0-9]*)" | sort | uniq
189+
190+
# Force garbage collection to ensure clean state
191+
git gc --prune=now
192+
echo ""
193+
echo "✅ Git history verification completed"
194+
146195
- name: Setup zsh
147196
run: |
148197
# Install zsh if not available
@@ -181,6 +230,18 @@ jobs:
181230
# Generate release notes using the new script
182231
./scripts/release/generate-release-notes.zsh "$CURR_VERSION" "$PREV_VERSION" release_notes.md
183232
233+
# Verify the generated release notes
234+
echo ""
235+
echo "=== RELEASE NOTES VERIFICATION ==="
236+
echo "Issues included in release notes:"
237+
grep -o "Issue #[0-9]*" release_notes.md | sort | uniq | wc -l
238+
echo ""
239+
echo "Issues in release notes:"
240+
grep -o "Issue #[0-9]*" release_notes.md | sort | uniq
241+
echo ""
242+
echo "Expected issues (from git log):"
243+
git log --oneline v${PREV_VERSION}..HEAD | grep -o "(refs #[0-9]*)" | sort | uniq
244+
184245
# Read the generated release notes for GitHub output
185246
echo "release_notes<<EOF" >> $GITHUB_OUTPUT
186247
cat release_notes.md >> $GITHUB_OUTPUT
@@ -202,6 +263,8 @@ jobs:
202263
if: inputs.dry_run != 'true'
203264
steps:
204265
- uses: actions/checkout@v4
266+
with:
267+
fetch-depth: 0
205268

206269
- name: Download artifacts
207270
uses: actions/download-artifact@v4
@@ -234,6 +297,8 @@ jobs:
234297
HOMEBREW_TOKEN: ${{ secrets.HOMEBREW_TOKEN }}
235298
steps:
236299
- uses: actions/checkout@v4
300+
with:
301+
fetch-depth: 0
237302

238303
- name: Download artifacts
239304
uses: actions/download-artifact@v4
@@ -325,6 +390,8 @@ jobs:
325390
if: inputs.dry_run == 'true'
326391
steps:
327392
- uses: actions/checkout@v4
393+
with:
394+
fetch-depth: 0
328395

329396
- name: Download artifacts
330397
uses: actions/download-artifact@v4

0 commit comments

Comments
 (0)