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)
| 489 | // path. Propagate it to workflowSpec so all downstream processing (source field, |
| 490 | // include/import resolution) uses the canonical path. |
| 491 | func 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 | |
| 500 | func processWorkflowContentModifications(content string, workflowSpec *WorkflowSpec, sourceInfo *FetchedWorkflow, githubWorkflowsDir string, opts AddOptions) (string, error) { |
| 501 | content, err := applyEngineAndPermissionModifications(content, opts) |
no outgoing calls
no test coverage detected