Skip to content

Commit 9c73e3c

Browse files
author
Ignacio Bonafonte
committed
Use only BITRISE_GIT_BRANCH for branch selection, if was reporting destination branch on PR's
1 parent 2e93ed9 commit 9c73e3c

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

Sources/DatadogSDKTesting/DDEnvironmentValues.swift

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -386,10 +386,7 @@ internal struct DDEnvironmentValues {
386386
stageName = nil
387387
pipelineURL = DDEnvironmentValues.getEnvVariable("BITRISE_BUILD_URL")
388388
pipelineName = DDEnvironmentValues.getEnvVariable("BITRISE_APP_TITLE")
389-
branchEnv = DDEnvironmentValues.getEnvVariable("BITRISEIO_GIT_BRANCH_DEST")
390-
if branchEnv?.isEmpty ?? true {
391-
branchEnv = DDEnvironmentValues.getEnvVariable("BITRISE_GIT_BRANCH")
392-
}
389+
branchEnv = DDEnvironmentValues.getEnvVariable("BITRISE_GIT_BRANCH")
393390
tagEnv = DDEnvironmentValues.getEnvVariable("BITRISE_GIT_TAG")
394391

395392
let tempMessage = DDEnvironmentValues.getEnvVariable("BITRISE_GIT_MESSAGE")

Tests/fixtures/ci/bitrise.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,7 @@
447447
{
448448
"BITRISE_SOURCE_DIR": "/foo/bar",
449449
"GIT_REPOSITORY_URL": "git@hostname.com:org/repo.git",
450-
"BITRISEIO_GIT_BRANCH_DEST": "origin/master",
450+
"BITRISE_GIT_BRANCH": "origin/master",
451451
"BITRISE_BUILD_SLUG": "bitrise-pipeline-id",
452452
"BITRISE_APP_TITLE": "bitrise-pipeline-name",
453453
"BITRISE_BUILD_NUMBER": "bitrise-pipeline-number",
@@ -470,8 +470,7 @@
470470
{
471471
"BITRISE_SOURCE_DIR": "/foo/bar",
472472
"GIT_REPOSITORY_URL": "git@hostname.com:org/repo.git",
473-
"BITRISE_GIT_BRANCH": "origin/master",
474-
"BITRISEIO_GIT_BRANCH_DEST": "origin/notmaster",
473+
"BITRISE_GIT_BRANCH": "origin/notmaster",
475474
"BITRISE_BUILD_SLUG": "bitrise-pipeline-id",
476475
"BITRISE_APP_TITLE": "bitrise-pipeline-name",
477476
"BITRISE_BUILD_NUMBER": "bitrise-pipeline-number",

0 commit comments

Comments
 (0)