Skip to content

Commit

Permalink
Fix BitBucket recognition of publicReleaseRefSpec
Browse files Browse the repository at this point in the history
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
  • Loading branch information
AArnott committed May 10, 2023
1 parent 518ee61 commit d33a5d4
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ public class BitbucketCloud : ICloudBuild
public bool IsPullRequest => !string.IsNullOrWhiteSpace(Environment.GetEnvironmentVariable("BITBUCKET_PR_ID"));

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

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

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

0 comments on commit d33a5d4

Please sign in to comment.