Skip to content

Commit cc75129

Browse files
committed
ci: only commit if there are changes
1 parent be96fe2 commit cc75129

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

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

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,11 @@ jobs:
122122
# Update Android SDK version in build.gradle
123123
sed -i '' "s/api 'com.onesignal:OneSignal:[^']*'/api 'com.onesignal:OneSignal:$VERSION'/" android/build.gradle
124124
echo "✓ Updated android/build.gradle with Android SDK ${VERSION}"
125-
git add .
125+
126+
# Only commit if there are changes
127+
git add -A
128+
git diff --staged --quiet && exit 0
129+
git commit -m "Update Android SDK to ${VERSION}" && git push
126130
127131
- name: Update iOS SDK version
128132
if: inputs.ios_version != ''
@@ -141,6 +145,11 @@ jobs:
141145
sed -i '' "s/s\.dependency 'OneSignalXCFramework', '[^']*'/s.dependency 'OneSignalXCFramework', '$VERSION'/" react-native-onesignal.podspec
142146
echo "✓ Updated react-native-onesignal.podspec with iOS SDK ${VERSION}"
143147
148+
# Only commit if there are changes
149+
git add -A
150+
git diff --staged --quiet && exit 0
151+
git commit -m "Update iOS SDK to ${VERSION}" && git push
152+
144153
- name: Update sdk version
145154
run: |
146155
NEW_VERSION="${{ inputs.rn_version }}"
@@ -154,9 +163,10 @@ jobs:
154163
cd examples/RNOneSignalTS/ios
155164
pod update OneSignalXCFramework
156165
166+
# Only commit if there are changes
157167
git add -A
158-
git commit -m "Release $NEW_VERSION"
159-
git push
168+
git diff --staged --quiet && exit 0
169+
git commit -m "Release $NEW_VERSION" && git push
160170
161171
create-pr:
162172
needs: [prep, update_version]

0 commit comments

Comments
 (0)