File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change 6161 git remote set-url origin https://x-access-token:${{ github.token }}@github.com/${{ github.repository }}.wiki.git
6262
6363 git fetch origin
64- git checkout -b temp-branch origin/${{ github.head_ref || github.ref_name }}
65- git pull origin ${{ github.head_ref || github.ref_name }} --rebase
64+ BRANCH_NAME="${{ github.head_ref || github.ref_name }}"
65+
66+ if [ "$BRANCH_NAME" = "main" ]; then
67+ if ! git ls-remote --exit-code --heads origin main > /dev/null; then
68+ BRANCH_NAME="master"
69+ fi
70+ fi
71+
72+ git checkout -b temp-branch origin/$BRANCH_NAME
73+ git pull origin $BRANCH_NAME --rebase
6674
6775 git add .
6876 if git diff --cached --quiet; then
7179 fi
7280
7381 git commit -m "Update wiki content"
74- git push origin HEAD:refs/heads/${{ github.head_ref || github.ref_name }}
82+ git push origin HEAD:refs/heads/$BRANCH_NAME
7583
7684 cd ../..
7785
You can’t perform that action at this time.
0 commit comments