installStepsContainNodeSetup reports whether any of the provided steps is already a "Setup Node.js" step. Uses the same extractStepName matcher as JobManager.ValidateDuplicateSteps so the guard cannot drift from what the validator would flag as a duplicate.
(steps []GitHubActionStep)
| 30 | // JobManager.ValidateDuplicateSteps so the guard cannot drift from what the |
| 31 | // validator would flag as a duplicate. |
| 32 | func installStepsContainNodeSetup(steps []GitHubActionStep) bool { |
| 33 | for _, step := range steps { |
| 34 | if extractStepName(strings.Join(step, "\n")) == "Setup Node.js" { |
| 35 | return true |
| 36 | } |
| 37 | } |
| 38 | return false |
| 39 | } |
| 40 | |
| 41 | // By default, --ignore-scripts is added to the install command to prevent pre/post install |
| 42 | // scripts from executing (supply chain security). Pass runInstallScripts=true to allow scripts. |