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

Function auditJobRun

pkg/cli/audit.go:949–964  ·  view source on GitHub ↗

auditJobRun performs a targeted audit of a specific job within a workflow run If stepNumber > 0, focuses on extracting output for that specific step

(opts auditJobRunOptions)

Source from the content-addressed store, hash-verified

947// auditJobRun performs a targeted audit of a specific job within a workflow run
948// If stepNumber > 0, focuses on extracting output for that specific step
949func auditJobRun(opts auditJobRunOptions) error {
950 opts.hostname = resolveAuditHostname(opts.hostname)
951 auditLog.Printf("Starting job-specific audit: runID=%d, jobID=%d, stepNumber=%d, hostname=%s", opts.runID, opts.jobID, opts.stepNumber, opts.hostname)
952 if err := os.MkdirAll(opts.outputDir, constants.DirPermSensitive); err != nil {
953 return fmt.Errorf("failed to create output directory: %w", err)
954 }
955 jobLogContent, jobLogPath, err := fetchAuditJobLog(opts)
956 if err != nil {
957 return err
958 }
959 if err := extractAuditJobDetails(opts, jobLogContent); err != nil {
960 return err
961 }
962 renderAuditJobSummary(opts, jobLogPath)
963 return nil
964}
965
966func fetchAuditJobLog(opts auditJobRunOptions) (string, string, error) {
967 args := []string{"run", "view"}

Callers 1

AuditWorkflowRunFunction · 0.85

Calls 6

resolveAuditHostnameFunction · 0.85
fetchAuditJobLogFunction · 0.85
extractAuditJobDetailsFunction · 0.85
renderAuditJobSummaryFunction · 0.85
PrintfMethod · 0.45
ErrorfMethod · 0.45

Tested by

no test coverage detected