File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
.github/actions/ensure-release-branch Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -111,8 +111,14 @@ if execute_command git ls-remote --heads origin "$RELEASE_VERSION_BRANCH" | grep
111
111
112
112
if [ " $COMMITS_TO_MERGE " -gt 0 ]; then
113
113
# Compare the two branches to see if there are actual file differences
114
- execute_command --ignore-exit-code 1 --no-std -- git diff --quiet " origin/$RELEASE_VERSION_BRANCH " " origin/$RELEASE_BRANCH "
115
- if [ " $last_cmd_result " -eq 1 ]; then
114
+ # The reliable way to check the differences ignoring merges from version
115
+ # branch into release branch is to perform a merge and check the result
116
+ execute_command --no-std -- git switch -c tmp-rvb " origin/$RELEASE_VERSION_BRANCH "
117
+ execute_command --no-std -- git merge --no-commit --no-ff " origin/$RELEASE_BRANCH "
118
+ execute_command --ignore-exit-code 1 --no-std -- git diff --quiet --cached " origin/$RELEASE_VERSION_BRANCH "
119
+ diff_result=$last_cmd_result
120
+ execute_command --ignore-errors --no-std -- git merge --abort
121
+ if [ " $diff_result " -eq 1 ]; then
116
122
echo " Found file differences between $RELEASE_BRANCH and $RELEASE_VERSION_BRANCH "
117
123
execute_command --no-std -- git diff --name-only " origin/$RELEASE_VERSION_BRANCH " " origin/$RELEASE_BRANCH "
118
124
console_output 1 gray " $last_cmd_stdout "
You can’t perform that action at this time.
0 commit comments