Skip to content

Commit

Permalink
Merge pull request #3 from markusstephanides/main
Browse files Browse the repository at this point in the history
Add feature branch support
  • Loading branch information
jorgenpt authored Jan 7, 2024
2 parents 3204656 + fc0bd1c commit 15b99a8
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,11 @@ internal class UgsStatusPublisher(
val commitStatusUrl = MessageFormat.format(POST_BADGE_URL_FORMAT, myParams[UgsConstants.SERVER_URL])
val body = JSONObject()
// TODO: Try parse?
body.put("ChangeNumber", revision.revision.toInt(10))

// This will return the changelist number if using feature branches (e.g. "main|123" -> 123)
// or only the changelist number if not using feature branches ("123" -> 123)
val changeNumber = revision.revision.split("|").last().toInt(10)
body.put("ChangeNumber", changeNumber)
body.put("Project", myParams[UgsConstants.PROJECT])
body.put("BuildType", myParams[UgsConstants.BADGE_NAME])
body.put("Result", status.result.uGSValue)
Expand Down

0 comments on commit 15b99a8

Please sign in to comment.