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

Method resolveReleaseActionReference

pkg/workflow/action_reference.go:187–210  ·  view source on GitHub ↗
(localActionPath string, data *WorkflowData)

Source from the content-addressed store, hash-verified

185}
186
187func (c *Compiler) resolveReleaseActionReference(localActionPath string, data *WorkflowData) string {
188 remoteRef := c.convertToRemoteActionRef(localActionPath, data)
189 if remoteRef == "" {
190 actionRefLog.Printf("WARNING: Could not resolve remote reference for %s", localActionPath)
191 return ""
192 }
193 actionRepo := extractActionRepo(remoteRef)
194 version := extractActionVersion(remoteRef)
195 if actionRepo == "" || version == "" {
196 actionRefLog.Printf("Release mode: using tag-based remote action reference: %s", remoteRef)
197 return remoteRef
198 }
199 pinnedRef, err := getActionPinWithData(actionRepo, version, data)
200 if err != nil {
201 actionRefLog.Printf("Failed to pin action %s@%s: %v", actionRepo, version, err)
202 return ""
203 }
204 if pinnedRef != "" {
205 actionRefLog.Printf("Release mode: resolved %s to SHA-pinned reference: %s", remoteRef, pinnedRef)
206 return pinnedRef
207 }
208 actionRefLog.Printf("Release mode: using tag-based remote action reference: %s", remoteRef)
209 return remoteRef
210}
211
212// convertToRemoteActionRef converts a local action path to a tag-based remote reference
213// that will be resolved to a SHA later in the release pipeline using action pins.

Callers 1

Calls 5

extractActionRepoFunction · 0.85
extractActionVersionFunction · 0.85
getActionPinWithDataFunction · 0.85
PrintfMethod · 0.45

Tested by

no test coverage detected