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

Function recompileAllWorkflows

pkg/cli/update_command.go:253–275  ·  view source on GitHub ↗

recompileAllWorkflows recompiles all .md workflow files in the given directory. This is used after container pin updates to embed digest-pinned image references in the generated lock files.

(ctx context.Context, workflowsDir, engineOverride string, verbose bool)

Source from the content-addressed store, hash-verified

251// This is used after container pin updates to embed digest-pinned image references
252// in the generated lock files.
253func recompileAllWorkflows(ctx context.Context, workflowsDir, engineOverride string, verbose bool) error {
254 if workflowsDir == "" {
255 workflowsDir = getWorkflowsDir()
256 }
257
258 entries, err := os.ReadDir(workflowsDir)
259 if err != nil {
260 return fmt.Errorf("failed to read workflows directory: %w", err)
261 }
262
263 for _, entry := range entries {
264 if entry.IsDir() || !strings.HasSuffix(entry.Name(), ".md") {
265 continue
266 }
267 path := filepath.Join(workflowsDir, entry.Name())
268 if err := compileWorkflowWithRefresh(ctx, path, verbose, true, engineOverride, false); err != nil {
269 if verbose {
270 fmt.Fprintln(os.Stderr, console.FormatWarningMessage(fmt.Sprintf("Failed to recompile %s: %v", entry.Name(), err)))
271 }
272 }
273 }
274 return nil
275}
276
277func runUpdateForTargetRepo(ctx context.Context, targetRepo string, opts UpdateWorkflowsOptions, createPR bool, verbose bool) error {
278 gitRoot, err := gitutil.FindGitRoot()

Callers 2

runUpgradeCommandFunction · 0.85
RunUpdateWorkflowsFunction · 0.85

Calls 4

FormatWarningMessageFunction · 0.92
getWorkflowsDirFunction · 0.85
ErrorfMethod · 0.45

Tested by

no test coverage detected