MCPcopy Create free account
hub / github.com/github/gh-aw / createIssueForOrgRepo

Function createIssueForOrgRepo

pkg/cli/update_org.go:325–340  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

323// issues carrying the gh-aw-update XML marker are closed first so that only the
324// most recent notification remains.
325func 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
342func buildOrgUpdateIssue(preview orgRepoPreview, releaseTag, releaseURL, xmlMarker string) (string, string) {
343 title := "[aw] Updates available"

Callers

nothing calls this directly

Calls 7

FormatSuccessMessageFunction · 0.92
getGhawReleaseInfoFunction · 0.85
buildOrgXMLMarkerFunction · 0.85
buildOrgUpdateIssueFunction · 0.85
createOrgIssueFunction · 0.85
ErrorfMethod · 0.45

Tested by

no test coverage detected