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

Function extractTopLevelGitHubApp

pkg/workflow/workflow_github_app.go:15–29  ·  view source on GitHub ↗

extractTopLevelGitHubApp extracts the 'github-app' field from the top-level frontmatter. This provides a single GitHub App configuration that serves as a fallback for all nested github-app token minting operations (on, safe-outputs, checkout, tools.github, dependencies).

(frontmatter map[string]any)

Source from the content-addressed store, hash-verified

13// This provides a single GitHub App configuration that serves as a fallback for all nested
14// github-app token minting operations (on, safe-outputs, checkout, tools.github, dependencies).
15func extractTopLevelGitHubApp(frontmatter map[string]any) *GitHubAppConfig {
16 appAny, ok := frontmatter["github-app"]
17 if !ok {
18 return nil
19 }
20 appMap, ok := appAny.(map[string]any)
21 if !ok {
22 return nil
23 }
24 app := parseAppConfig(appMap)
25 if app.AppID == "" || app.PrivateKey == "" {
26 return nil
27 }
28 return app
29}
30
31// resolveTopLevelGitHubApp resolves the top-level github-app for token minting fallback.
32// Precedence:

Callers 1

resolveTopLevelGitHubAppFunction · 0.85

Calls 1

parseAppConfigFunction · 0.85

Tested by

no test coverage detected