34 lines
1 KiB
Go
34 lines
1 KiB
Go
|
// Copyright 2024 The Forgejo Authors. All rights reserved.
|
||
|
// Use of this source code is governed by a MIT-style
|
||
|
// license that can be found in the LICENSE file.
|
||
|
|
||
|
// Copyright 2024 The Gitea Authors. All rights reserved.
|
||
|
// Use of this source code is governed by a MIT-style
|
||
|
// license that can be found in the LICENSE file.
|
||
|
|
||
|
package forgejo
|
||
|
|
||
|
import (
|
||
|
"fmt"
|
||
|
"net/url"
|
||
|
)
|
||
|
|
||
|
// ListRepoActionSecretOption list RepoActionSecret options
|
||
|
type ListRepoActionSecretOption struct {
|
||
|
ListOptions
|
||
|
}
|
||
|
|
||
|
// ListRepoActionSecret list a repository's secrets
|
||
|
func (c *Client) ListRepoActionSecret(user, repo string, opt ListRepoActionSecretOption) ([]*Secret, *Response, error) {
|
||
|
if err := escapeValidatePathSegments(&user, &repo); err != nil {
|
||
|
return nil, nil, err
|
||
|
}
|
||
|
opt.setDefaults()
|
||
|
secrets := make([]*Secret, 0, opt.PageSize)
|
||
|
|
||
|
link, _ := url.Parse(fmt.Sprintf("/repos/%s/%s/actions/secrets", user, repo))
|
||
|
link.RawQuery = opt.getURLQuery().Encode()
|
||
|
resp, err := c.getParsedResponse("GET", link.String(), jsonHeader, nil, &secrets)
|
||
|
return secrets, resp, err
|
||
|
}
|