getCurrentWorkflowName extracts the workflow name from the file path
(workflowPath string)
| 13 | |
| 14 | // getCurrentWorkflowName extracts the workflow name from the file path |
| 15 | func getCurrentWorkflowName(workflowPath string) string { |
| 16 | filename := filepath.Base(workflowPath) |
| 17 | // Remove .md or .lock.yml extension |
| 18 | filename = strings.TrimSuffix(filename, ".md") |
| 19 | filename = strings.TrimSuffix(filename, ".lock.yml") |
| 20 | return filename |
| 21 | } |
| 22 | |
| 23 | // isPathWithinDir checks if a path is within a given directory (prevents path traversal) |
| 24 | func isPathWithinDir(path, dir string) bool { |
no outgoing calls
no test coverage detected