Skip to content

Commit 385dda1

Browse files
committed
chore: return if commit fails
1 parent 57b1bf9 commit 385dda1

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

.github/workflows/comment-diffs.yml

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,14 @@ jobs:
163163
cp -r "$target_path_old_version/." .
164164
165165
# Add all files and commit
166-
git add -A || true && git commit -m "Automatic commit" || true
166+
git add -A || true
167+
168+
if git commit -m "Automatic commit"; then
169+
echo "Commit successful"
170+
else
171+
echo "No changes"
172+
return
173+
fi
167174
168175
# Remove everything except the .git folder
169176
for i in $(ls | grep -v ".git") ; do rm -rf "$i"; done;
@@ -172,7 +179,14 @@ jobs:
172179
cp -r "$target_path_new_version/." .
173180
174181
# Add all files and commit
175-
git add -A || true && git commit -m "Automatic commit" || true
182+
git add -A || true
183+
184+
if git commit -m "Automatic commit"; then
185+
echo "Commit successful"
186+
else
187+
echo "No changes"
188+
return
189+
fi
176190
177191
# echo diff
178192
echo $(git diff HEAD~)

0 commit comments

Comments
 (0)