mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2026-04-15 01:41:56 +00:00
fix(bbdc): resolve annotated tag object SHA to commit SHA before posting build status (#6203)
Co-authored-by: Harri <harri.eranen@nordhero.com>
This commit is contained in:
@@ -579,6 +579,14 @@ func (c *client) updatePipelineFromCommits(ctx context.Context, u *model.User, r
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("unable to read commit: %w", err)
|
||||
}
|
||||
|
||||
// In Bitbucket Data Center, when using annotated tags, the webhook's ToHash is the tag object SHA, not the actual commit SHA.
|
||||
// Update p.Commit so that build statuses are posted to the correct commit SHA.
|
||||
if p.Event == model.EventTag && commit.ID != "" && commit.ID != p.Commit {
|
||||
p.Commit = commit.ID
|
||||
p.ForgeURL = fmt.Sprintf("%s/projects/%s/repos/%s/commits/%s", c.url, r.Owner, r.Name, commit.ID)
|
||||
}
|
||||
|
||||
p.Message = commit.Message
|
||||
|
||||
opts := &bb.CompareChangesOptions{}
|
||||
|
||||
Reference in New Issue
Block a user