createIssueForUpgradeOrgRepo opens a GitHub issue in the target repository to notify maintainers that agentic workflow upgrades are available. Any previously-open issues carrying the gh-aw-upgrade XML marker are closed first so that only the most recent notification remains.
(ctx context.Context, repo string, verbose bool)
| 321 | // previously-open issues carrying the gh-aw-upgrade XML marker are closed first |
| 322 | // so that only the most recent notification remains. |
| 323 | func createIssueForUpgradeOrgRepo(ctx context.Context, repo string, verbose bool) error { |
| 324 | title := "[aw] Upgrade available" |
| 325 | |
| 326 | releaseTag, releaseURL := getGhawReleaseInfo() |
| 327 | xmlMarker := buildOrgXMLMarker(ghawUpgradeMarkerPrefix, releaseTag) |
| 328 | |
| 329 | // Close stale upgrade issues before creating the new one. |
| 330 | closeExistingOrgIssuesByMarker(ctx, repo, ghawUpgradeMarkerPrefix, verbose) |
| 331 | |
| 332 | var releaseSection string |
| 333 | if releaseURL != "" { |
| 334 | releaseSection = fmt.Sprintf("\n[View gh-aw release %s](%s)\n", releaseTag, releaseURL) |
| 335 | } |
| 336 | |
| 337 | body := "Agentic workflow files detected in this repository may have upgrades available.\n\n" + |
| 338 | "Run `gh aw upgrade` to apply the latest codemods, update GitHub Actions versions, and recompile all workflows.\n\n" + |
| 339 | "Review the upgrade output and any generated changes before committing to ensure there are no unexpected modifications.\n" + |
| 340 | releaseSection + "\n" + |
| 341 | "### How to execute\n\n" + |
| 342 | "- **Assign to agent**: Assign this issue to Copilot to automatically apply the upgrade\n" + |
| 343 | "- **Via @copilot comment**: Add a comment `@copilot upgrade agentic workflows` on this issue\n" + |
| 344 | "- **Via CLI**: Run `gh aw upgrade` in your local checkout\n\n" + |
| 345 | xmlMarker + "\n" |
| 346 | |
| 347 | if verbose { |
| 348 | fmt.Fprintln(os.Stderr, console.FormatVerboseMessage("Creating upgrade issue in "+repo+"...")) |
| 349 | } |
| 350 | |
| 351 | if err := createOrgIssue(ctx, repo, title, body, agenticWorkflowsLabel); err != nil { |
| 352 | return fmt.Errorf("failed to create issue in %s: %w", repo, err) |
| 353 | } |
| 354 | |
| 355 | fmt.Fprintln(os.Stderr, console.FormatSuccessMessage("Created issue in "+repo)) |
| 356 | return nil |
| 357 | } |
nothing calls this directly
no test coverage detected