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)
| 220 | // |
| 221 | //meta:operation PUT /repos/{owner}/{repo}/codespaces/secrets/{secret_name} |
| 222 | func (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 | |
| 231 | func (s *CodespacesService) createOrUpdateSecret(ctx context.Context, url string, eSecret *EncryptedSecret) (*Response, error) { |
| 232 | req, err := s.client.NewRequest(ctx, "PUT", url, eSecret) |
nothing calls this directly
no test coverage detected