From 5ed9fc6b0e5e5feaa0a64a72156f2b29a7bd2123 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=AA=20Ho=C3=A0ng=20Ph=C6=B0=C6=A1ng?= Date: Wed, 22 Apr 2026 17:39:37 +0900 Subject: [PATCH] Add refname to bitbucket commit status (#6482) --- server/forge/bitbucket/bitbucket.go | 5 +++++ server/forge/bitbucket/internal/types.go | 11 ++++++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/server/forge/bitbucket/bitbucket.go b/server/forge/bitbucket/bitbucket.go index 3cdb735b9..8dadee19e 100644 --- a/server/forge/bitbucket/bitbucket.go +++ b/server/forge/bitbucket/bitbucket.go @@ -327,6 +327,11 @@ func (c *config) Status(ctx context.Context, user *model.User, repo *model.Repo, Key: common.GetPipelineStatusContext(repo, pipeline, workflow), URL: common.GetPipelineStatusURL(repo, pipeline, workflow), } + + if pipeline.Event == model.EventPush || pipeline.IsPullRequest() { + status.Refname = pipeline.Branch + } + return c.newClient(ctx, user).CreateStatus(repo.Owner, repo.Name, pipeline.Commit, &status) } diff --git a/server/forge/bitbucket/internal/types.go b/server/forge/bitbucket/internal/types.go index ca38c0e98..d2b9f96e0 100644 --- a/server/forge/bitbucket/internal/types.go +++ b/server/forge/bitbucket/internal/types.go @@ -52,11 +52,12 @@ type WorkspacesResp struct { } type PipelineStatus struct { - State string `json:"state"` - Key string `json:"key"` - Name string `json:"name,omitempty"` - URL string `json:"url"` - Desc string `json:"description,omitempty"` + State string `json:"state"` + Key string `json:"key"` + Name string `json:"name,omitempty"` + URL string `json:"url"` + Desc string `json:"description,omitempty"` + Refname string `json:"refname,omitempty"` } type Email struct {