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

Function promptForSecret

pkg/cli/engine_secrets.go:277–291  ·  view source on GitHub ↗

promptForSecret prompts the user to provide a secret value

(req SecretRequirement, config EngineSecretConfig)

Source from the content-addressed store, hash-verified

275
276// promptForSecret prompts the user to provide a secret value
277func promptForSecret(req SecretRequirement, config EngineSecretConfig) error {
278 engineSecretsLog.Printf("Prompting for secret: %s", req.Name)
279
280 // Copilot requires special handling with PAT creation instructions
281 if req.IsEngineSecret && req.EngineName == string(constants.CopilotEngine) {
282 return promptForCopilotPATUnified(req, config)
283 }
284
285 // System secrets (GH_AW_*) require PAT-specific prompting, not API key wording
286 if !req.IsEngineSecret {
287 return promptForSystemTokenUnified(req, config)
288 }
289
290 return promptForGenericAPIKeyUnified(req, config)
291}
292
293// promptForCopilotPATUnified prompts the user for a Copilot PAT with detailed instructions
294func promptForCopilotPATUnified(req SecretRequirement, config EngineSecretConfig) error {

Callers 2

ensureSecretAvailableFunction · 0.85
runTokensBootstrapFunction · 0.85

Calls 4

PrintfMethod · 0.45

Tested by

no test coverage detected