Skip to content

Commit fe1818b

Browse files
committed
removed spliting logic on CODEBUILD_WEBHOOK_TRIGGER so that branch names with / still work
1 parent b822b0b commit fe1818b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

source/ci_source/providers/CodeBuild.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,13 @@ export class CodeBuild implements CISource {
6666

6767
private async _getPrId(): Promise<string> {
6868
const sourceParts = (this.env.CODEBUILD_SOURCE_VERSION || "").split("/")
69-
const triggerParts = (this.env.CODEBUILD_WEBHOOK_TRIGGER || "").split("/")
69+
const triggerParts = this.env.CODEBUILD_WEBHOOK_TRIGGER || ""
7070

71-
const branchName = triggerParts[0] === "branch" ? triggerParts[1] : null
71+
const branchName = triggerParts.startsWith("branch/") ? triggerParts.replace("branch/", "") : null
7272
let prId = sourceParts[0] === "pr" ? sourceParts[1] : null
7373

7474
if (!prId) {
75-
prId = triggerParts[0] === "pr" ? triggerParts[1] : null
75+
prId = triggerParts.startsWith("pr/") ? triggerParts.replace("pr/", "") : null
7676
}
7777

7878
if (!prId && branchName) {

0 commit comments

Comments
 (0)