diff --git a/actions/setup/js/add_comment.cjs b/actions/setup/js/add_comment.cjs index 346034e0a6..d8aa3f44ff 100644 --- a/actions/setup/js/add_comment.cjs +++ b/actions/setup/js/add_comment.cjs @@ -559,6 +559,7 @@ async function main(config = {}) { // Add metadata for tracking (includes comment ID, item number, and repo info) // This is used by the handler manager to track comments with unresolved temp IDs try { + // @ts-ignore - Add tracking metadata to comment object (works with both REST and GraphQL responses) comment._tracking = { commentId: comment.id, itemNumber: itemNumber, diff --git a/actions/setup/js/add_labels.cjs b/actions/setup/js/add_labels.cjs index 61d30cbfd5..20e86f6505 100644 --- a/actions/setup/js/add_labels.cjs +++ b/actions/setup/js/add_labels.cjs @@ -5,7 +5,7 @@ const { processSafeOutput } = require("./safe_output_processor.cjs"); const { validateLabels } = require("./safe_output_validator.cjs"); const { getErrorMessage } = require("./error_helpers.cjs"); -async function main(config = {}) { +async function main(handlerConfig = {}) { // Use shared processor for common steps const result = await processSafeOutput( { @@ -17,9 +17,9 @@ async function main(config = {}) { supportsIssue: true, envVars: { // Config values now passed via config object, not env vars - allowed: null, - maxCount: null, - target: null, + allowed: undefined, + maxCount: undefined, + target: undefined, }, }, { @@ -38,7 +38,7 @@ async function main(config = {}) { return content; }, }, - config // Pass handler config as third parameter + handlerConfig // Pass handler config as third parameter ); if (!result.success) { diff --git a/actions/setup/js/safe_output_handler_manager.cjs b/actions/setup/js/safe_output_handler_manager.cjs index 76eab6cf9d..20d4592b1d 100644 --- a/actions/setup/js/safe_output_handler_manager.cjs +++ b/actions/setup/js/safe_output_handler_manager.cjs @@ -99,7 +99,7 @@ async function loadHandlers(config) { * * @param {Map} messageHandlers - Map of message handler functions * @param {Array} messages - Array of safe output messages - * @returns {Promise<{success: boolean, results: Array, temporaryIdMap: Map, pendingUpdates: Array}>} + * @returns {Promise<{success: boolean, results: Array, temporaryIdMap: Object, outputsWithUnresolvedIds: Array}>} */ async function processMessages(messageHandlers, messages) { const results = []; @@ -387,6 +387,7 @@ async function processSyntheticUpdates(github, context, trackedOutputs, temporar const contentToCheck = getContentToCheck(tracked.type, tracked.message); // Check if the content still has unresolved IDs (some may now be resolved) + // @ts-ignore - hasUnresolvedTemporaryIds handles null values const stillHasUnresolved = hasUnresolvedTemporaryIds(contentToCheck, temporaryIdMap); const resolvedCount = temporaryIdMap.size - tracked.originalTempIdMapSize; @@ -397,6 +398,7 @@ async function processSyntheticUpdates(github, context, trackedOutputs, temporar try { // Replace temporary ID references with resolved values + // @ts-ignore - replaceTemporaryIdReferences handles null values const updatedContent = replaceTemporaryIdReferences(contentToCheck, temporaryIdMap, tracked.result.repo); // Update based on the original type diff --git a/actions/setup/js/update_runner.cjs b/actions/setup/js/update_runner.cjs index cc1df2563b..a70efb7c00 100644 --- a/actions/setup/js/update_runner.cjs +++ b/actions/setup/js/update_runner.cjs @@ -30,8 +30,9 @@ const { getErrorMessage } = require("./error_helpers.cjs"); * @property {boolean} supportsStatus - Whether this type supports status updates * @property {boolean} supportsOperation - Whether this type supports operation (append/prepend/replace) * @property {(item: any, index: number) => string} renderStagedItem - Function to render item for staged preview - * @property {(github: any, context: any, targetNumber: number, updateData: any) => Promise} executeUpdate - Function to execute the update API call + * @property {(github: any, context: any, targetNumber: number, updateData: any, handlerConfig?: any) => Promise} executeUpdate - Function to execute the update API call * @property {(result: any) => string} getSummaryLine - Function to generate summary line for an updated item + * @property {any} [handlerConfig] - Optional handler configuration object passed from handler manager */ /**