Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 9 additions & 10 deletions guards/github-guard/rust-guard/src/labels/helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1292,16 +1292,15 @@ pub fn commit_integrity(
/// - copilot-swe-agent: GitHub Copilot SWE agent (without [bot] suffix)
/// - app/copilot-swe-agent: GitHub Copilot SWE agent (with app/ prefix, as returned by gh CLI)
pub fn is_trusted_first_party_bot(username: &str) -> bool {
let lower = username.to_lowercase();
lower == "dependabot[bot]"
|| lower == "github-actions[bot]"
|| lower == "github-actions"
|| lower == "app/github-actions"
|| lower == "github-merge-queue[bot]"
|| lower == "copilot"
|| lower == "copilot-swe-agent[bot]"
|| lower == "copilot-swe-agent"
|| lower == "app/copilot-swe-agent"
username.eq_ignore_ascii_case("dependabot[bot]")
|| username.eq_ignore_ascii_case("github-actions[bot]")
|| username.eq_ignore_ascii_case("github-actions")
|| username.eq_ignore_ascii_case("app/github-actions")
|| username.eq_ignore_ascii_case("github-merge-queue[bot]")
|| username.eq_ignore_ascii_case("copilot")
|| username.eq_ignore_ascii_case("copilot-swe-agent[bot]")
|| username.eq_ignore_ascii_case("copilot-swe-agent")
|| username.eq_ignore_ascii_case("app/copilot-swe-agent")
}

/// Check if a user is in the gateway-configured trusted bot list.
Expand Down
6 changes: 0 additions & 6 deletions guards/github-guard/rust-guard/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ unsafe extern "C" fn host_log(_level: u32, _msg_ptr: u32, _msg_len: u32) {

/// Call a backend tool and return the result
/// This is a helper wrapper around call_backend with logging
#[allow(dead_code)]
pub fn invoke_backend(
tool_name: &str,
args_json: &str,
Expand Down Expand Up @@ -134,7 +133,6 @@ pub fn invoke_backend(

/// Log levels matching the gateway's expectations
#[repr(u32)]
#[allow(dead_code)]
pub enum LogLevel {
Debug = 0,
Info = 1,
Expand All @@ -153,22 +151,18 @@ fn log(level: LogLevel, msg: &str) {
}
}

#[allow(dead_code)]
fn log_debug(msg: &str) {
log(LogLevel::Debug, msg);
}

#[allow(dead_code)]
fn log_info(msg: &str) {
log(LogLevel::Info, msg);
}

#[allow(dead_code)]
fn log_warn(msg: &str) {
log(LogLevel::Warn, msg);
}

#[allow(dead_code)]
fn log_error(msg: &str) {
log(LogLevel::Error, msg);
}
Expand Down
Loading