MCPcopy Create free account
hub / github.com/cli/cli / putOrgSecret

Function putOrgSecret

pkg/cmd/secret/set/http.go:85–115  ·  view source on GitHub ↗
(client *api.Client, host string, pk *PubKey, orgName, visibility, secretName, eValue string, repositoryIDs []int64, app shared.App)

Source from the content-addressed store, hash-verified

83}
84
85func putOrgSecret(client *api.Client, host string, pk *PubKey, orgName, visibility, secretName, eValue string, repositoryIDs []int64, app shared.App) error {
86 path, err := safeurl.JoinPath("orgs", orgName, string(app), "secrets", secretName)
87 if err != nil {
88 return err
89 }
90
91 if app == shared.Dependabot {
92 repos := make([]string, len(repositoryIDs))
93 for i, id := range repositoryIDs {
94 repos[i] = strconv.FormatInt(id, 10)
95 }
96
97 payload := DependabotSecretPayload{
98 EncryptedValue: eValue,
99 KeyID: pk.ID,
100 Repositories: repos,
101 Visibility: visibility,
102 }
103
104 return putSecret(client, host, path, payload)
105 }
106
107 payload := SecretPayload{
108 EncryptedValue: eValue,
109 KeyID: pk.ID,
110 Repositories: repositoryIDs,
111 Visibility: visibility,
112 }
113
114 return putSecret(client, host, path, payload)
115}
116
117func putUserSecret(client *api.Client, host string, pk *PubKey, key, eValue string, repositoryIDs []int64) error {
118 payload := SecretPayload{

Callers 1

setSecretFunction · 0.85

Calls 2

JoinPathFunction · 0.92
putSecretFunction · 0.85

Tested by

no test coverage detected