Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions actions/setup/js/close_discussion.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -176,11 +176,11 @@ async function main(config = {}) {

/**
* Message handler function that processes a single close_discussion message
* @param {Object} message - The close_discussion message to process
* @param {Object} item - The close_discussion message to process
* @param {Object} resolvedTemporaryIds - Map of temporary IDs to {repo, number}
* @returns {Promise<Object>} Result with success/error status
*/
return async function handleCloseDiscussion(message, resolvedTemporaryIds) {
return async function handleCloseDiscussion(item, resolvedTemporaryIds) {
Comment on lines +179 to +183
Copy link

Copilot AI Feb 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change breaks the established convention in the codebase. All similar handler functions use message as the parameter name and then create an alias const item = message; inside the function body. This pattern is consistently followed across the codebase in files like:

  • close_issue.cjs:112 - async function handleCloseIssue(message, resolvedTemporaryIds) with const item = message; at line 124
  • close_pull_request.cjs:109 - async function handleClosePullRequest(message, resolvedTemporaryIds) with const item = message; at line 121
  • add_comment.cjs:322 - async function handleAddComment(message, resolvedTemporaryIds) with const item = message; at line 334
  • And 10 other handler files following the same pattern

The parameter should be named message (not item), and the alias const item = message; should be retained for consistency with the rest of the codebase.

See below for a potential fix:

   * @param {Object} message - The close_discussion message to process
   * @param {Object} resolvedTemporaryIds - Map of temporary IDs to {repo, number}
   * @returns {Promise<Object>} Result with success/error status
   */
  return async function handleCloseDiscussion(message, resolvedTemporaryIds) {
    const item = message;

Copilot uses AI. Check for mistakes.
// Check if we've hit the max limit
if (processedCount >= maxCount) {
core.warning(`Skipping close_discussion: max count of ${maxCount} reached`);
Expand All @@ -192,8 +192,6 @@ async function main(config = {}) {

processedCount++;

const item = message;

// Determine discussion number
let discussionNumber;
if (item.discussion_number !== undefined) {
Expand Down
Loading