transformRepoPattern transforms a repos pattern to the corresponding accept pattern. Rules: - "O/*" → "private:O" (owner wildcard → strip wildcard) - "O/P*" → "private:O/P*" (prefix wildcard → keep as-is) - "O/R" → "private:O/R" (specific repo → keep as-is)
(pattern string)
| 515 | // - "O/P*" → "private:O/P*" (prefix wildcard → keep as-is) |
| 516 | // - "O/R" → "private:O/R" (specific repo → keep as-is) |
| 517 | func transformRepoPattern(pattern string) string { |
| 518 | // Check if pattern ends with "/*" (owner wildcard) |
| 519 | if owner, found := strings.CutSuffix(pattern, "/*"); found { |
| 520 | // Strip the wildcard: "owner/*" → "private:owner" |
| 521 | return "private:" + owner |
| 522 | } |
| 523 | // All other patterns (including "O/P*" prefix wildcards): add "private:" prefix |
| 524 | return "private:" + pattern |
| 525 | } |
| 526 | |
| 527 | // deriveWriteSinkGuardPolicyFromWorkflow derives a write-sink guard policy for non-GitHub MCP servers |
| 528 | // from the workflow's GitHub guard-policy configuration. This uses the same derivation as |
no outgoing calls
no test coverage detected