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

Function buildAWFConfigSchemaURL

pkg/workflow/awf_config.go:356–371  ·  view source on GitHub ↗

buildAWFConfigSchemaURL returns the release-pinned JSON schema URL for the AWF config file. The URL is versioned so that schema validation tools always reference the exact schema that matches the AWF binary being used. When DefaultFirewallVersion is bumped the URL automatically tracks the new releas

(firewallConfig *FirewallConfig)

Source from the content-addressed store, hash-verified

354// If firewallConfig carries an explicit version (e.g. sandbox.agent.version) that version
355// is used; otherwise DefaultFirewallVersion is used.
356func buildAWFConfigSchemaURL(firewallConfig *FirewallConfig) string {
357 version := string(constants.DefaultFirewallVersion)
358 if firewallConfig != nil && firewallConfig.Version != "" {
359 version = firewallConfig.Version
360 }
361 // Special-case "latest": the GitHub Releases /latest/download/ shortcut serves
362 // assets from the most recent release without requiring a tag in the path.
363 if strings.EqualFold(version, "latest") {
364 return "https://github.com/github/gh-aw-firewall/releases/latest/download/awf-config.schema.json"
365 }
366 // Ensure version has the 'v' prefix required by GitHub release tag URLs.
367 if !strings.HasPrefix(version, "v") {
368 version = "v" + version
369 }
370 return fmt.Sprintf("https://github.com/github/gh-aw-firewall/releases/download/%s/awf-config.schema.json", version)
371}
372
373// BuildAWFConfigJSON generates a compact JSON config file for AWF from the provided
374// command configuration. The JSON is single-line (no indentation) for safe embedding

Callers 2

BuildAWFConfigJSONFunction · 0.85

Calls

no outgoing calls

Tested by 1