(sha, prefix, errors)
| 271 | } |
| 272 | |
| 273 | function validateCommitSha(sha, prefix, errors) { |
| 274 | if (!isNonEmptyString(sha)) { |
| 275 | errors.push(`${prefix}: "source.sha" must be a non-empty string when provided`); |
| 276 | return; |
| 277 | } |
| 278 | |
| 279 | if (!/^[0-9a-f]{40}$/i.test(sha)) { |
| 280 | errors.push(`${prefix}: "source.sha" must be a full 40-character commit SHA`); |
| 281 | } |
| 282 | } |
| 283 | |
| 284 | function validateGitHubSource(source, prefix, errors, requireImmutableLocator) { |
| 285 | if (!source || typeof source !== "object" || Array.isArray(source)) { |
no test coverage detected