MCPcopy Create free account
hub / github.com/google/go-github / CreateOrUpdateOrgSecret

Method CreateOrUpdateOrgSecret

github/actions_secrets.go:263–270  ·  view source on GitHub ↗

CreateOrUpdateOrgSecret creates or updates an organization secret with an encrypted value. GitHub API docs: https://docs.github.com/rest/actions/secrets?apiVersion=2022-11-28#create-or-update-an-organization-secret meta:operation PUT /orgs/{org}/actions/secrets/{secret_name}

(ctx context.Context, org string, eSecret *EncryptedSecret)

Source from the content-addressed store, hash-verified

261//
262//meta:operation PUT /orgs/{org}/actions/secrets/{secret_name}
263func (s *ActionsService) CreateOrUpdateOrgSecret(ctx context.Context, org string, eSecret *EncryptedSecret) (*Response, error) {
264 if eSecret == nil {
265 return nil, errors.New("encrypted secret must be provided")
266 }
267
268 url := fmt.Sprintf("orgs/%v/actions/secrets/%v", org, eSecret.Name)
269 return s.putSecret(ctx, url, eSecret)
270}
271
272// CreateOrUpdateEnvSecret creates or updates a single environment secret with an encrypted value.
273//

Calls 1

putSecretMethod · 0.95