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

Function resolveActionRef

pkg/workflow/maintenance_workflow.go:69–79  ·  view source on GitHub ↗

resolveActionRef attempts to resolve an action repo@tag to a SHA-pinned reference using the provided resolver. If the resolver is nil or resolution fails, it returns the tag-based reference (repo@tag).

(ctx context.Context, actionRepo, tag string, resolver SHAResolver)

Source from the content-addressed store, hash-verified

67// using the provided resolver. If the resolver is nil or resolution fails, it returns
68// the tag-based reference (repo@tag).
69func resolveActionRef(ctx context.Context, actionRepo, tag string, resolver SHAResolver) string {
70 if resolver != nil && tag != "" && tag != "dev" {
71 sha, err := resolver.ResolveSHA(ctx, actionRepo, tag)
72 if err != nil {
73 maintenanceLog.Printf("Failed to resolve SHA for %s@%s: %v, falling back to tag reference", actionRepo, tag, err)
74 } else if sha != "" {
75 return formatActionReference(actionRepo, sha, tag)
76 }
77 }
78 return actionRepo + "@" + tag
79}
80
81// getCLICmdPrefix returns the CLI command prefix based on action mode.
82// In dev mode: "./gh-aw" (local binary built from source)

Callers 1

generateInstallCLIStepsFunction · 0.85

Calls 3

formatActionReferenceFunction · 0.85
ResolveSHAMethod · 0.65
PrintfMethod · 0.45

Tested by

no test coverage detected