Skip to content

Commit c130716

Browse files
simplify: extract update_branch via destructuring to avoid delete mutation (#27281)
1 parent 7abcca2 commit c130716

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

actions/setup/js/update_pull_request.cjs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,9 @@ async function executePRUpdate(github, context, prNumber, updateData) {
3232
const rawBody = updateData._rawBody;
3333
const includeFooter = updateData._includeFooter !== false; // Default to true
3434

35-
// Remove internal fields
36-
const { _operation, _rawBody, _includeFooter, _workflowRepo, ...apiData } = updateData;
37-
const updateBranch = apiData.update_branch === true;
38-
delete apiData.update_branch;
35+
// Remove internal fields (including update_branch which is handled separately below)
36+
const { _operation, _rawBody, _includeFooter, _workflowRepo, update_branch, ...apiData } = updateData;
37+
const updateBranch = update_branch === true;
3938

4039
if (updateBranch) {
4140
core.info(`Updating pull request #${prNumber} branch with base branch changes`);

0 commit comments

Comments
 (0)