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

Function PreflightCheckForCreatePR

pkg/cli/pr_helpers.go:17–25  ·  view source on GitHub ↗

PreflightCheckForCreatePR validates preconditions for creating a pull request. Returns an error if the working directory is dirty or the GitHub CLI is unavailable.

(verbose bool)

Source from the content-addressed store, hash-verified

15// PreflightCheckForCreatePR validates preconditions for creating a pull request.
16// Returns an error if the working directory is dirty or the GitHub CLI is unavailable.
17func PreflightCheckForCreatePR(verbose bool) error {
18 if !isGHCLIAvailable() {
19 return errors.New("GitHub CLI (gh) is required for PR creation but not available")
20 }
21 if err := checkCleanWorkingDirectory(verbose); err != nil {
22 return fmt.Errorf("--create-pull-request requires a clean working directory: %w", err)
23 }
24 return nil
25}
26
27// CreatePRWithChanges creates a new branch, stages and commits all current changes,
28// pushes the branch, creates a pull request, and returns to the original branch.

Callers 6

NewUpgradeCommandFunction · 0.85
NewUpdateCommandFunction · 0.85
runUpdateForTargetRepoFunction · 0.85
InitRepositoryFunction · 0.85
runDeployUpdatePassFunction · 0.85
runUpgradeForTargetRepoFunction · 0.85

Calls 3

isGHCLIAvailableFunction · 0.85
ErrorfMethod · 0.45

Tested by

no test coverage detected