[moz] fix(ci): 修复 deploy push trigger 不触发问题
根因:deploy.yml notify-deploy-success job 中 python3 -c 使用多行字符串, Python 代码零缩进(column 0)破坏了 YAML literal block scalar (run: |), 导致 Gitea YAML 解析器报错 'line 114: could not find expected :', 在 DetectWorkflows 阶段被静默丢弃,push 事件无法触发 deploy。 Gitea 日志证据: ignore invalid workflow "deploy.yml": yaml: line 114: could not find expected ':' 修复:将多行 python3 -c 改为单行,避免零缩进代码行破坏 YAML 块结构。 影响范围:仅 deploy.yml,不影响 ci.yml 和 e2e.yml 验证方式:YAML 解析已通过,合并后观察 push 事件是否触发 Actions
This commit is contained in:
@@ -110,15 +110,7 @@ jobs:
|
||||
PR_AUTHOR=$(curl --max-time 5 -sf \
|
||||
-H "Authorization: token $GITEA_TOKEN" \
|
||||
"$API_URL/repos/$REPO/pulls?state=closed&sort=updated&order=desc&limit=10" | \
|
||||
python3 -c "
|
||||
import json, sys
|
||||
sha = '$COMMIT_SHA'
|
||||
for pr in json.load(sys.stdin):
|
||||
merge_sha = pr.get('merge_commit_sha', '') or ''
|
||||
if merge_sha.startswith(sha) or sha.startswith(merge_sha):
|
||||
print(pr['user']['login'])
|
||||
break
|
||||
" 2>/dev/null || echo "")
|
||||
python3 -c "import json,sys; sha='$COMMIT_SHA'; matches=[pr['user']['login'] for pr in json.load(sys.stdin) if (pr.get('merge_commit_sha','') or '').startswith(sha) or sha.startswith(pr.get('merge_commit_sha','') or '')]; print(matches[0] if matches else '')" 2>/dev/null || echo "")
|
||||
|
||||
# 确定通知对象
|
||||
if [ -n "$PR_AUTHOR" ]; then
|
||||
|
||||
Reference in New Issue
Block a user