Skip to content

Commit e48734d

Browse files
committed
Update update-from-template.yml
Handle PR merges before workflow finishes
1 parent 8aef498 commit e48734d

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

.github/workflows/update-from-template.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,13 @@ jobs:
208208
for i in {1..20}; do
209209
echo "Checking if PR can be auto-merged. Try: $i"
210210
211+
echo "Checking if update-branch-merged exists"
212+
git fetch
213+
if [[ $(git rev-parse origin/${{ env.UPDATE_BRANCH_MERGED }}) ]]; then
214+
echo "Branch origin/${{ env.UPDATE_BRANCH_MERGED }} is missing"
215+
exit 0
216+
fi
217+
211218
echo "Fetching checks"
212219
cs_response=$(curl -sL \
213220
--fail-with-body \
@@ -266,6 +273,10 @@ jobs:
266273
267274
echo "Fetching..."
268275
git fetch
276+
if [[ $(git rev-parse origin/${{ env.UPDATE_BRANCH_MERGED }}) ]]; then
277+
echo "Branch origin/${{ env.UPDATE_BRANCH_MERGED }} is missing"
278+
exit 0
279+
fi
269280
270281
expected_commit="${{ needs.update.outputs.update_branch_merged_commit }}"
271282
actual_commit=$(git rev-parse origin/${{ env.UPDATE_BRANCH_MERGED }})

0 commit comments

Comments
 (0)