@@ -616,12 +616,7 @@ def resolveBranchNo(String featureBranchPRMinusNo) {
616616}
617617
618618def resolveBranchName (String featureBranchPRMinusNo , String orgName , String repoName ) {
619- // get pull request number
620- def branchNoMatcher = featureBranchPRMinusNo =~ / PR-(.*)/
621- assert branchNoMatcher. find()
622-
623- String prNo = branchNoMatcher[0 ][1 ]
624- log(" i" , " PR number: " + prNo + " of class " + prNo. getClass())
619+ def prNo = extractPrNumber(featureBranchPRMinusNo)
625620
626621 // curl the repo based on the feature branch no to get the branch information
627622 // / Note: only works for public repos! Otherwise credentials needs to be passed
@@ -633,6 +628,16 @@ def resolveBranchName(String featureBranchPRMinusNo, String orgName, String repo
633628 return branchName
634629}
635630
631+ def extractPrNumber (String featureBranchPRMinusNo ) {
632+ // get pull request number
633+ def branchNoMatcher = featureBranchPRMinusNo =~ / PR-(.*)/
634+ assert branchNoMatcher. find()
635+
636+ String prNo = branchNoMatcher[0 ][1 ]
637+ log(" i" , " PR number: " + prNo + " of class " + prNo. getClass())
638+ return prNo
639+ }
640+
636641def curlByPR (String prId , String orgName , String repoName ) {
637642 def curlUrl = " set +x && curl -s https://api.github.com/repos/" + orgName + " /" + repoName + " /pulls/" + prId
638643 String jsonResponseString = sh(script : curlUrl, returnStdout : true )
0 commit comments