flattenSingleFileArtifacts applies the artifact unfold rule to downloaded artifacts Unfold rule: If an artifact download folder contains a single file, move the file to root and delete the folder This simplifies artifact access by removing unnecessary nesting for single-file artifacts downloadWorkfl
(repo string)
| 448 | // for resolving a workflow display name: they are authoritative only when --repo points |
| 449 | // to the same repository that is checked out locally. |
| 450 | func repoIsLocal(repo string) bool { |
| 451 | // Strip optional HOST/ prefix (e.g. "github.com/owner/repo" → "owner/repo") |
| 452 | ownerRepo, _ := repoutil.NormalizeRepoForAPI(repo) |
| 453 | |
| 454 | // Fast path: GITHUB_REPOSITORY is always the current repo in MCP server containers. |
| 455 | if envRepo := os.Getenv("GITHUB_REPOSITORY"); envRepo != "" { |
| 456 | return strings.EqualFold(ownerRepo, envRepo) |
| 457 | } |
| 458 | |
| 459 | // Fallback: detect from git remote / gh CLI (result is cached on first call). |
| 460 | currentRepo, err := GetCurrentRepoSlug() |
| 461 | if err != nil { |
| 462 | logsCommandLog.Printf("Could not determine current repo slug for comparison: %v", err) |
| 463 | return false |
| 464 | } |
| 465 | return strings.EqualFold(ownerRepo, currentRepo) |
| 466 | } |
| 467 | |
| 468 | // validateReportFileFlags returns an error if --report-file is combined with an |
| 469 | // incompatible flag. --report-file only takes effect for --format markdown output |
no test coverage detected