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

Function hasToolsGithubMap

pkg/cli/codemod_difc_proxy.go:91–106  ·  view source on GitHub ↗

hasToolsGithubMap returns true if frontmatter has tools.github as a map (not just true/false).

(frontmatter map[string]any)

Source from the content-addressed store, hash-verified

89
90// hasToolsGithubMap returns true if frontmatter has tools.github as a map (not just true/false).
91func hasToolsGithubMap(frontmatter map[string]any) bool {
92 toolsAny, hasTools := frontmatter["tools"]
93 if !hasTools {
94 return false
95 }
96 toolsMap, ok := toolsAny.(map[string]any)
97 if !ok {
98 return false
99 }
100 githubAny, hasGitHub := toolsMap["github"]
101 if !hasGitHub {
102 return false
103 }
104 _, ok = githubAny.(map[string]any)
105 return ok
106}
107
108// addIntegrityProxyFalseToToolsGitHub inserts 'integrity-proxy: false' inside the
109// tools.github block. The line is inserted immediately after the 'github:' key line.

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected