Skip to content

Commit

Permalink
feat: repo install endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
plyr4 committed Oct 8, 2024
1 parent 05703df commit d7da8e7
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
2 changes: 2 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,5 @@ require (
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)

replace github.com/go-vela/types => ../types
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ github.com/go-playground/validator/v10 v10.22.1 h1:40JcKH+bBNGFczGuoBYgX4I6m/i27
github.com/go-playground/validator/v10 v10.22.1/go.mod h1:dbuPbCMFw/DrkbEynArYaCwl3amGuJotoKCe95atGMM=
github.com/go-vela/server v0.25.1 h1:KM3g5ZD3N6SnttnkfOyJjS2utbL6baKx0mGSJLCEf0c=
github.com/go-vela/server v0.25.1/go.mod h1:QZ9troVMUpDCAdUxxAquHqahkeSwp9Lmx6a47ao0gGs=
github.com/go-vela/types v0.25.1 h1:DCPHv1+ouqldjfsjfcVTcm/Yyd0OwazIfxYyR+GwpMo=
github.com/go-vela/types v0.25.1/go.mod h1:5+MHUI9ZSY2Uz1cTJa64FWUv8jKzzUUq96UQTokGJzs=
github.com/goccy/go-json v0.10.3 h1:KZ5WoDbxAIgm2HNbYckL0se1fHD6rz5j4ywS6ebzDqA=
github.com/goccy/go-json v0.10.3/go.mod h1:oq7eo15ShAhp70Anwd5lgX2pLfOS3QCiwU/PULtXL6M=
github.com/golang-jwt/jwt/v5 v5.2.1 h1:OuVbFODueb089Lh128TAcimifWaLhJwVflnrgM17wHk=
Expand Down
14 changes: 14 additions & 0 deletions vela/repo.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,3 +115,17 @@ func (svc *RepoService) Chown(org, repo string) (*string, *Response, error) {

return v, resp, err
}

// InstallHTMLURL retrieves installation HTML URL for a repo.
func (svc *RepoService) InstallHTMLURL(org, repo string) (*string, *Response, error) {
// set the API endpoint path we send the request to
u := fmt.Sprintf("/api/v1/repos/%s/%s/install/html_url", org, repo)

// string type we want to return
v := new(string)

// send request using client
resp, err := svc.client.Call("GET", u, nil, v)

return v, resp, err
}

0 comments on commit d7da8e7

Please sign in to comment.