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

Function postRepoVariable

pkg/cmd/variable/set/http.go:122–132  ·  view source on GitHub ↗
(client *api.Client, repo ghrepo.Interface, variableName, value string)

Source from the content-addressed store, hash-verified

120}
121
122func postRepoVariable(client *api.Client, repo ghrepo.Interface, variableName, value string) error {
123 payload := setPayload{
124 Name: variableName,
125 Value: value,
126 }
127 path, err := safeurl.JoinPath("repos", repo.RepoOwner(), repo.RepoName(), "actions", "variables")
128 if err != nil {
129 return err
130 }
131 return postVariable(client, repo.RepoHost(), path, payload)
132}
133
134func patchVariable(client *api.Client, host string, path safeurl.SafeURL, payload any) error {
135 payloadBytes, err := json.Marshal(payload)

Callers 1

setVariableFunction · 0.85

Calls 5

JoinPathFunction · 0.92
postVariableFunction · 0.85
RepoOwnerMethod · 0.65
RepoNameMethod · 0.65
RepoHostMethod · 0.65

Tested by

no test coverage detected