The repoutil package provides utility functions for working with GitHub repository slugs.
This package offers focused helpers for parsing and normalizing repository identifiers, which are used throughout the codebase wherever GitHub repositories are referenced.
import "github.com/github/gh-aw/pkg/repoutil"
owner, repo, err := repoutil.SplitRepoSlug("github/gh-aw")
if err != nil {
return fmt.Errorf("invalid repository: %w", err)
}
// owner = "github", repo = "gh-aw"Internal:
github.com/github/gh-aw/pkg/logger— debug logging
Both functions are pure and stateless; they MAY be called concurrently without synchronization.
- All debug output uses
logger.New("repoutil:repoutil")and is only emitted whenDEBUG=repoutil:*. - For paths that include sub-folders (e.g. GitHub Actions
uses:fields such asgithub/codeql-action/upload-sarif), usegitutil.ExtractBaseRepofirst to strip the sub-path before callingSplitRepoSlug. NormalizeRepoForAPIonly treats three-segment strings asHOST/owner/repo; plainowner/repovalues are returned unchanged with an empty host.
Reviewed against source on 2026-07-26; no public-contract deltas identified. Re-verified on 2026-08-14; still no public-contract deltas. Re-verified on 2026-08-29; still no public-contract deltas. Re-verified on 2026-09-03; still no public-contract deltas. Re-verified on 2026-09-08; still no public-contract deltas. Re-verified on 2026-09-13; still no public-contract deltas. Re-verified on 2026-09-23; still no public-contract deltas. Re-verified on 2026-09-28; still no public-contract deltas.
This specification is automatically maintained by the spec-extractor workflow.
