add a comment to an issue and return it ID
(ctx context.Context, gc *gitlab.Client, repositoryID string, issueID int, body string)
| 439 | |
| 440 | // add a comment to an issue and return it ID |
| 441 | func addCommentGitlabIssue(ctx context.Context, gc *gitlab.Client, repositoryID string, issueID int, body string) (int, error) { |
| 442 | ctx, cancel := context.WithTimeout(ctx, defaultTimeout) |
| 443 | defer cancel() |
| 444 | note, _, err := gc.Notes.CreateIssueNote( |
| 445 | repositoryID, issueID, |
| 446 | &gitlab.CreateIssueNoteOptions{ |
| 447 | Body: &body, |
| 448 | }, |
| 449 | gitlab.WithContext(ctx), |
| 450 | ) |
| 451 | if err != nil { |
| 452 | return 0, err |
| 453 | } |
| 454 | |
| 455 | return note.ID, nil |
| 456 | } |
| 457 | |
| 458 | func editCommentGitlabIssue(ctx context.Context, gc *gitlab.Client, repositoryID string, issueID, noteID int, body string) error { |
| 459 | ctx, cancel := context.WithTimeout(ctx, defaultTimeout) |