MCPcopy Create free account
hub / github.com/github/gh-aw / countWorkflowMDFiles

Function countWorkflowMDFiles

pkg/cli/upgrade_org.go:141–154  ·  view source on GitHub ↗

countWorkflowMDFiles returns the number of .md files (excluding .lock.yml) in workflowsDir.

(workflowsDir string)

Source from the content-addressed store, hash-verified

139// countWorkflowMDFiles returns the number of .md files (excluding .lock.yml)
140// in workflowsDir.
141func countWorkflowMDFiles(workflowsDir string) (int, error) {
142 entries, err := os.ReadDir(workflowsDir)
143 if err != nil {
144 return 0, err
145 }
146 count := 0
147 for _, e := range entries {
148 name := e.Name()
149 if !e.IsDir() && strings.HasSuffix(name, ".md") && !strings.EqualFold(name, "README.md") {
150 count++
151 }
152 }
153 return count, nil
154}
155
156// extractCompilerVersionFromWorkflowsDir reads the first .lock.yml file in
157// workflowsDir and extracts the compiler_version from its gh-aw-metadata

Callers 1

scanUpgradeRepoFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected