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

Function isCompositeAction

pkg/cli/actions_build_command.go:289–298  ·  view source on GitHub ↗

isCompositeAction checks if an action uses the 'composite' runtime

(actionPath string)

Source from the content-addressed store, hash-verified

287
288// isCompositeAction checks if an action uses the 'composite' runtime
289func isCompositeAction(actionPath string) (bool, error) {
290 ymlPath := filepath.Join(actionPath, "action.yml")
291 content, err := os.ReadFile(ymlPath)
292 if err != nil {
293 return false, fmt.Errorf("failed to read action.yml: %w", err)
294 }
295
296 contentStr := string(content)
297 return strings.Contains(contentStr, "using: 'composite'") || strings.Contains(contentStr, "using: \"composite\""), nil
298}
299
300// buildSetupAction builds the setup action by checking that source files exist.
301// Note: Both JavaScript and shell scripts are source of truth in actions/setup/js/ and actions/setup/sh/

Callers 2

buildActionFunction · 0.85
TestIsCompositeActionFunction · 0.85

Calls 1

ErrorfMethod · 0.45

Tested by 1

TestIsCompositeActionFunction · 0.68