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

Function validateLabels

actions/setup/js/close_issue.cjs:148–161  ·  view source on GitHub ↗
(entity, entityNumber, requiredLabels)

Source from the content-addressed store, hash-verified

146 getDetails: getIssueDetails,
147
148 validateLabels(entity, entityNumber, requiredLabels) {
149 if (requiredLabels.length > 0) {
150 const issueLabels = entity.labels.map(/** @param {any} l */ l => (typeof l === "string" ? l : l.name || ""));
151 const missingLabels = requiredLabels.filter(required => !issueLabels.includes(required));
152 if (missingLabels.length > 0) {
153 return {
154 valid: false,
155 warning: `Issue #${entityNumber} missing required labels: ${missingLabels.join(", ")}`,
156 error: `Missing required labels: ${missingLabels.join(", ")}`,
157 };
158 }
159 }
160 return { valid: true };
161 },
162
163 buildCommentBody(sanitizedBody) {
164 // Issues post the sanitized body directly without a workflow footer

Callers 3

remove_labels.cjsFile · 0.70
add_labels.cjsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected