Skip to content

[deep-report] Give GitHubReposScope a real type instead of bare any #55770

Closed

Description

@github-actions

Description

pkg/workflow/tools_types.go:306 defines type GitHubReposScope any // string or []any (YAML-parsed arrays are []any), used by the AllowedRepos (:325) and Repos (:327) fields. Because the type is a bare any, every caller has to type-switch between string and []any to use the value safely.

Expected Impact

Removes the repeated type-assertion boilerplate at every call site permanently, and makes the two valid YAML shapes (single repo string, or list of repos) explicit in the type system instead of implicit tribal knowledge in a comment.

Suggested Fix

Give it a real type with a custom UnmarshalYAML that normalizes both YAML shapes into []string internally:

type GitHubReposScope []string

func (s *GitHubReposScope) UnmarshalYAML(unmarshal func(any) error) error {
    var single string
    if err := unmarshal(&single); err == nil {
        *s = GitHubReposScope{single}
        return nil
    }
    var many []string
    if err := unmarshal(&many); err != nil {
        return err
    }
    *s = GitHubReposScope(many)
    return nil
}

Then update call sites that currently type-switch on the raw any.

Suggested Agent

General-purpose coding agent

Estimated Effort

Medium (2-3 hours)

Data Source

DeepReport analysis of Typist discussion #55753 (2026-08-25). Verified live at pkg/workflow/tools_types.go:306,325,327; no existing open issue found (search for "GitHubReposScope" returned 0 open matches).

Generated by 🔬 Deep Report · claude · agent · 213.6 AIC · ⌖ 8.79 AIC · ⊞ 12.4K · ◷

  • expires on Aug 27, 2026, 4:34 AM UTC-08:00

Activity

  1. github-actions commented on Aug 25, 2026

    @github-actions
    ContributorAuthor

    🍪 Issue Monster selected this for Copilot

    I've identified this issue as a good candidate for automated resolution and requested assignment to the Copilot coding agent.

    If assignment succeeds, the Copilot coding agent will analyze the issue and create a pull request with the fix.

    Om nom nom! 🍪

    🍪 Om nom nom by Issue Monster · codex · mai10 · 1.59 AIC · ⌖ 2.53 AIC · ⊞ 17.8K · ◷

  2. linked a pull request that will close this issueGive GitHubReposScope a concrete type #55793on Aug 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions