Skip to content

Commit 26fe7ea

Browse files
committed
ci: fetch master remote only
1 parent c855cfc commit 26fe7ea

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

.github/workflows/upstream-sync.yml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,26 @@ jobs:
2828
GITHUB_TOKEN: ${{ secrets.PAT_SERVICE_ACCOUNT }}
2929
run: |
3030
git remote add upstream https://github.com/ggml-org/llama.cpp.git
31-
git fetch upstream --tags # Fetch tags from upstream
31+
git fetch upstream master:refs/remotes/upstream/master
3232
33+
# Fetch the latest release tag
34+
LATEST_TAG=$(curl -s https://api.github.com/repos/ggml-org/llama.cpp/releases/latest | grep -Po '"tag_name": "\K.*?(?=")')
35+
if [ -n "$LATEST_TAG" ]; then
36+
git fetch upstream refs/tags/$LATEST_TAG:refs/tags/$LATEST_TAG
37+
fi
38+
3339
- name: Sync master with latest release
3440
env:
3541
GITHUB_TOKEN: ${{ secrets.PAT_SERVICE_ACCOUNT }}
3642
run: |
3743
git checkout master
38-
LATEST_RELEASE=$(git describe --tags --abbrev=0 upstream/master)
44+
LATEST_RELEASE=$(curl -s https://api.github.com/repos/ggml-org/llama.cpp/releases/latest | grep -Po '"tag_name": "\K.*?(?=")')
45+
46+
if [ -z "$LATEST_RELEASE" ]; then
47+
echo "Could not get latest release tag, using upstream master"
48+
LATEST_RELEASE="upstream/master"
49+
fi
50+
3951
git reset --hard $LATEST_RELEASE
4052
git push origin master --force
4153

0 commit comments

Comments
 (0)