AOSSIE-Org / AOSSIE-Org/Template-Repo

refactor: dynamically compute CATEGORY_TOTALS in checklist-score workflow

未关闭
#110 0 条评论 0 个 reaction 已指派 1 人 已被 @kpj2006 认领 在 GitHub 查看
主要语言
YAML
星标
17
派生
29
平均合并
3 天 13 小时
30 天内合并 PR
6

描述

## Summary

The `CATEGORY_TOTALS` map in `.github/workflows/checklist-score.yml` is hardcoded:

```python
CATEGORY_TOTALS = {
"basics": 8,
"change_control": 6,
"reporting": 8,
"quality": 11,
"security": 9,
"analysis": 7,
}
```

These values must be manually updated whenever checklist items are added to or removed from `BestPracticesChecklist.md`, which is error-prone and creates a maintenance burden.

## Proposed Fix

Replace the hardcoded map with a dynamic computation that reads `BestPracticesChecklist.md` at runtime, locates each category heading, and counts all checklist lines (matching `- [ ]`, `- [x]`, `- [X]`, `- [~]`) under each heading. This way, totals are always in sync with the actual checklist content without any manual updates.

## References

- PR: https://github.com/AOSSIE-Org/Template-Repo/pull/108
- Review comment: https://github.com/AOSSIE-Org/Template-Repo/pull/108#discussion_r3005813430

Reported by: @kpj2006

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。