Skip to content

Commit 3e2c05f

Browse files
committed
ci: only commit if there are changes
1 parent d0f828b commit 3e2c05f

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

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

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,10 @@ jobs:
111111
sed -i '' "s|implementation 'com\.onesignal:OneSignal:[^']*'|implementation 'com.onesignal:OneSignal:${VERSION}'|" android/build.gradle
112112
echo "✓ Updated android/build.gradle with Android SDK ${VERSION}"
113113
114-
git add .
114+
# Only commit if there are changes
115+
git add -A
116+
git diff --staged --quiet && exit 0
117+
git commit -m "Update Android SDK to ${VERSION}" && git push
115118
116119
- name: Set up Flutter
117120
if: inputs.ios_version != ''
@@ -140,7 +143,10 @@ jobs:
140143
cd example/ios
141144
pod update OneSignalXCFramework
142145
143-
git add .
146+
# Only commit if there are changes
147+
git add -A
148+
git diff --staged --quiet && exit 0
149+
git commit -m "Update iOS SDK to ${VERSION}" && git push
144150
145151
- name: Update sdk version
146152
run: |
@@ -163,9 +169,10 @@ jobs:
163169
# Update OneSignalPlugin.m wrapper version
164170
sed -i '' "s/OneSignalWrapper\.sdkVersion = @\"[^\"]*\"/OneSignalWrapper.sdkVersion = @\"$WRAPPER_VERSION\"/g" ios/Classes/OneSignalPlugin.m
165171
166-
git add .
167-
git commit -m "Release $NEW_VERSION"
168-
git push
172+
# Only commit if there are changes
173+
git add -A
174+
git diff --staged --quiet && exit 0
175+
git commit -m "Release $NEW_VERSION" && git push
169176
170177
create-pr:
171178
needs: [prep, update_version]

0 commit comments

Comments
 (0)