forgejo-sdk/forgejo/org_action.go

34 lines
1,021 B
Go
Raw Normal View History

// Copyright 2024 The Forgjo 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 2023 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"
)
// ListOrgMembershipOption list OrgMembership options
type ListOrgActionSecretOption struct {
ListOptions
}
// ListOrgMembership list an organization's members
func (c *Client) ListOrgActionSecret(org string, opt ListOrgActionSecretOption) ([]*Secret, *Response, error) {
if err := escapeValidatePathSegments(&org); err != nil {
return nil, nil, err
}
opt.setDefaults()
secrets := make([]*Secret, 0, opt.PageSize)
link, _ := url.Parse(fmt.Sprintf("/orgs/%s/actions/secrets", org))
link.RawQuery = opt.getURLQuery().Encode()
resp, err := c.getParsedResponse("GET", link.String(), jsonHeader, nil, &secrets)
return secrets, resp, err
}