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

Function postVariable

pkg/cmd/variable/set/http.go:87–94  ·  view source on GitHub ↗
(client *api.Client, host string, path safeurl.SafeURL, payload any)

Source from the content-addressed store, hash-verified

85}
86
87func postVariable(client *api.Client, host string, path safeurl.SafeURL, payload any) error {
88 payloadBytes, err := json.Marshal(payload)
89 if err != nil {
90 return fmt.Errorf("failed to serialize: %w", err)
91 }
92 requestBody := bytes.NewReader(payloadBytes)
93 return client.REST(host, "POST", path.String(), requestBody, nil)
94}
95
96func postOrgVariable(client *api.Client, host, orgName, visibility, variableName, value string, repositoryIDs []int64) error {
97 payload := setPayload{

Callers 3

postOrgVariableFunction · 0.85
postEnvVariableFunction · 0.85
postRepoVariableFunction · 0.85

Calls 3

ErrorfMethod · 0.65
RESTMethod · 0.65
StringMethod · 0.65

Tested by

no test coverage detected