Skip to content

Commit ed09284

Browse files
ci: fix destructive sync of build.gradle.kts
1 parent a5832f9 commit ed09284

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

.github/workflows/upstream-sync.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,15 @@ jobs:
5353
git rm -rf .github/workflows/ || true
5454
git checkout HEAD -- .github/workflows/ || true
5555
56-
# Force take RELEASE_INFO.md and app/build.gradle.kts from upstream to sync versions
56+
# Force take RELEASE_INFO.md from upstream for release notes
5757
git checkout upstream/main -- RELEASE_INFO.md || true
58-
git checkout upstream/main -- app/build.gradle.kts || true
58+
59+
# Extract version from tag (e.g., v5.2.4 -> 5.2.4) and update versionName in app/build.gradle.kts
60+
LATEST_TAG=$(git describe --tags --abbrev=0 upstream/main 2>/dev/null || echo "")
61+
if [ -n "$LATEST_TAG" ]; then
62+
VERSION_NUM=${LATEST_TAG#v}
63+
sed -i "s/versionName = \".*\"/versionName = \"$VERSION_NUM\"/" app/build.gradle.kts
64+
fi
5965
6066
# Now commit the merge
6167
git commit --no-edit || true

0 commit comments

Comments
 (0)