mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2025-03-28 23:25:32 +00:00
Fix bitbucket forge add repo (#1887)
The workspace is a required field for ivoking bitbucket's API. While workspace is not available it must be fetched through the Repos func. Fixes #1882
This commit is contained in:
parent
1fa0212731
commit
b1787f82dc
1 changed files with 12 additions and 0 deletions
|
@ -157,6 +157,18 @@ func (c *config) Repo(ctx context.Context, u *model.User, remoteID model.ForgeRe
|
|||
if remoteID.IsValid() {
|
||||
name = string(remoteID)
|
||||
}
|
||||
repos, err := c.Repos(ctx, u)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if len(owner) == 0 {
|
||||
for _, repo := range repos {
|
||||
if string(repo.ForgeRemoteID) == name {
|
||||
owner = repo.Owner
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
client := c.newClient(ctx, u)
|
||||
repo, err := client.FindRepo(owner, name)
|
||||
if err != nil {
|
||||
|
|
Loading…
Reference in a new issue