Skip to content

Commit bf6671f

Browse files
committed
ci: only commit if there are changes
1 parent 098681d commit bf6671f

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

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

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,8 @@ jobs:
123123
cd example/IonicCapOneSignal
124124
bunx cap sync android
125125
git add .
126+
git diff --staged --quiet && exit 0
127+
git commit -m "Update Android SDK to ${VERSION}" && git push
126128
else
127129
echo "✗ Android SDK version ${VERSION} not found"
128130
exit 1
@@ -149,6 +151,8 @@ jobs:
149151
cd ../..
150152
bunx cap sync ios
151153
git add .
154+
git diff --staged --quiet && exit 0
155+
git commit -m "Update iOS SDK to ${VERSION}" && git push
152156
153157
else
154158
echo "✗ iOS SDK version ${VERSION} not found"
@@ -178,10 +182,10 @@ jobs:
178182
# Update OneSignalPush.m wrapper version
179183
sed -i '' "s/OneSignalWrapper\.sdkVersion = @\"[^\"]*\"/OneSignalWrapper.sdkVersion = @\"$WRAPPER_VERSION\"/g" src/ios/OneSignalPush.m
180184
181-
git add package.json plugin.xml src/android/com/onesignal/cordova/OneSignalPush.java src/ios/OneSignalPush.m
182-
183-
git commit -m "Release $NEW_VERSION"
184-
git push
185+
# Only commit if there are changes
186+
git add -A
187+
git diff --staged --quiet && exit 0
188+
git commit -m "Release $NEW_VERSION" && git push
185189
186190
create-pr:
187191
needs: [prep, update_version]

0 commit comments

Comments
 (0)