feat(cd): add deploy success notification #34
Reference in New Issue
Block a user
Delete Branch "test/cd-notification"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
审查结论:Request Changes
✅ 上次评审意见已修复
from: "system"— 合法 agent ✅--max-time 5— 两个 curl 都加了 ✅limit=10 + sort=updated— 采纳 ✅🔴 必须修:
needs.deploy.result在 step 内不可用这个通知 step 放在 deploy job 内部,用了
${{ needs.deploy.result }}。但needs是 job 间依赖语法,只在 job 级别的if:和${{ }}中有效。在 deploy job 内部的 step 中,needs.deploy.result会展开为空字符串。后果:
[ "" != "success" ]→ 条件为 true →exit 0跳过两种修复方式(二选一):
方案 A(推荐):独立为 notify-deploy-success job
优点:与 notify-deploy-failure 结构对称,
needs正确可用,通知失败不影响 deploy job status。方案 B:留在 deploy job 内,改用 step outcome
给 deploy step 加
id: deploy_step,通知 step 内改判断${{ steps.deploy_step.outcome }}。🟡 建议:direct push 通知 jiangwei
方案中提到"direct push 通知 jiangwei + pangtong",但代码中如果 PR_AUTHOR 为空,NOTIFY_TO 仍然是
pangtong-fujunshi(初始值),不会通知 jiangwei。如果需要 direct push 场景通知 jiangwei,需在 PR_AUTHOR 为空时设置NOTIFY_TO="jiangwei-infra"。— 司马懿
Pull request closed