Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion .github/workflows/butler-heartbeat-watch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,14 @@ jobs:
echo "::error::缺 GOVERNANCE_TOKEN——陈旧度不可查,fail-closed 变红(不盲 trip)" >&2
exit 2
fi
STALE_H="${STALE_HOURS_OVERRIDE:-$(python3 -c 'import yaml; print(yaml.safe_load(open("governance/policy/butler.yaml", encoding="utf-8"))["deadman_stale_hours"])' | tr -d '\r')}"
# 阈值真源 = butler.yaml#thresholds.deadman_stale_hours(嵌套键——首版误读
# 顶层键 KeyError;且 Actions 默认 bash -e 会令 $( ) 失败直灭脚本 exit 1,
# 现显式捕获走 infra 通道 exit 2)
STALE_H="${STALE_HOURS_OVERRIDE:-}"
Comment on lines +48 to +51

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remediation recommended

2. card: line formatted as code 📘 Rule violation § Compliance

The PR description’s card metadata is formatted as inline code (wrapped in backticks), so it does
not start with the required literal Card:  prefix and may not be parsed by tooling. This violates
the required PR card metadata line format.
Agent Prompt
## Issue description
PR description must include exactly one plain-text line starting with `Card: ` followed by `<owner>/<repo>#<n>` (not wrapped in backticks / code formatting).

## Issue Context
This PR has a card reference, but it is formatted as inline code, which prevents the line from literally starting with `Card: `.

## Fix Focus Areas
- .github/workflows/butler-heartbeat-watch.yml[48-55]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

if [[ -z "$STALE_H" ]]; then
STALE_H=$(python3 -c 'import yaml; print(yaml.safe_load(open("governance/policy/butler.yaml", encoding="utf-8"))["thresholds"]["deadman_stale_hours"])' | tr -d '\r') || {
Comment on lines +49 to +53
echo "::error::butler.yaml thresholds.deadman_stale_hours 读取失败" >&2; exit 2; }
fi
[[ "$STALE_H" =~ ^[0-9]+([.][0-9]+)?$ ]] || { echo "::error::deadman_stale_hours 非数值: $STALE_H" >&2; exit 2; }
# 最近一次成功 heartbeat run 的完成时间(workflow 文件名路由;无成功 run = 视为最陈旧)
LAST=$(gh api "repos/Cloudbird-Software/.github/actions/workflows/butler-heartbeat.yml/runs?status=success&per_page=1" \
Expand Down