MCPcopy Index your code
hub / github.com/google/go-github / CreateOrUpdateRepoSecret

Method CreateOrUpdateRepoSecret

github/codespaces_secrets.go:222–229  ·  view source on GitHub ↗

CreateOrUpdateRepoSecret creates or updates a repos codespace secret Creates or updates a repository secret with an encrypted value. Encrypt your secret using LibSodium. You must authenticate using an access token with the repo scope to use this endpoint. GitHub Apps must have write access to the c

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

Source from the content-addressed store, hash-verified

220//
221//meta:operation PUT /repos/{owner}/{repo}/codespaces/secrets/{secret_name}
222func (s *CodespacesService) CreateOrUpdateRepoSecret(ctx context.Context, owner, repo string, eSecret *EncryptedSecret) (*Response, error) {
223 if eSecret == nil {
224 return nil, errors.New("encrypted secret must be provided")
225 }
226
227 u := fmt.Sprintf("repos/%v/%v/codespaces/secrets/%v", owner, repo, eSecret.Name)
228 return s.createOrUpdateSecret(ctx, u, eSecret)
229}
230
231func (s *CodespacesService) createOrUpdateSecret(ctx context.Context, url string, eSecret *EncryptedSecret) (*Response, error) {
232 req, err := s.client.NewRequest(ctx, "PUT", url, eSecret)

Callers

nothing calls this directly

Calls 1

createOrUpdateSecretMethod · 0.95

Tested by

no test coverage detected