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

Function addLabelToOrgPR

pkg/cli/org_issue_pr_helpers.go:199–209  ·  view source on GitHub ↗

addLabelToOrgPR adds a label to a PR identified by URL using gh pr edit. Errors are non-fatal and emitted as warnings.

(ctx context.Context, prURL, label string, verbose bool)

Source from the content-addressed store, hash-verified

197// addLabelToOrgPR adds a label to a PR identified by URL using gh pr edit.
198// Errors are non-fatal and emitted as warnings.
199func addLabelToOrgPR(ctx context.Context, prURL, label string, verbose bool) {
200 remoteHost := getHostFromOriginRemote()
201 if _, err := workflow.RunGHContextWithHost(ctx, "Adding label to PR...", remoteHost, "pr", "edit", prURL, "--add-label", label); err != nil {
202 orgIPLog.Printf("Failed to add label %q to PR %s: %v", label, prURL, err)
203 if verbose {
204 fmt.Fprintln(os.Stderr, console.FormatWarningMessage(
205 fmt.Sprintf("Failed to add label %q to PR (non-fatal): %v", label, err),
206 ))
207 }
208 }
209}
210
211// createOrgIssue creates a GitHub issue with the given title, body, and label. If
212// creating with the label fails (e.g. label does not exist), it retries once without

Callers 2

runUpdateForTargetRepoFunction · 0.85
runUpgradeForTargetRepoFunction · 0.85

Calls 4

RunGHContextWithHostFunction · 0.92
FormatWarningMessageFunction · 0.92
getHostFromOriginRemoteFunction · 0.85
PrintfMethod · 0.45

Tested by

no test coverage detected