(localActionPath string, data *WorkflowData)
| 185 | } |
| 186 | |
| 187 | func (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. |
no test coverage detected