adoroszlai commented on code in PR #10886:
URL: https://github.com/apache/ozone/pull/10886#discussion_r3666179478


##########
.github/workflows/update-ozone-site-config-doc.yml:
##########
@@ -60,21 +60,28 @@ jobs:
           git config --global user.name 'github-actions[bot]'
           git config --global user.email 
'github-actions[bot]@users.noreply.github.com'
           
-          git clone --depth=1 --branch=master 
https://github.com/$REPO_OWNER/ozone-site.git ozone-site
+          BRANCH_EXISTS=""
+          if git clone --depth=1 --branch="$BRANCH_NAME" 
https://github.com/$REPO_OWNER/ozone-site.git ozone-site; then
+            BRANCH_EXISTS="true"
+          else
+            git clone --depth=1 --branch=master 
https://github.com/$REPO_OWNER/ozone-site.git ozone-site
+          fi
+
           cd ozone-site
 
           EXISTING_PR=$(gh pr list --repo "$REPO_OWNER/ozone-site" \
             --head "$BRANCH_NAME" --base master --json number --jq 
'.[0].number' || echo "")
           echo "EXISTING_PR=$EXISTING_PR" >> $GITHUB_ENV
 
           if [ -n "$EXISTING_PR" ]; then
-            echo "Open PR #$EXISTING_PR exists, checking out branch for 
comparison"
-            git fetch --depth=1 origin "$BRANCH_NAME"
-            git checkout -B "$BRANCH_NAME" FETCH_HEAD
+            echo "Open PR #$EXISTING_PR exists"
+          else if [[ -n "$BRANCH_EXISTS" ]]; then

Review Comment:
   Thanks for spotting this.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to