Skip to content

Commit 7e400a5

Browse files
committed
fix: address additional Copilot review comments
- Fix typo: 'heckout_or_create_branch' -> 'checkout_or_create_branch' - Improve merge conflict handling: reset to HEAD (pre-merge state) instead of release branch to preserve existing changelog content - Add clearer logging for merge conflict scenario Note: Code duplication suggestion skipped (nitpick, over-engineering)
1 parent f4175ef commit 7e400a5

2 files changed

Lines changed: 9 additions & 6 deletions

File tree

.github/scripts/update-release-changelog.sh

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,16 +64,19 @@ checkout_or_create_branch() {
6464
git checkout "${branch_name}"
6565
fi
6666
# Merge the base branch to include any new commits from the release branch.
67-
# This merge logic is intentionally different from heckout_or_create_branch()
68-
# This script runs on every push to the release branch, so the changelog branch may already exist with older content.
69-
# We need to merge the latest release branch commits to ensure auto-changelog sees all new commits.
67+
# This merge logic is intentionally different from checkout_or_create_branch()
68+
# in create-platform-release-pr.sh which creates fresh branches.
69+
# This script runs on every push to the release branch, so the changelog branch
70+
# may already exist with older content. We merge to sync file changes.
7071
if [[ -n "${base_branch}" ]]; then
7172
echo "Merging ${base_branch} into ${branch_name} to include new commits..."
7273
git fetch origin "${base_branch}"
7374
git merge "origin/${base_branch}" --no-edit || {
74-
echo "Merge conflict detected, aborting merge and resetting to release branch"
75+
echo "Merge conflict detected during merge of ${base_branch} into ${branch_name}."
76+
echo "Aborting merge and resetting to pre-merge state to preserve existing changelog content."
7577
git merge --abort
76-
git reset --hard "origin/${base_branch}"
78+
git reset --hard HEAD
79+
echo "Continuing with existing changelog branch state. auto-changelog will regenerate content."
7780
}
7881
fi
7982
else

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,4 +86,4 @@
8686
"@swc/core": false
8787
}
8888
}
89-
}
89+
}

0 commit comments

Comments
 (0)