Skip to content

Commit ef58924

Browse files
committed
Trying to print stuff
1 parent 19d086d commit ef58924

File tree

1 file changed

+3
-14
lines changed

1 file changed

+3
-14
lines changed

Jenkinsfile

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -616,31 +616,20 @@ def resolveBranchNo(String featureBranchPRMinusNo) {
616616
}
617617

618618
def resolveBranchName(String featureBranchPRMinusNo, String orgName, String repoName) {
619-
620619
// get pull request number
621620
def branchNoMatcher = featureBranchPRMinusNo =~ /PR-(.*)/
622621
assert branchNoMatcher.find()
623622

624623
def prNo = branchNoMatcher[0][1]
624+
log("i", "PR number" + prNo)
625625

626626
// curl the repo based on the feature branch no to get the branch information
627627
/// Note: only works for public repos! Otherwise credentials needs to be passed
628628
def curlUrl = "set +x && curl -s https://api.github.com/repos/" + orgName + "/" + repoName + "/pulls/" + prNo
629-
println(sh(script: curlUrl, returnStdout: true))
630-
String response = ""
629+
String response = sh(script: curlUrl, returnStdout: true)
630+
log("i", "API response:" + response)
631631
def jsonResponse = readJSON text: response
632632
def branchName = jsonResponse.head.ref
633-
// def matcher = response =~ /\"label\":\s\"(.+)\"/
634-
//
635-
// assert matcher.find()
636-
//
637-
// // get split the label to account for PRs from forks
638-
// def split = matcher[0][1] =~ /(.*):(.*)/
639-
//
640-
// assert matcher.find()
641-
//
642-
// def username = split[0][1]
643-
// def branch = split[0][2]
644633

645634
return branchName
646635

0 commit comments

Comments
 (0)