From 3305b0978938f238f4f6053a8167decd889952f2 Mon Sep 17 00:00:00 2001 From: Wu ChenXu Date: Mon, 25 Sep 2023 14:49:36 +0800 Subject: [PATCH] Fix issue in LLVM-Auto-Updater.yml Debug LLVM-Auto-Updater.yml Update LLVM-Auto-Updater.yml Update LLVM-Auto-Updater.yml Update LLVM-Auto-Updater.yml Update LLVM-Auto-Updater.yml Update LLVM-Auto-Updater.yml Update LLVM-Auto-Updater.yml Update LLVM-Auto-Updater.yml Update LLVM-Auto-Updater.yml Fix issue in LLVM-Auto-Updater.yml --- .github/workflows/LLVM-Auto-Updater.yml | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/.github/workflows/LLVM-Auto-Updater.yml b/.github/workflows/LLVM-Auto-Updater.yml index 5792cf582583..b5e15f233f84 100644 --- a/.github/workflows/LLVM-Auto-Updater.yml +++ b/.github/workflows/LLVM-Auto-Updater.yml @@ -26,7 +26,7 @@ jobs: tag_name=$github.event.inputs.tag_name fi - echo "Using version: $tag_name" + echo "Using version: $tag_name" echo "tag_name=${tag_name}" >> $GITHUB_ENV version=$(echo $tag_name | grep -o '[0-9]\+\.[0-9]\+\.[0-9]\+') echo "version=${version}" >> $GITHUB_ENV @@ -44,7 +44,7 @@ jobs: exit 0 fi - - name: Checkout LLVM-project + - name: Checkout LLVM-capstone uses: actions/checkout@v3 with: fetch-depth: 1 @@ -63,14 +63,22 @@ jobs: - name: Add files to branch ${{ env.branch_version }} run: | - branch_exists=$(git ls-remote --exit-code --heads origin ${{env.branch_version}}) - echo "branch_exists=${branch_exists}" >> $GITHUB_ENV - git checkout ${{ env.branch_version }} 2>/dev/null || git checkout -b ${{ env.branch_version }} - if [[ "${{ env.branch_exists }}" = true ]]; then + if git ls-remote --exit-code --heads origin "${{ env.branch_version }}" &> /dev/null; then + branch_exists=true + echo "branch_exists=${branch_exists}" >> $GITHUB_ENV + git fetch origin ${{ env.branch_version }} + git checkout ${{ env.branch_version }} + else + git checkout -b ${{ env.branch_version }} + rm -rf ./* + fi + + if [ -n "${{ env.branch_exists }}" ]; then git pull origin ${{ env.branch_version }} git push -u origin ${{ env.branch_version }} - rm -rf !\(.git\|.github\) fi + + rm -rf !\(.git\|.github\) cp -r ../llvm-project/* . ls -la git add .