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

This commit is contained in:
2025-12-31 02:28:09 +00:00
parent 24e5789f41
commit 82c449b517

View File

@@ -1,24 +1,18 @@
# ===================== 流水线1仅自动触发push到main分支=====================
kind: pipeline
type: docker
name: main-automated-pipeline
name: auto-pipeline-main # 自动流水线名称
clone:
disable: false
# 顶层触发器:允许 push/promote/manual 三类事件唤醒流水线
trigger:
event:
- push
- promote
- manual
event: [push] # 仅接收push事件
branch: [main] # 仅main分支
steps:
# ===== 原有自动节点push到main分支自动执行保留不变=====
- name: print-auto-run
image: alpine:latest
when:
event: push
branch: main
environment:
REPO_UID: "{{ .repo.uid }}"
commands:
@@ -27,21 +21,26 @@ steps:
- echo 自动运行
- echo ===================================
# ===== 手动触发节点【修复后核心配置】=====
--- # Drone 支持一个文件多个流水线,用 --- 分隔
# ===================== 流水线2仅手动触发独立节点100%显示)=====================
kind: pipeline
type: docker
name: manual-pipeline-main # 手动流水线名称
clone:
disable: false
trigger:
event: [manual] # 仅接收手动触发事件,无其他过滤
steps:
- name: print-manual-run
image: alpine:latest
# ✅ 关键修复1添加 branch: [ main, '*' ] 兼容所有分支手动触发
# ✅ 关键修复2用列表格式Drone 推荐写法兼容性100%
when:
event:
- manual
branch:
- main
- '*' # 通配符,匹配所有分支,彻底解决分支冲突问题
environment:
REPO_UID: "{{ .repo.uid }}"
commands:
- echo ===================================
- echo 🚀 这是手动触发的流水线(已生效
- echo 🚀 独立手动流水线(必显示
- echo 手动运行成功!
- echo ===================================