fix: Use github.sha fallback for workflow_dispatch SHA resolution

When no SHA is provided in workflow_dispatch and there's no PR context, fallback to github.sha (current commit). This fixes the 'No SHA available' error for manual triggers.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Maxime Beauchemin
2025-08-23 17:06:30 -07:00
parent e2a9e28313
commit 6ca977ddd5

View File

@@ -100,12 +100,10 @@ jobs:
elif [[ -n "${{ github.event.pull_request.head.sha }}" ]]; then
SHA="${{ github.event.pull_request.head.sha }}"
echo "Using PR head SHA: $SHA"
elif [[ "${{ github.event_name }}" == "push" ]]; then
SHA="${{ github.sha }}"
echo "Using push SHA: $SHA"
else
echo "❌ No SHA available from any source"
exit 1
# Fallback to current commit SHA (works for push and workflow_dispatch)
SHA="${{ github.sha }}"
echo "Using current commit SHA: $SHA"
fi
# Validate SHA format (40-char hex)