This is an automated email from the ASF dual-hosted git repository.

vy pushed a commit to branch release/11.0.0-test2
in repository https://gitbox.apache.org/repos/asf/logging-parent.git

commit fca155b0e72c4ac20970b6f7584cd51aeb827626
Author: Volkan Yazıcı <[email protected]>
AuthorDate: Fri Apr 12 11:21:28 2024 +0200

    Fix pushes on non-existing remote branches
---
 .github/workflows/deploy-site-reusable.yaml | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/.github/workflows/deploy-site-reusable.yaml 
b/.github/workflows/deploy-site-reusable.yaml
index 91edc7f..4b6e9be 100644
--- a/.github/workflows/deploy-site-reusable.yaml
+++ b/.github/workflows/deploy-site-reusable.yaml
@@ -135,6 +135,7 @@ jobs:
       - name: Update the target path
         shell: bash
         env:
+          TARGET_BRANCH: ${{ inputs.target-branch }}
           TARGET_PATH: ${{ inputs.target-path }}
           ASF_YAML_CONTENT: ${{ inputs.asf-yaml-content }}
         run: |
@@ -144,13 +145,13 @@ jobs:
 
           # Clean up the target path
           if [ "." = "$TARGET_PATH" ]; then
-            git ls-files -z | xargs -0 git rm -rf
+            git ls-files -z | xargs -0 git rm -rfq
           else
-            git rm -rf "$TARGET_PATH"
+            git rm -rfq "$TARGET_PATH"
           fi
 
           # Place the generated site
-          unzip /tmp/site.zip -d "$TARGET_PATH"
+          unzip -q /tmp/site.zip -d "$TARGET_PATH"
           git add "$TARGET_PATH"
 
           # Recover `.asf.yaml`, if there was one.
@@ -169,7 +170,8 @@ jobs:
 
             # Commit & push site changes
             git commit -S -a -m "Add website content generated from 
\`$SOURCE_COMMIT_ID\`"
-            git push -f origin
+            # `push` needs an explicit target branch and `-u` for tracking it, 
since we might have just created it
+            git push -f -u origin "$TARGET_BRANCH"
 
             # Populate `.asf.yaml`
             cat >.asf.yaml <<EOF

Reply via email to