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

Function resolvedWorkflowSpec

pkg/cli/add_command.go:491–498  ·  view source on GitHub ↗

When the fetch used a fallback path (e.g. .github/workflows/my-workflow.md instead of the short-form my-workflow.md), SourcePath holds the actual repo-root-relative path. Propagate it to workflowSpec so all downstream processing (source field, include/import resolution) uses the canonical path.

(workflowSpec *WorkflowSpec, sourceInfo *FetchedWorkflow)

Source from the content-addressed store, hash-verified

489// path. Propagate it to workflowSpec so all downstream processing (source field,
490// include/import resolution) uses the canonical path.
491func resolvedWorkflowSpec(workflowSpec *WorkflowSpec, sourceInfo *FetchedWorkflow) *WorkflowSpec {
492 if sourceInfo == nil || sourceInfo.IsLocal || sourceInfo.SourcePath == "" || sourceInfo.SourcePath == workflowSpec.WorkflowPath {
493 return workflowSpec
494 }
495 specCopy := *workflowSpec
496 specCopy.WorkflowPath = sourceInfo.SourcePath
497 return &specCopy
498}
499
500func processWorkflowContentModifications(content string, workflowSpec *WorkflowSpec, sourceInfo *FetchedWorkflow, githubWorkflowsDir string, opts AddOptions) (string, error) {
501 content, err := applyEngineAndPermissionModifications(content, opts)

Callers 1

addWorkflowWithTrackingFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected