Skip to content

Commit a2eb6bf

Browse files
authored
Handle release merge conflict automatically (#109)
1 parent e04d672 commit a2eb6bf

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

release.sh

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,17 @@ git checkout main
143143
git pull origin main
144144

145145
print_info "Merging release branch into main"
146-
git merge "$RELEASE_BRANCH" --no-ff -m "Merge release v${VERSION}"
146+
if ! git merge "$RELEASE_BRANCH" --no-ff -m "Merge release v${VERSION}"; then
147+
if git status --short | grep -q "^UU hassio-addon/config.yaml"; then
148+
print_warning "Merge conflict detected in hassio-addon/config.yaml. Using release branch version."
149+
git checkout --theirs hassio-addon/config.yaml
150+
git add hassio-addon/config.yaml
151+
git commit --no-edit
152+
else
153+
print_error "Merge failed due to conflicts. Please resolve manually."
154+
exit 1
155+
fi
156+
fi
147157

148158
# Create and push tag
149159
print_info "Creating tag ${VERSION}"

0 commit comments

Comments
 (0)