From 9fecd101883f003009a98c602cd484a874fbe54e Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 20 Apr 2026 06:32:18 +0000 Subject: [PATCH] simplify: extract update_branch via destructuring to avoid delete mutation Removes the need for post-destructuring mutation by including update_branch in the initial destructuring of updateData, keeping apiData clean from the start. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- actions/setup/js/update_pull_request.cjs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/actions/setup/js/update_pull_request.cjs b/actions/setup/js/update_pull_request.cjs index bbb9363752..8d22e06f8f 100644 --- a/actions/setup/js/update_pull_request.cjs +++ b/actions/setup/js/update_pull_request.cjs @@ -32,10 +32,9 @@ async function executePRUpdate(github, context, prNumber, updateData) { const rawBody = updateData._rawBody; const includeFooter = updateData._includeFooter !== false; // Default to true - // Remove internal fields - const { _operation, _rawBody, _includeFooter, _workflowRepo, ...apiData } = updateData; - const updateBranch = apiData.update_branch === true; - delete apiData.update_branch; + // Remove internal fields (including update_branch which is handled separately below) + const { _operation, _rawBody, _includeFooter, _workflowRepo, update_branch, ...apiData } = updateData; + const updateBranch = update_branch === true; if (updateBranch) { core.info(`Updating pull request #${prNumber} branch with base branch changes`);