chore(workflow): 更新自动标签工作流触发条件

- 修改触发条件以确保仅在 main 分支上运行
- 重构条件逻辑结构提高可读性
- 保持 workflow_run 和 workflow_dispatch 触发方式
- 添加适当的括号分组逻辑运算符
This commit is contained in:
GeWuYou 2026-02-15 21:07:46 +08:00 committed by gewuyou
parent cdb7f32497
commit 342b4b5e88

View File

@ -13,12 +13,17 @@ concurrency:
jobs:
auto-tag:
if: >
(github.event_name == 'workflow_run' &&
github.ref == 'refs/heads/main' &&
(
(
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]'))
contains(github.event.workflow_run.head_commit.message, '[release ci]')
)
||
(github.event_name == 'workflow_dispatch')
github.event_name == 'workflow_dispatch'
)
runs-on: ubuntu-latest
permissions:
contents: write