You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Find workflow runs for this PR that need to be re-run
157
161
echo "Finding workflow runs for PR #$PR_NUM..."
158
162
159
-
# Get the names of all the workflows that ran on the PR
160
-
WORKFLOW_RUNS=$(gh run list --limit 30 --json name,headSha,event,databaseId,conclusion,status --jq '.[] | select(.headSha=="'$PR_HEAD_SHA'" and .event=="pull_request") | "\(.databaseId)|\(.name)|\(.conclusion)|\(.status)"')
163
+
# First try to get runs for the exact SHA
164
+
echo "Looking for runs with exact SHA: $PR_HEAD_SHA"
165
+
WORKFLOW_RUNS=$(gh run list --limit 30 --json name,headSha,event,databaseId,conclusion,status \
166
+
--jq '.[] | select(.headSha=="'$PR_HEAD_SHA'" and .event=="pull_request") | "\(.databaseId)|\(.name)|\(.conclusion)|\(.status)"')
161
167
168
+
# If no runs found with exact SHA, try by branch name
162
169
if [ -z "$WORKFLOW_RUNS" ]; then
163
-
echo "No workflow runs found for PR head SHA: $PR_HEAD_SHA"
164
-
165
-
# Try to find the most recent workflow runs for this PR regardless of SHA
0 commit comments