Skip to content

Commit 810ded3

Browse files
author
kiran-garre
committed
Try fetching before branch creation
1 parent e0e6c5a commit 810ded3

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

docs-generation/update-docs.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@ if [ ! -f "$PR_FILE" ]; then
77
fi
88

99
# Create branch before making any changes
10+
git fetch origin
1011
git checkout -B "$BRANCH_NAME"
11-
if git ls-remote --exit-code --heads origin $BRANCH_NAME; then
12-
git reset --hard origin/$BRANCH_NAME
12+
if git ls-remote --exit-code --heads origin "$BRANCH_NAME" >/dev/null 2>&1; then
13+
git reset --hard "origin/$BRANCH_NAME"
1314
fi
1415

1516
PROMPT="Before making any changes, read the 'docs' directory for the project's current

0 commit comments

Comments
 (0)