Skip to content

Commit a9f93b0

Browse files
committed
feat: use latest CI scripts when testing old commits
When testing specific commit SHAs via workflow_dispatch, always use the latest versions of all GitHub Actions scripts from main branch to ensure we have all bug fixes and improvements. This prevents issues where old commits have outdated CI logic. Signed-off-by: Mark Pollack <[email protected]>
1 parent feb5bf3 commit a9f93b0

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

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

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,20 @@ jobs:
3535
if: github.event.inputs.commit_sha
3636
run: |
3737
echo "Checking out specific commit: ${{ github.event.inputs.commit_sha }}"
38+
# Save the latest main reference
39+
LATEST_MAIN=$(git rev-parse origin/main)
40+
41+
# Checkout the target commit
3842
git checkout ${{ github.event.inputs.commit_sha }}
43+
44+
# Preserve all latest GitHub Actions scripts from main
45+
echo "Using latest GitHub Actions scripts from main..."
46+
# Copy all scripts from main's .github/scripts directory
47+
for script in $(git ls-tree -r --name-only ${LATEST_MAIN} .github/scripts/); do
48+
echo " Updating ${script}"
49+
git show ${LATEST_MAIN}:${script} > ${script}
50+
done
51+
# Note: The workflow itself is already from main (since that's what's running)
3952
4053
- uses: actions/setup-java@v4
4154
with:

0 commit comments

Comments
 (0)