Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions pkg/cli/add_interactive_orchestrator.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,18 @@ func RunAddInteractive(ctx context.Context, workflowSpecs []string, verbose bool
return errors.New("interactive add cannot be used in automated tests or CI environments")
}

// Auto-detect GHES host from git remote if not already set
if os.Getenv("GH_HOST") == "" {
detectedHost := getHostFromOriginRemote()
if detectedHost != "github.com" {
addInteractiveLog.Printf("Auto-detected GHES host from git remote: %s", detectedHost)
os.Setenv("GH_HOST", detectedHost)
if verbose {
fmt.Fprintln(os.Stderr, console.FormatInfoMessage("Auto-detected GitHub Enterprise host: "+detectedHost))
}
}
}
Comment on lines +60 to +70

config := &AddInteractiveConfig{
WorkflowSpecs: workflowSpecs,
Verbose: verbose,
Expand Down
20 changes: 18 additions & 2 deletions pkg/cli/audit.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,15 @@ func isPermissionError(err error) bool {
// If jobID is provided (>0), focuses audit on that specific job
// If stepNumber is provided (>0), extracts output for that specific step
func AuditWorkflowRun(ctx context.Context, runID int64, owner, repo, hostname string, outputDir string, verbose bool, parse bool, jsonOutput bool, jobID int64, stepNumber int) error {
auditLog.Printf("Starting audit for workflow run: runID=%d, owner=%s, repo=%s, jobID=%d, stepNumber=%d", runID, owner, repo, jobID, stepNumber)
// Auto-detect GHES host from git remote if hostname is not provided
if hostname == "" {
hostname = getHostFromOriginRemote()
if hostname != "github.com" {
auditLog.Printf("Auto-detected GHES host from git remote: %s", hostname)
}
}
Comment on lines +136 to +142
Comment on lines +136 to +142

auditLog.Printf("Starting audit for workflow run: runID=%d, owner=%s, repo=%s, hostname=%s, jobID=%d, stepNumber=%d", runID, owner, repo, hostname, jobID, stepNumber)

// Check context cancellation at the start
select {
Expand Down Expand Up @@ -433,7 +441,15 @@ func AuditWorkflowRun(ctx context.Context, runID int64, owner, repo, hostname st
// auditJobRun performs a targeted audit of a specific job within a workflow run
// If stepNumber > 0, focuses on extracting output for that specific step
func auditJobRun(runID int64, jobID int64, stepNumber int, owner, repo, hostname string, outputDir string, verbose bool, jsonOutput bool) error {
auditLog.Printf("Starting job-specific audit: runID=%d, jobID=%d, stepNumber=%d", runID, jobID, stepNumber)
// Auto-detect GHES host from git remote if hostname is not provided
if hostname == "" {
hostname = getHostFromOriginRemote()
if hostname != "github.com" {
auditLog.Printf("Auto-detected GHES host from git remote: %s", hostname)
}
}
Comment on lines +444 to +450

auditLog.Printf("Starting job-specific audit: runID=%d, jobID=%d, stepNumber=%d, hostname=%s", runID, jobID, stepNumber, hostname)

// Create output directory for job-specific artifacts
if err := os.MkdirAll(outputDir, 0750); err != nil {
Expand Down
Loading