fix(ci): more changes to fix failing CI (#415)

Fixes from maphew including:
- Remove test for deleted isPathWithinDir function
- Add gosec nolint directives for safe file operations
- Add rm -rf .beads before init in CI workflow
- Simplify panic handling and file operations

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: maphew <maphew@users.noreply.github.com>
Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Steve Yegge
2025-11-29 22:24:29 -08:00
parent 3a2e9d5852
commit d5f2d91d04
9 changed files with 57 additions and 164 deletions

View File

@@ -661,6 +661,7 @@ func checkDatabaseVersion(path string) doctorCheck {
// Check config.yaml for no-db: true
configPath := filepath.Join(beadsDir, "config.yaml")
isNoDbMode := false
// #nosec G304 -- configPath is constructed from beadsDir which is in .beads/
if configData, err := os.ReadFile(configPath); err == nil {
// Simple check for no-db: true in config.yaml
isNoDbMode = strings.Contains(string(configData), "no-db: true")
@@ -1513,6 +1514,13 @@ func countJSONLIssues(jsonlPath string) (int, map[string]int, error) {
return count, prefixes, nil
}
// countIssuesInJSONLFile counts the number of valid issues in a JSONL file.
// This is a wrapper around countJSONLIssues that returns only the count.
func countIssuesInJSONLFile(jsonlPath string) int {
count, _, _ := countJSONLIssues(jsonlPath)
return count
}
func checkPermissions(path string) doctorCheck {
beadsDir := filepath.Join(path, ".beads")