Skip to content

Commit ad4fdba

Browse files
Copilotlpcox
andauthored
Use starts_with for segment matching in check_file_secrecy; remove is_bot from IMPLEMENTATION.md
Agent-Logs-Url: https://github.com/github/gh-aw-mcpg/sessions/c2a17f9e-44f8-498b-8dcd-40290a4119c3 Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
1 parent 02fea7e commit ad4fdba

2 files changed

Lines changed: 1 addition & 15 deletions

File tree

guards/github-guard/docs/IMPLEMENTATION.md

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -111,20 +111,6 @@ pub fn is_verified_contributor(username: &str, owner: &str, repo: &str) -> bool
111111

112112
Uses `search_pull_requests` with query: `author:X repo:Y is:merged`
113113

114-
### Bot Detection
115-
116-
Known bots receive approved-level integrity (with unapproved floor):
117-
118-
```rust
119-
pub fn is_bot(username: &str) -> bool {
120-
lower.ends_with("[bot]")
121-
|| lower.ends_with("-bot")
122-
|| lower == "dependabot"
123-
|| lower == "renovate"
124-
|| lower == "github-actions"
125-
|| lower == "copilot"
126-
}
127-
```
128114

129115
## Project Structure
130116

guards/github-guard/rust-guard/src/labels/tool_rules.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -682,7 +682,7 @@ fn check_file_secrecy(
682682

683683
// Check for sensitive file extensions/names
684684
for pattern in SENSITIVE_FILE_PATTERNS {
685-
if path_lower.ends_with(pattern) || path_lower.split('/').any(|seg| seg == *pattern) {
685+
if path_lower.ends_with(pattern) || path_lower.split('/').any(|seg| seg.starts_with(*pattern)) {
686686
return policy_private_scope_label(owner, repo, repo_id, ctx);
687687
}
688688
}

0 commit comments

Comments
 (0)