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)
| 67 | // using the provided resolver. If the resolver is nil or resolution fails, it returns |
| 68 | // the tag-based reference (repo@tag). |
| 69 | func 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) |
no test coverage detected