You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by vy...@apache.org on 2024/04/12 09:13:45 UTC
(logging-parent) branch main updated: Create non-existing branches in the site workflow
This is an automated email from the ASF dual-hosted git repository.
vy pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/logging-parent.git
The following commit(s) were added to refs/heads/main by this push:
new 0e49654 Create non-existing branches in the site workflow
0e49654 is described below
commit 0e496542c86dd4e53c121ec9b30d0202baadb3b2
Author: Volkan Yazıcı <vo...@yazi.ci>
AuthorDate: Fri Apr 12 11:13:35 2024 +0200
Create non-existing branches in the site workflow
---
.github/workflows/deploy-site-reusable.yaml | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/.github/workflows/deploy-site-reusable.yaml b/.github/workflows/deploy-site-reusable.yaml
index 44055e3..91edc7f 100644
--- a/.github/workflows/deploy-site-reusable.yaml
+++ b/.github/workflows/deploy-site-reusable.yaml
@@ -120,9 +120,17 @@ jobs:
echo "SOURCE_COMMIT_ID=$(git rev-parse HEAD)" >> $GITHUB_ENV
- name: Checkout the target branch
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # 4.1.2
- with:
- ref: ${{ inputs.target-branch }}
+ shell: bash
+ env:
+ TARGET_BRANCH: ${{ inputs.target-branch }}
+ run: |
+ git fetch -p
+ if [ $(git rev-parse --verify "origin/$TARGET_BRANCH" >/dev/null 2>&1) ]; then
+ git checkout -B "$TARGET_BRANCH" "origin/$TARGET_BRANCH"
+ else
+ echo "Branch \`$TARGET_BRANCH\` doesn't exist, creating it"
+ git checkout --orphan "$TARGET_BRANCH"
+ fi
- name: Update the target path
shell: bash