Skip to content

Commit 5204e04

Browse files
committed
Add workflow_dispatch to test specific commits in fast workflow
- Allow manual triggering with optional commit SHA parameter - Enables testing improved workflow against previous commits - Defaults to latest commit when no SHA specified - Shows clear commit info in logs for manual runs Signed-off-by: [email protected]
1 parent b339f56 commit 5204e04

File tree

1 file changed

+20
-3
lines changed

1 file changed

+20
-3
lines changed

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

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@ on:
88
- '*.md'
99
- 'docs/**'
1010
- '.github/workflows/**'
11+
workflow_dispatch:
12+
inputs:
13+
commit_sha:
14+
description: 'Specific commit SHA to test (optional - defaults to latest)'
15+
required: false
16+
type: string
1117

1218
jobs:
1319
fast-impacted:
@@ -28,7 +34,9 @@ jobs:
2834
OLLAMA_WITH_REUSE: true
2935
steps:
3036
- uses: actions/checkout@v4
31-
with: { fetch-depth: 2 } # Need HEAD and HEAD~1 for single commit diff
37+
with:
38+
fetch-depth: 2 # Need HEAD and HEAD~1 for single commit diff
39+
ref: ${{ github.event.inputs.commit_sha || github.sha }}
3240

3341
- uses: actions/setup-java@v4
3442
with:
@@ -47,8 +55,17 @@ jobs:
4755
4856
- name: Show commit range
4957
run: |
50-
echo "Base ref: HEAD~1"
51-
git log --oneline "HEAD~1...HEAD"
58+
if [ -n "${{ github.event.inputs.commit_sha }}" ]; then
59+
echo "Testing specific commit: ${{ github.event.inputs.commit_sha }}"
60+
echo "Commit info:"
61+
git log --oneline -1 HEAD
62+
echo "Base ref: HEAD~1"
63+
git log --oneline "HEAD~1...HEAD"
64+
else
65+
echo "Testing latest commit on main branch"
66+
echo "Base ref: HEAD~1"
67+
git log --oneline "HEAD~1...HEAD"
68+
fi
5269
5370
- name: Compute impacted modules
5471
id: mods

0 commit comments

Comments
 (0)