From 10d1f52d1a20a4f19a347607fcdc85e219efd528 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Palet?= Date: Fri, 15 Sep 2023 16:46:01 +0200 Subject: [PATCH] Adjust SDK PR creation script to handle untracked files (#8) --- scripts/sdk-create-pr.sh | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/scripts/sdk-create-pr.sh b/scripts/sdk-create-pr.sh index 9521da9..da75975 100755 --- a/scripts/sdk-create-pr.sh +++ b/scripts/sdk-create-pr.sh @@ -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