summaryrefslogtreecommitdiff
path: root/scripts/check-pr-title-and-commit-messages.py
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/check-pr-title-and-commit-messages.py')
-rwxr-xr-xscripts/check-pr-title-and-commit-messages.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/scripts/check-pr-title-and-commit-messages.py b/scripts/check-pr-title-and-commit-messages.py
index 9801b7456..1d4a3cfe3 100755
--- a/scripts/check-pr-title-and-commit-messages.py
+++ b/scripts/check-pr-title-and-commit-messages.py
@@ -2,6 +2,7 @@
import re
import sys
+import time
import requests
from pprint import pprint
@@ -27,9 +28,17 @@ if __name__ == '__main__':
print("Please specify pull request URL!")
sys.exit(1)
+ # There seems to be a race condition that causes this scripts to receive
+ # an incomplete PR object that is missing certain fields,
+ # which causes temporary CI failures that require re-running the script
+ #
+ # It's probably better to add a small delay to prevent that
+ time.sleep(5)
+
# Get the pull request object
pr = requests.get(sys.argv[1]).json()
if "title" not in pr:
+ print("The PR object does not have a title field!")
print("Did not receive a valid pull request object, please check the URL!")
sys.exit(1)