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

Function limitToMaxCount

actions/setup/js/safe_output_processor.cjs:278–284  ·  view source on GitHub ↗

* Limit items to max count * @param {string[]} items - Items to limit * @param {number} maxCount - Maximum number of items * @returns {string[]} Limited items

(items, maxCount)

Source from the content-addressed store, hash-verified

276 * @returns {string[]} Limited items
277 */
278function limitToMaxCount(items, maxCount) {
279 if (items.length > maxCount) {
280 core.info(`Too many items (${items.length}), limiting to ${maxCount}`);
281 return items.slice(0, maxCount);
282 }
283 return items;
284}
285
286/**
287 * Process items through the standard pipeline: filter by allowed, filter blocked, sanitize, dedupe, limit

Callers 1

processItemsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected