更新 .drone.yml
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2025-12-31 02:24:54 +00:00
parent b5be9c3408
commit 24e5789f41

View File

@@ -2,10 +2,10 @@ kind: pipeline
type: docker type: docker
name: main-automated-pipeline name: main-automated-pipeline
# 启用模板
clone: clone:
disable: false disable: false
# 顶层触发器:允许 push/promote/manual 三类事件唤醒流水线
trigger: trigger:
event: event:
- push - push
@@ -13,7 +13,7 @@ trigger:
- manual - manual
steps: steps:
# ========== 原有push触发的自动运行节点 ========== # ===== 原有自动节点push到main分支自动执行保留不变=====
- name: print-auto-run - name: print-auto-run
image: alpine:latest image: alpine:latest
when: when:
@@ -27,16 +27,21 @@ steps:
- echo 自动运行 - echo 自动运行
- echo =================================== - echo ===================================
# ========== 新增:手动触发的专属运行节点 ========== # ===== 手动触发节点【修复后核心配置】=====
- name: print-manual-run - name: print-manual-run
image: alpine:latest image: alpine:latest
# 核心条件:仅当触发事件为 manual 时执行 # ✅ 关键修复1添加 branch: [ main, '*' ] 兼容所有分支手动触发
# ✅ 关键修复2用列表格式Drone 推荐写法兼容性100%
when: when:
event: manual event:
- manual
branch:
- main
- '*' # 通配符,匹配所有分支,彻底解决分支冲突问题
environment: environment:
REPO_UID: "{{ .repo.uid }}" REPO_UID: "{{ .repo.uid }}"
commands: commands:
- echo =================================== - echo ===================================
- echo 这是手动触发的流水线 - echo 🚀 这是手动触发的流水线(已生效)
- echo 手动运行(支持手动点击/API触发 - echo 手动运行成功!
- echo =================================== - echo ===================================