Verified Commit a0f37176 authored by Jelle van der Waa's avatar Jelle van der Waa 🚧
Browse files

fix: exact match on bot users

We don't want to check if the given user is a substring of the
GLUEBUDDY_GITLAB_BOT_USERS entries but an exact match as we specify the
bot users in the given env var.
parent 1619d00a
Pipeline #20006 passed with stages
in 2 minutes and 18 seconds
......@@ -835,7 +835,7 @@ fn is_archlinux_bot(member: &GitLabMember) -> bool {
.into_string()
.unwrap()
.split(',')
.any(|bot_name| (&member.username).contains(bot_name));
.any(|bot_name| member.username.eq(bot_name));
}
false
}
......@@ -929,6 +929,7 @@ mod tests {
#[case(None, GITLAB_OWNER, true)]
#[case(None, GITLAB_BOT, true)]
#[case(Some(SOME_KNOWN_BOTS), "renovate", true)]
#[case(Some(SOME_KNOWN_BOTS), "renovate_kitty", false)]
#[case(Some(SOME_KNOWN_BOTS), "project_10185_bot2", true)]
#[case(Some(SOME_KNOWN_BOTS), "project_19591_bot", true)]
#[case(Some(SOME_KNOWN_BOTS), "project_19796_bot", true)]
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment