Skip to content

Commit

Permalink
Add feature branch support
Browse files Browse the repository at this point in the history
  • Loading branch information
markusstephanides authored Jan 2, 2024
1 parent 3204656 commit fc0bd1c
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 fc0bd1c

Please sign in to comment.