From c162cdecdcc62c0338fbf93c26306bcf58554efa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E6=99=AF=E7=AB=8B?= Date: Sun, 4 Aug 2024 14:16:33 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/clear.yml | 12 ++++-------- .github/workflows/release.yml | 2 +- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/.github/workflows/clear.yml b/.github/workflows/clear.yml index 9632642ff..7fec2bd32 100644 --- a/.github/workflows/clear.yml +++ b/.github/workflows/clear.yml @@ -18,12 +18,8 @@ jobs: - name: Install PyGithub run: pip install PyGithub - - name: Delete all GitHub tags + - name: Delete tags and releases + env: + GITHUB_TOKEN: ${{ secrets.TOKEN }} run: | - # 获取所有 tag 的列表 - TAGS=$(git ls-remote --tags origin | cut -f2 | cut -d'/' -f3) - - # 循环遍历所有 tag 并删除 - for TAG in $TAGS; do - curl -s -X DELETE "https://api.github.com/repos/${{ github.repository }}/git/refs/tags/$TAG" -H "Authorization: token ${{ secrets.TOKEN }}" - done \ No newline at end of file + python .github/delete_tags_and_releases.py \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b92a5e581..825e548d5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -45,7 +45,7 @@ jobs: # 如果没有倒数第二个标签,则输出为空字符串 if [[ -z "$SECOND_LATEST_TAG" ]]; then - echo "::set-output name=tag_cmd::" + echo "::set-output name=tag_cmd::-S master" else echo "::set-output name=tag_cmd::-S $SECOND_LATEST_TAG" fi