MCPcopy Create free account
hub / github.com/github/awesome-copilot / validateCommitSha

Function validateCommitSha

eng/external-plugin-validation.mjs:273–282  ·  view source on GitHub ↗
(sha, prefix, errors)

Source from the content-addressed store, hash-verified

271}
272
273function 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
284function validateGitHubSource(source, prefix, errors, requireImmutableLocator) {
285 if (!source || typeof source !== "object" || Array.isArray(source)) {

Callers 1

validateGitHubSourceFunction · 0.85

Calls 1

isNonEmptyStringFunction · 0.85

Tested by

no test coverage detected