Commit f0e40542 authored by canterburym's avatar canterburym
Browse files

Correcting merge test to only check open MRs

parent 8dabc8e7
Pipeline #3221 passed with stages
in 1 minute and 21 seconds
......@@ -4,7 +4,7 @@ import requests
import json
import subprocess
crCommitBranch = os.environ.get("CI_COMMIT_REF_NAME", "NOTFOUND")
crCommitBranch = os.environ.get("CI_COMMIT_REF_NAME", "cr/TS33128/0165")
apiUrl = os.environ.get("CI_API_V4_URL", "https://forge.3gpp.org/rep/api/v4")
projectId = os.environ.get("CI_PROJECT_ID", "13")
......@@ -23,13 +23,15 @@ def do (commandline):
print ("Searching for corresponding MR...")
mrs = gapi(f"merge_requests?source_branch={crCommitBranch}")
mrs = gapi(f"merge_requests?source_branch={crCommitBranch}&state=opened")
if len(mrs) == 0:
print ("No MR found... aborting")
exit()
if len(mrs) > 1:
print (f"{len(mrs)} MRs found, 1 expected - aborting")
for m in mrs:
pprint.pprint(m)
exit(-1)
mr = mrs[0]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment