Skip to content

Commit ee0d68f

Browse files
Rollup merge of #140703 - Kobzol:post-merge-race-fix, r=marcoieni
Handle PR not found in post-merge workflow Should hopefully fix errors like [these](#140561 (comment)). r? `@marcoieni`
2 parents 74e5184 + a84a946 commit ee0d68f

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

.github/workflows/post-merge.yml

+7
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,19 @@ jobs:
2525
env:
2626
GH_TOKEN: ${{ github.token }}
2727
run: |
28+
# Give GitHub some time to propagate the information that the PR was merged
29+
sleep 60
30+
2831
# Get closest bors merge commit
2932
PARENT_COMMIT=`git rev-list --author='bors <[email protected]>' -n1 --first-parent HEAD^1`
3033
echo "Parent: ${PARENT_COMMIT}"
3134
3235
# Find PR for the current commit
3336
HEAD_PR=`gh pr list --search "${{ github.sha }}" --state merged --json number --jq '.[0].number'`
37+
if [ -z "${HEAD_PR}" ]; then
38+
echo "PR for commit SHA ${{ github.sha }} not found, exiting"
39+
exit 1
40+
fi
3441
echo "HEAD: ${{ github.sha }} (#${HEAD_PR})"
3542
3643
cd src/ci/citool

0 commit comments

Comments
 (0)