mirror of
https://codeberg.org/crowci/crow.git
synced 2025-08-12 06:02:53 +03:00
Set correct link for commit (#3368)
Closes https://github.com/woodpecker-ci/woodpecker/issues/2657 Closes https://github.com/woodpecker-ci/woodpecker/issues/906
This commit is contained in:
@@ -565,13 +565,16 @@ func (c *client) Branches(ctx context.Context, u *model.User, r *model.Repo, p *
|
||||
}
|
||||
|
||||
// BranchHead returns the sha of the head (latest commit) of the specified branch
|
||||
func (c *client) BranchHead(ctx context.Context, u *model.User, r *model.Repo, branch string) (string, error) {
|
||||
func (c *client) BranchHead(ctx context.Context, u *model.User, r *model.Repo, branch string) (*model.Commit, error) {
|
||||
token := common.UserToken(ctx, r, u)
|
||||
b, _, err := c.newClientToken(ctx, token).Repositories.GetBranch(ctx, r.Owner, r.Name, branch, 1)
|
||||
if err != nil {
|
||||
return "", err
|
||||
return nil, err
|
||||
}
|
||||
return b.GetCommit().GetSHA(), nil
|
||||
return &model.Commit{
|
||||
SHA: b.GetCommit().GetSHA(),
|
||||
ForgeURL: b.GetCommit().GetHTMLURL(),
|
||||
}, nil
|
||||
}
|
||||
|
||||
// Hook parses the post-commit hook from the Request body
|
||||
|
Reference in New Issue
Block a user