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

Method CreateOrUpdateRepoSecret

github/actions_secrets.go:249–256  ·  view source on GitHub ↗

CreateOrUpdateRepoSecret creates or updates a repository secret with an encrypted value. GitHub API docs: https://docs.github.com/rest/actions/secrets?apiVersion=2022-11-28#create-or-update-a-repository-secret meta:operation PUT /repos/{owner}/{repo}/actions/secrets/{secret_name}

(ctx context.Context, owner, repo string, eSecret *EncryptedSecret)

Source from the content-addressed store, hash-verified

247//
248//meta:operation PUT /repos/{owner}/{repo}/actions/secrets/{secret_name}
249func (s *ActionsService) CreateOrUpdateRepoSecret(ctx context.Context, owner, repo string, eSecret *EncryptedSecret) (*Response, error) {
250 if eSecret == nil {
251 return nil, errors.New("encrypted secret must be provided")
252 }
253
254 url := fmt.Sprintf("repos/%v/%v/actions/secrets/%v", owner, repo, eSecret.Name)
255 return s.putSecret(ctx, url, eSecret)
256}
257
258// CreateOrUpdateOrgSecret creates or updates an organization secret with an encrypted value.
259//

Calls 1

putSecretMethod · 0.95