From 342b4b5e88f0e98ec627884cfe60d4e5d2a8106a Mon Sep 17 00:00:00 2001 From: GeWuYou <95328647+GeWuYou@users.noreply.github.com> Date: Sun, 15 Feb 2026 21:07:46 +0800 Subject: [PATCH] =?UTF-8?q?chore(workflow):=20=E6=9B=B4=E6=96=B0=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E6=A0=87=E7=AD=BE=E5=B7=A5=E4=BD=9C=E6=B5=81=E8=A7=A6?= =?UTF-8?q?=E5=8F=91=E6=9D=A1=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 修改触发条件以确保仅在 main 分支上运行 - 重构条件逻辑结构提高可读性 - 保持 workflow_run 和 workflow_dispatch 触发方式 - 添加适当的括号分组逻辑运算符 --- .github/workflows/auto-tag.yml | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/.github/workflows/auto-tag.yml b/.github/workflows/auto-tag.yml index deaff58..45b9b11 100644 --- a/.github/workflows/auto-tag.yml +++ b/.github/workflows/auto-tag.yml @@ -13,12 +13,17 @@ concurrency: jobs: auto-tag: if: > - (github.event_name == 'workflow_run' && - github.event.workflow_run.conclusion == 'success' && - github.event.workflow_run.head_branch == 'main' && - contains(github.event.workflow_run.head_commit.message, '[release ci]')) - || - (github.event_name == 'workflow_dispatch') + github.ref == 'refs/heads/main' && + ( + ( + github.event_name == 'workflow_run' && + github.event.workflow_run.conclusion == 'success' && + contains(github.event.workflow_run.head_commit.message, '[release ci]') + ) + || + github.event_name == 'workflow_dispatch' + ) + runs-on: ubuntu-latest permissions: contents: write