Skip to content

Commit 4a66c75

Browse files
author
kiran-garre
committed
Exit gracefully if no changes have been made
1 parent 106768f commit 4a66c75

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

docs-generation/create-docs-pr.sh

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
11
#!/bin/bash
22
set -e
33

4-
# Ensure we have changes to merge
5-
if [ -z "$(git status --porcelain -- . ':!pr-contents.txt')" ]; then
6-
echo "No changes to commit"
7-
exit 0
8-
fi
9-
104
git config user.name "docs-generator[bot]"
115
git config user.email "docs-generator[bot]@amazon.com"
126

137
# Push (branch should have already been created in update-docs.sh)
148
git add docs
9+
if git diff --cached --quiet; then
10+
echo "No changes to commit"
11+
exit 0
12+
fi
1513
git commit -m "Update docs based on PR #$PR_NUMBER
1614
1715
Auto-generated by Q"

0 commit comments

Comments
 (0)