Skip to content

Commit d99e4c2

Browse files
committed
Fix BitBucket recognition of publicReleaseRefSpec
BitBucket environment variables do not include the `refs/` prefix, so we need to add them ourselves (as we do for some other cloud build services already). Fixes #935
1 parent ee96df4 commit d99e4c2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/NerdBank.GitVersioning/CloudBuildServices/BitbucketCloud.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ public class BitbucketCloud : ICloudBuild
2020
public bool IsPullRequest => !string.IsNullOrWhiteSpace(Environment.GetEnvironmentVariable("BITBUCKET_PR_ID"));
2121

2222
/// <inheritdoc />
23-
public string BuildingBranch => Environment.GetEnvironmentVariable("BITBUCKET_BRANCH");
23+
public string BuildingBranch => CloudBuild.ShouldStartWith(Environment.GetEnvironmentVariable("BITBUCKET_BRANCH"), "refs/heads/");
2424

2525
/// <inheritdoc />
26-
public string BuildingTag => Environment.GetEnvironmentVariable("BITBUCKET_TAG");
26+
public string BuildingTag => CloudBuild.ShouldStartWith(Environment.GetEnvironmentVariable("BITBUCKET_TAG"), "refs/tags/");
2727

2828
/// <inheritdoc />
2929
public string GitCommitId => Environment.GetEnvironmentVariable("BITBUCKET_COMMIT");

0 commit comments

Comments
 (0)