Skip to content

Commit

Permalink
Adjust SDK PR creation script to handle untracked files (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
joaopalet authored Sep 15, 2023
1 parent f8e16d9 commit 10d1f52
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions scripts/sdk-create-pr.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,12 @@ git config user.email "${COMMIT_EMAIL}"
rm -rf ./*
cp -a ${FOLDER_TO_PUSH_PATH}/. ./

if git diff --exit-code --quiet; then
echo "SDK is unchanged, nothing to commit."
else
# Commit and push files
git switch -c "$1"
git add -A
git commit -m "$2"
# Create PR with new SDK if there are changes
git switch -c "$1"
git add -A
if git commit -m "$2"; then # Commit will fail if it doesn't contain any changes
git push origin "$1"

# Create PR
gh pr create --title "$3" --body "$4" --head "$1" --base "main"
else
echo "SDK is unchanged, nothing to commit."
fi

0 comments on commit 10d1f52

Please sign in to comment.