resolveSetupActionRef is the internal implementation of ResolveSetupActionReference that accepts an optional actionsOrgRepo override. When actionsOrgRepo is empty, GitHubActionsOrgRepo is used.
(ctx context.Context, actionMode ActionMode, version string, actionTag string, resolver SHAResolver, actionsOrgRepo string)
| 43 | // that accepts an optional actionsOrgRepo override. When actionsOrgRepo is empty, |
| 44 | // GitHubActionsOrgRepo is used. |
| 45 | func resolveSetupActionRef(ctx context.Context, actionMode ActionMode, version string, actionTag string, resolver SHAResolver, actionsOrgRepo string) string { |
| 46 | if actionsOrgRepo == "" { |
| 47 | actionsOrgRepo = GitHubActionsOrgRepo |
| 48 | } |
| 49 | |
| 50 | localPath := "./actions/setup" |
| 51 | |
| 52 | if actionMode == ActionModeDev { |
| 53 | actionRefLog.Printf("Dev mode: using local action path: %s", localPath) |
| 54 | return localPath |
| 55 | } |
| 56 | if actionMode == ActionModeAction { |
| 57 | return resolveSetupActionModeRef(ctx, actionTag, version, resolver, actionsOrgRepo, localPath) |
| 58 | } |
| 59 | if actionMode == ActionModeRelease { |
| 60 | return resolveSetupReleaseModeRef(ctx, actionTag, version, resolver, localPath) |
| 61 | } |
| 62 | actionRefLog.Printf("WARNING: Unknown action mode %s, defaulting to local path", actionMode) |
| 63 | return localPath |
| 64 | } |
| 65 | |
| 66 | func resolveSetupActionModeRef(ctx context.Context, actionTag string, version string, resolver SHAResolver, actionsOrgRepo string, localPath string) string { |
| 67 | tag, ok := resolveSetupTag(actionTag, version, localPath) |
no test coverage detected