isCompositeAction checks if an action uses the 'composite' runtime
(actionPath string)
| 287 | |
| 288 | // isCompositeAction checks if an action uses the 'composite' runtime |
| 289 | func 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/ |