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

Function getCurrentWorkflowName

pkg/workflow/dispatch_workflow_file_resolver.go:15–21  ·  view source on GitHub ↗

getCurrentWorkflowName extracts the workflow name from the file path

(workflowPath string)

Source from the content-addressed store, hash-verified

13
14// getCurrentWorkflowName extracts the workflow name from the file path
15func 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)
24func isPathWithinDir(path, dir string) bool {

Callers 2

validateCallWorkflowMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected