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

Function resolveSetupActionRef

pkg/workflow/action_reference.go:45–64  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

43// that accepts an optional actionsOrgRepo override. When actionsOrgRepo is empty,
44// GitHubActionsOrgRepo is used.
45func 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
66func resolveSetupActionModeRef(ctx context.Context, actionTag string, version string, resolver SHAResolver, actionsOrgRepo string, localPath string) string {
67 tag, ok := resolveSetupTag(actionTag, version, localPath)

Callers 2

resolveSetupReferenceMethod · 0.85

Calls 3

PrintfMethod · 0.45

Tested by

no test coverage detected