Skip to content

Commit a228c13

Browse files
authored
Ensure develop sync updates are a single commit (#110)
1 parent f5d1ade commit a228c13

1 file changed

Lines changed: 22 additions & 2 deletions

File tree

release.sh

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,19 @@ git checkout develop
175175
print_info "Syncing develop with main to include release changes"
176176
git merge main --no-ff -m "Sync develop with main after release v${VERSION}"
177177

178+
needs_amend=false
179+
180+
# Ensure the Home Assistant addon version is set to 'next' on develop
181+
print_info "Setting hassio-addon/config.yaml version to 'next' on develop"
182+
yq eval --inplace '.version = "next"' hassio-addon/config.yaml
183+
184+
if ! git diff --quiet hassio-addon/config.yaml; then
185+
git add hassio-addon/config.yaml
186+
needs_amend=true
187+
else
188+
print_info "hassio-addon/config.yaml already set to 'next'"
189+
fi
190+
178191
# Add new [Next] section to CHANGELOG if it doesn't exist
179192
if ! grep -q "\[Next\]" CHANGELOG.md; then
180193
print_info "Adding new [Next] section to CHANGELOG.md"
@@ -184,9 +197,16 @@ if ! grep -q "\[Next\]" CHANGELOG.md; then
184197
\
185198
' CHANGELOG.md
186199
rm CHANGELOG.md.bak
187-
200+
188201
git add CHANGELOG.md
189-
git commit -m "Add new [Next] section to CHANGELOG.md"
202+
needs_amend=true
203+
fi
204+
205+
if [ "$needs_amend" = true ]; then
206+
print_info "Amending develop sync commit with version and changelog updates"
207+
git commit --amend --no-edit
208+
else
209+
print_info "No additional updates required on develop"
190210
fi
191211

192212
print_info "Pushing updated develop branch"

0 commit comments

Comments
 (0)