Skip to content

Commit ef11669

Browse files
authored
ci: handle PRs with no checks in rerun apply patches (electron#49630)
1 parent d7378d9 commit ef11669

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

.github/workflows/rerun-apply-patches.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,20 +35,20 @@ jobs:
3535
echo "Processing PR #${PR_NUMBER}"
3636
3737
# Find the Apply Patches workflow check for this PR
38-
CHECK=$(gh pr checks "$PR_NUMBER" --json link,name,state,workflow --jq '[.[] | select(.workflow == "Apply Patches" and .name == "apply-patches")] | first')
38+
CHECK=$(gh pr view "$PR_NUMBER" --json statusCheckRollup --jq '[.statusCheckRollup[] | select(.workflowName == "Apply Patches" and .name == "apply-patches")] | first')
3939
4040
if [ -z "$CHECK" ] || [ "$CHECK" = "null" ]; then
4141
echo " No Apply Patches workflow found for PR #${PR_NUMBER}"
4242
continue
4343
fi
4444
45-
STATE=$(echo "$CHECK" | jq -r '.state')
46-
if [ "$STATE" = "SKIPPED" ]; then
45+
CONCLUSION=$(echo "$CHECK" | jq -r '.conclusion')
46+
if [ "$CONCLUSION" = "SKIPPED" ]; then
4747
echo " apply-patches job was skipped for PR #${PR_NUMBER} (no patches)"
4848
continue
4949
fi
5050
51-
LINK=$(echo "$CHECK" | jq -r '.link')
51+
LINK=$(echo "$CHECK" | jq -r '.detailsUrl')
5252
5353
# Extract the run ID from the link (format: .../runs/RUN_ID/job/JOB_ID)
5454
RUN_ID=$(echo "$LINK" | grep -oE 'runs/[0-9]+' | cut -d'/' -f2)

0 commit comments

Comments
 (0)