()
| 304 | } |
| 305 | |
| 306 | func parseCredentialsUpdateParams() (params.UpdateGithubCredentialsParams, error) { |
| 307 | var updateParams params.UpdateGithubCredentialsParams |
| 308 | |
| 309 | if credentialsAppInstallationID != 0 || credentialsAppID != 0 || credentialsPrivateKeyPath != "" { |
| 310 | updateParams.App = ¶ms.GithubApp{} |
| 311 | } |
| 312 | |
| 313 | if credentialsName != "" { |
| 314 | updateParams.Name = &credentialsName |
| 315 | } |
| 316 | |
| 317 | if credentialsDescription != "" { |
| 318 | updateParams.Description = &credentialsDescription |
| 319 | } |
| 320 | |
| 321 | if credentialsOAuthToken != "" { |
| 322 | if updateParams.PAT == nil { |
| 323 | updateParams.PAT = ¶ms.GithubPAT{} |
| 324 | } |
| 325 | updateParams.PAT.OAuth2Token = credentialsOAuthToken |
| 326 | } |
| 327 | |
| 328 | if credentialsAppInstallationID != 0 { |
| 329 | updateParams.App.InstallationID = credentialsAppInstallationID |
| 330 | } |
| 331 | |
| 332 | if credentialsAppID != 0 { |
| 333 | updateParams.App.AppID = credentialsAppID |
| 334 | } |
| 335 | |
| 336 | if credentialsPrivateKeyPath != "" { |
| 337 | keyContents, err := parsePrivateKeyFromPath(credentialsPrivateKeyPath) |
| 338 | if err != nil { |
| 339 | return params.UpdateGithubCredentialsParams{}, err |
| 340 | } |
| 341 | updateParams.App.PrivateKeyBytes = keyContents |
| 342 | } |
| 343 | |
| 344 | return updateParams, nil |
| 345 | } |
| 346 | |
| 347 | func formatGithubCredentials(creds []params.ForgeCredentials) { |
| 348 | if outputFormat == common.OutputFormatJSON { |
no test coverage detected