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

Function safeOutputsWithDispatchTargetRepo

pkg/workflow/safe_outputs_config.go:1054–1060  ·  view source on GitHub ↗

safeOutputsWithDispatchTargetRepo returns a shallow copy of cfg with the dispatch_workflow TargetRepoSlug overridden to targetRepo. Only DispatchWorkflow is deep-copied; all other pointer fields remain shared. This avoids mutating the original config.

(cfg *SafeOutputsConfig, targetRepo string)

Source from the content-addressed store, hash-verified

1052// TargetRepoSlug overridden to targetRepo. Only DispatchWorkflow is deep-copied; all other
1053// pointer fields remain shared. This avoids mutating the original config.
1054func safeOutputsWithDispatchTargetRepo(cfg *SafeOutputsConfig, targetRepo string) *SafeOutputsConfig {
1055 dispatchCopy := *cfg.DispatchWorkflow
1056 dispatchCopy.TargetRepoSlug = targetRepo
1057 configCopy := *cfg
1058 configCopy.DispatchWorkflow = &dispatchCopy
1059 return &configCopy
1060}
1061
1062// safeOutputsWithDispatchTargetRef returns a shallow copy of cfg with the dispatch_workflow
1063// TargetRef overridden to targetRef. Only DispatchWorkflow is deep-copied; all other

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected