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

Function generateMaintenanceWorkflowWrapper

pkg/cli/compile_post_processing.go:74–112  ·  view source on GitHub ↗

generateMaintenanceWorkflowWrapper generates maintenance workflow if any workflow uses expires field

(
	ctx context.Context,
	compiler *workflow.Compiler,
	workflowDataList []*workflow.WorkflowData,
	workflowsDir string,
	gitRoot string,
	verbose bool,
	strict bool,
)

Source from the content-addressed store, hash-verified

72
73// generateMaintenanceWorkflowWrapper generates maintenance workflow if any workflow uses expires field
74func generateMaintenanceWorkflowWrapper(
75 ctx context.Context,
76 compiler *workflow.Compiler,
77 workflowDataList []*workflow.WorkflowData,
78 workflowsDir string,
79 gitRoot string,
80 verbose bool,
81 strict bool,
82) error {
83 compilePostProcessingLog.Print("Generating maintenance workflow")
84
85 // Load repo-level configuration (optional file).
86 repoConfig, err := workflow.LoadRepoConfig(gitRoot)
87 if err != nil {
88 if strict {
89 return fmt.Errorf("failed to load repo config: %w", err)
90 }
91 fmt.Fprintln(os.Stderr, console.FormatWarningMessage(fmt.Sprintf("Failed to load repo config: %v", err)))
92 repoConfig = nil
93 }
94
95 if err := workflow.GenerateMaintenanceWorkflow(ctx, workflow.GenerateMaintenanceWorkflowOptions{
96 WorkflowDataList: workflowDataList,
97 WorkflowDir: workflowsDir,
98 Version: compiler.GetVersion(),
99 ActionMode: compiler.GetActionMode(),
100 ActionTag: compiler.GetActionTag(),
101 RepoConfig: repoConfig,
102 RepoSlug: compiler.GetRepositorySlug(),
103 }); err != nil {
104 if strict {
105 return fmt.Errorf("failed to generate maintenance workflow: %w", err)
106 }
107 // Non-strict mode: just report as warning
108 fmt.Fprintln(os.Stderr, console.FormatWarningMessage(fmt.Sprintf("Failed to generate maintenance workflow: %v", err)))
109 }
110
111 return nil
112}
113
114// generateCentralSlashCommandWorkflowWrapper generates a single centralized
115// slash-command trigger workflow for all participating workflows.

Callers 1

Calls 9

LoadRepoConfigFunction · 0.92
FormatWarningMessageFunction · 0.92
PrintMethod · 0.80
GetVersionMethod · 0.80
GetActionModeMethod · 0.80
GetActionTagMethod · 0.80
GetRepositorySlugMethod · 0.80
ErrorfMethod · 0.45

Tested by

no test coverage detected