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

Function tryResolveSetupSHA

pkg/workflow/action_reference.go:109–123  ·  view source on GitHub ↗
(ctx context.Context, resolver SHAResolver, actionRepo, tag, remoteRef, modeLabel string)

Source from the content-addressed store, hash-verified

107}
108
109func tryResolveSetupSHA(ctx context.Context, resolver SHAResolver, actionRepo, tag, remoteRef, modeLabel string) string {
110 if resolver == nil {
111 return ""
112 }
113 sha, err := resolver.ResolveSHA(ctx, actionRepo, tag)
114 if err == nil && sha != "" {
115 pinnedRef := formatActionReference(actionRepo, sha, tag)
116 actionRefLog.Printf("%s: resolved %s to SHA-pinned reference: %s", modeLabel, remoteRef, pinnedRef)
117 return pinnedRef
118 }
119 if err != nil {
120 actionRefLog.Printf("Failed to resolve SHA for %s@%s: %v", actionRepo, tag, err)
121 }
122 return ""
123}
124
125// resolveActionReference converts a local action path to the appropriate reference
126// based on the current action mode (dev vs release vs action).

Callers 2

Calls 3

formatActionReferenceFunction · 0.85
ResolveSHAMethod · 0.65
PrintfMethod · 0.45

Tested by

no test coverage detected