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

Function validateAllowedIssueFieldName

actions/setup/js/allowed_issue_fields.cjs:34–41  ·  view source on GitHub ↗

* Validate one issue field name against configured allowed-fields. * @param {string} fieldName * @param {string[]} allowedFields * @returns {void}

(fieldName, allowedFields)

Source from the content-addressed store, hash-verified

32 * @returns {void}
33 */
34function validateAllowedIssueFieldName(fieldName, allowedFields) {
35 if (!fieldName) return;
36 const fieldSet = buildAllowedFieldSet(allowedFields);
37 if (!fieldSet) return;
38 if (!fieldSet.has(fieldName.toLowerCase())) {
39 throw new Error(`${ERR_VALIDATION}: issue field "${fieldName}" is not in the allowed-fields list: ${allowedFields.join(", ")}`);
40 }
41}
42
43/**
44 * Validate requested issue fields against configured allowed-fields.

Callers 2

mainFunction · 0.85

Calls 1

buildAllowedFieldSetFunction · 0.85

Tested by

no test coverage detected