AOSSIE-Org / AOSSIE-Org/Template-Repo

refactor: dynamically compute CATEGORY_TOTALS in checklist-score workflow

Đang mở
#110 0 bình luận 0 reaction 1 người được giao Được @kpj2006 nhận Xem trên GitHub
Ngôn ngữ chính
YAML
Star
17
Fork
29
Merge trung bình
3 ngày 13 giờ
Pull request đã merge (30 ngày)
6

Mô tả

## 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

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.