Skip to content

Commit 3d9a78d

Browse files
authored
Merge pull request #93 from rudnerbjoern/dev
Add wait step for PR checks
2 parents 76b7093 + 64ca0ee commit 3d9a78d

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

.github/workflows/combine-schema.v3.2.yml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ jobs:
8888
echo "Waiting for PR to be mergeable..."
8989
for i in {1..30}; do
9090
MERGEABLE=$(gh pr view ${{ steps.create-pull-request.outputs.pull-request-url }} --json mergeable --jq .mergeable)
91-
echo "MERGEABLE = $MERGEABLE"
91+
echo "mergeable = $MERGEABLE"
9292
if [[ "$MERGEABLE" == "MERGEABLE" || "$MERGEABLE" == "mergeable" ]]; then
9393
break
9494
fi
@@ -98,6 +98,22 @@ jobs:
9898
env:
9999
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
100100

101+
- name: Wait for PR checks to succeed
102+
run: |
103+
echo "Waiting for all status checks to pass..."
104+
for i in {1..30}; do
105+
STATES=$(gh pr view ${{ steps.create-pull-request.outputs.pull-request-url }} --json statusCheckRollup --jq '[.statusCheckRollup[].state]' || echo "[]")
106+
echo "statusCheckRollup states = $STATES"
107+
if echo "$STATES" | jq -e 'all(. == "SUCCESS")' > /dev/null; then
108+
echo "All checks passed."
109+
break
110+
fi
111+
echo "Checks not successful yet, retrying in 10s... ($i/30)"
112+
sleep 10
113+
done
114+
env:
115+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
116+
101117
- name: Enable automerge
102118
uses: "peter-evans/enable-pull-request-automerge@v3"
103119
with:

0 commit comments

Comments
 (0)