client: Fix RepoPost path (#2091)

Closes https://github.com/woodpecker-ci/woodpecker/issues/2088
This commit is contained in:
runephilosof-karnovgroup 2023-08-03 02:35:03 +02:00 committed by GitHub
parent 0314cb5ada
commit 235619e4a0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -28,6 +28,7 @@ import (
const ( const (
pathSelf = "%s/api/user" pathSelf = "%s/api/user"
pathRepos = "%s/api/user/repos" pathRepos = "%s/api/user/repos"
pathRepoPost = "%s/api/repos?forge_remote_id=%d"
pathRepo = "%s/api/repos/%d" pathRepo = "%s/api/repos/%d"
pathRepoLookup = "%s/api/repos/lookup/%s" pathRepoLookup = "%s/api/repos/lookup/%s"
pathRepoMove = "%s/api/repos/%d/move?to=%s" pathRepoMove = "%s/api/repos/%d/move?to=%s"
@ -174,7 +175,7 @@ func (c *client) RepoListOpts(sync, all bool) ([]*Repo, error) {
// RepoPost activates a repository. // RepoPost activates a repository.
func (c *client) RepoPost(forgeRemoteID int64) (*Repo, error) { func (c *client) RepoPost(forgeRemoteID int64) (*Repo, error) {
out := new(Repo) out := new(Repo)
uri := fmt.Sprintf(pathRepo, c.addr, forgeRemoteID) uri := fmt.Sprintf(pathRepoPost, c.addr, forgeRemoteID)
err := c.post(uri, nil, out) err := c.post(uri, nil, out)
return out, err return out, err
} }