Skip to content

Commit 1aa2528

Browse files
fix(ci): read/write Android SDK version from libs.versions.toml
The create-release-pr workflow was still grepping the literal `com.onesignal:OneSignal:X.Y.Z` line from android/build.gradle.kts after that file was migrated to a Gradle version catalog. The read step matched `${catalogVersion("onesignal")}` and emitted the entire gradle line as $ANDROID_VERSION (which leaked into the PR title), and the write step's sed pattern silently no-oped against the new catalog reference. Both steps now target android/gradle/libs.versions.toml directly. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 03b6821 commit 1aa2528

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

.github/workflows/create-release-pr.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ jobs:
9292
9393
# Get versions from target branch (not the release branch)
9494
CURRENT_VERSION=$(git show origin/${{ inputs.target_branch }}:package.json | jq -r .version)
95-
ANDROID_VERSION=$(git show origin/${{ inputs.target_branch }}:android/build.gradle.kts | grep "com.onesignal:OneSignal:" | sed -E "s/.*OneSignal:([0-9.]+).*/\1/")
95+
ANDROID_VERSION=$(git show origin/${{ inputs.target_branch }}:android/gradle/libs.versions.toml | grep -E '^onesignal[[:space:]]*=[[:space:]]*"' | sed -E 's/.*"([0-9.]+)".*/\1/')
9696
IOS_VERSION=$(git show origin/${{ inputs.target_branch }}:OneSignalCapacitorPlugin.podspec | grep "OneSignalXCFramework" | sed -E "s/.*'([0-9.]+)'.*/\1/")
9797
9898
echo "capacitor_from=$CURRENT_VERSION" >> $GITHUB_OUTPUT
@@ -114,9 +114,9 @@ jobs:
114114
exit 1
115115
fi
116116
117-
# Update Android SDK version in build.gradle.kts
118-
sed -i '' -E "s/(com\.onesignal:OneSignal:)[0-9.]+/\1$VERSION/" android/build.gradle.kts
119-
echo "✓ Updated android/build.gradle.kts with Android SDK ${VERSION}"
117+
# Update Android SDK version in the version catalog
118+
sed -i '' -E "s/^(onesignal[[:space:]]*=[[:space:]]*\")[0-9.]+(\".*)$/\1${VERSION}\2/" android/gradle/libs.versions.toml
119+
echo "✓ Updated android/gradle/libs.versions.toml with Android SDK ${VERSION}"
120120
121121
# Only commit if there are changes
122122
git add -A

0 commit comments

Comments
 (0)