Skip to content

Commit a8cf2c9

Browse files
committed
Fix commit SHA checkout and add enhanced run context
- Fix git checkout failure when testing specific commit SHAs - Use conditional fetch depth: shallow for auto runs, full for manual - Add explicit commit fetch and checkout for manual runs - Enhance run-name to show commit SHA for manual tests - Add detailed commit info display with author, date, and changed files Fixes issue where actions/checkout@v4 treated commit SHA as branch name Signed-off-by: [email protected]
1 parent 6dc7376 commit a8cf2c9

File tree

1 file changed

+22
-8
lines changed

1 file changed

+22
-8
lines changed

.github/workflows/main-push-fast.yml

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
name: Main Push - Fast
2+
run-name: ${{ github.event.inputs.commit_sha && format('Fast Test - {0}', github.event.inputs.commit_sha) || 'Main Push - Fast' }}
23

34
on:
45
push:
@@ -28,8 +29,13 @@ jobs:
2829
steps:
2930
- uses: actions/checkout@v4
3031
with:
31-
fetch-depth: 2 # Need HEAD and HEAD~1 for single commit diff
32-
ref: ${{ github.event.inputs.commit_sha || github.sha }}
32+
fetch-depth: ${{ github.event.inputs.commit_sha && 0 || 2 }}
33+
34+
- name: Checkout specific commit
35+
if: github.event.inputs.commit_sha
36+
run: |
37+
git fetch origin ${{ github.event.inputs.commit_sha }}
38+
git checkout ${{ github.event.inputs.commit_sha }}
3339
3440
- uses: actions/setup-java@v4
3541
with:
@@ -49,15 +55,23 @@ jobs:
4955
- name: Show commit range
5056
run: |
5157
if [ -n "${{ github.event.inputs.commit_sha }}" ]; then
58+
echo "🧪 MANUAL TEST RUN"
5259
echo "Testing specific commit: ${{ github.event.inputs.commit_sha }}"
53-
echo "Commit info:"
54-
git log --oneline -1 HEAD
55-
echo "Base ref: HEAD~1"
56-
git log --oneline "HEAD~1...HEAD"
60+
echo ""
61+
echo "📋 Commit Details:"
62+
git log --format=" Author: %an <%ae>%n Date: %ad%n Message: %s" -1 HEAD
63+
echo ""
64+
echo "📁 Changed Files:"
65+
git diff --name-only HEAD~1..HEAD | head -10
66+
if [ $(git diff --name-only HEAD~1..HEAD | wc -l) -gt 10 ]; then
67+
echo " ... and $(( $(git diff --name-only HEAD~1..HEAD | wc -l) - 10 )) more files"
68+
fi
5769
else
70+
echo "🚀 AUTOMATIC BUILD"
5871
echo "Testing latest commit on main branch"
59-
echo "Base ref: HEAD~1"
60-
git log --oneline "HEAD~1...HEAD"
72+
echo ""
73+
echo "📋 Commit Details:"
74+
git log --format=" Author: %an <%ae>%n Date: %ad%n Message: %s" -1 HEAD
6175
fi
6276
6377
- name: Compute impacted modules

0 commit comments

Comments
 (0)