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)
| 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). |
| 15 | func 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: |
no test coverage detected