createIssueForOrgRepo opens a GitHub issue in the target repository listing the source-managed workflows that have updates available. Any previously-open issues carrying the gh-aw-update XML marker are closed first so that only the most recent notification remains.
(ctx context.Context, preview orgRepoPreview, verbose bool)
| 323 | // issues carrying the gh-aw-update XML marker are closed first so that only the |
| 324 | // most recent notification remains. |
| 325 | func createIssueForOrgRepo(ctx context.Context, preview orgRepoPreview, verbose bool) error { |
| 326 | releaseTag, releaseURL := getGhawReleaseInfo() |
| 327 | xmlMarker := buildOrgXMLMarker(ghawUpdateMarkerPrefix, releaseTag) |
| 328 | |
| 329 | // Close stale update issues before creating the new one. |
| 330 | closeExistingOrgIssuesByMarker(ctx, preview.Repo, ghawUpdateMarkerPrefix, verbose) |
| 331 | |
| 332 | title, body := buildOrgUpdateIssue(preview, releaseTag, releaseURL, xmlMarker) |
| 333 | |
| 334 | if err := createOrgIssue(ctx, preview.Repo, title, body, agenticWorkflowsLabel); err != nil { |
| 335 | return fmt.Errorf("failed to create issue in %s: %w", preview.Repo, err) |
| 336 | } |
| 337 | |
| 338 | fmt.Fprintln(os.Stderr, console.FormatSuccessMessage("Created issue in "+preview.Repo)) |
| 339 | return nil |
| 340 | } |
| 341 | |
| 342 | func buildOrgUpdateIssue(preview orgRepoPreview, releaseTag, releaseURL, xmlMarker string) (string, string) { |
| 343 | title := "[aw] Updates available" |
nothing calls this directly
no test coverage detected