From f97d10de304afd7b8b7ed7e89cc7ea781033486a Mon Sep 17 00:00:00 2001 From: juewuy Date: Sat, 24 Oct 2026 11:05:49 +0800 Subject: [PATCH] =?UTF-8?q?~=E8=B0=83=E6=95=B4=E7=89=88=E6=9C=AC=E5=8F=B7?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/update_singbox_core.yaml | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/.github/workflows/update_singbox_core.yaml b/.github/workflows/update_singbox_core.yaml index 96b16288..e9440cbc 100644 --- a/.github/workflows/update_singbox_core.yaml +++ b/.github/workflows/update_singbox_core.yaml @@ -83,12 +83,24 @@ jobs: - name: get sing-box version id: sing-box + env: + GH_TOKEN: ${{ github.token }} run: | - git remote add sekai https://github.com/SagerNet/sing-box.git - git fetch --tags sekai - version=$(CGO_ENABLED=0 go run ./cmd/internal/read_tag) - [ -z "$version" ] && version=${{ inputs.tag2 }} - version=$(echo ${version%-*}) + if [ "$REPO" = 'SagerNet/sing-box' ]; then + version=$(gh api --paginate "repos/${REPO}/tags?per_page=100" --jq '.[].name' \ + | sort -V \ + | tail -n 1) || true + elif [ "$REPO" = 'reF1nd/sing-box' ]; then + version=$(gh api --paginate "repos/${REPO}/tags?per_page=100" --jq '.[].name' \ + | grep -F 'reF1nd' \ + | sort -V \ + | tail -n 1) || true + else + version='' + fi + if [ -z "$version" ]; then + version='${{ inputs.tag2 }}' + fi echo version=$version >> $GITHUB_OUTPUT if [ -z "$TAGS" ];then if [ "$REPO" = 'SagerNet/sing-box' ];then