Skip to content

Commit 3305b09

Browse files
committed
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
1 parent 50acc02 commit 3305b09

File tree

1 file changed

+15
-7
lines changed

1 file changed

+15
-7
lines changed

.github/workflows/LLVM-Auto-Updater.yml

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
tag_name=$github.event.inputs.tag_name
2727
fi
2828
29-
echo "Using version: $tag_name"
29+
echo "Using version: $tag_name"
3030
echo "tag_name=${tag_name}" >> $GITHUB_ENV
3131
version=$(echo $tag_name | grep -o '[0-9]\+\.[0-9]\+\.[0-9]\+')
3232
echo "version=${version}" >> $GITHUB_ENV
@@ -44,7 +44,7 @@ jobs:
4444
exit 0
4545
fi
4646
47-
- name: Checkout LLVM-project
47+
- name: Checkout LLVM-capstone
4848
uses: actions/checkout@v3
4949
with:
5050
fetch-depth: 1
@@ -63,14 +63,22 @@ jobs:
6363
6464
- name: Add files to branch ${{ env.branch_version }}
6565
run: |
66-
branch_exists=$(git ls-remote --exit-code --heads origin ${{env.branch_version}})
67-
echo "branch_exists=${branch_exists}" >> $GITHUB_ENV
68-
git checkout ${{ env.branch_version }} 2>/dev/null || git checkout -b ${{ env.branch_version }}
69-
if [[ "${{ env.branch_exists }}" = true ]]; then
66+
if git ls-remote --exit-code --heads origin "${{ env.branch_version }}" &> /dev/null; then
67+
branch_exists=true
68+
echo "branch_exists=${branch_exists}" >> $GITHUB_ENV
69+
git fetch origin ${{ env.branch_version }}
70+
git checkout ${{ env.branch_version }}
71+
else
72+
git checkout -b ${{ env.branch_version }}
73+
rm -rf ./*
74+
fi
75+
76+
if [ -n "${{ env.branch_exists }}" ]; then
7077
git pull origin ${{ env.branch_version }}
7178
git push -u origin ${{ env.branch_version }}
72-
rm -rf !\(.git\|.github\)
7379
fi
80+
81+
rm -rf !\(.git\|.github\)
7482
cp -r ../llvm-project/* .
7583
ls -la
7684
git add .

0 commit comments

Comments
 (0)