Skip to content

Commit fe300e4

Browse files
committed
Modified bot name. Retrieve from env variable
1 parent c61a72a commit fe300e4

File tree

1 file changed

+2
-16
lines changed

1 file changed

+2
-16
lines changed

fplus-lib/src/core/mod.rs

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,6 @@ use crate::core::application::file::Allocation;
2727

2828
pub mod application;
2929

30-
const DEV_BOT_USER: &str = "filplus-github-bot-read-write[bot]";
31-
const PROD_BOT_USER: &str = "filplus-falcon[bot]";
32-
3330
#[derive(Deserialize)]
3431
pub struct CreateApplicationInfo {
3532
pub issue_number: String,
@@ -778,14 +775,7 @@ impl LDNApplication {
778775
log::info!("- Application is in a valid state!");
779776
return Ok(true);
780777
}
781-
782-
// Check if application is in any other state
783-
let bot_user = if get_env_var_or_default("FILPLUS_ENV", "dev") == "prod" {
784-
PROD_BOT_USER
785-
} else {
786-
DEV_BOT_USER
787-
};
788-
778+
let bot_user = get_env_var_or_default("BOT_USER", "filplus-github-bot-read-write[bot]");
789779
if author != bot_user {
790780
log::warn!("- Author is not the bot user");
791781
return Ok(false);
@@ -813,11 +803,7 @@ impl LDNApplication {
813803
let app_state = application_file.lifecycle.get_state();
814804
let active_request_id = application_file.lifecycle.active_request.clone();
815805
let valid_rkh = Self::fetch_rkh().await?;
816-
let bot_user = if get_env_var_or_default("FILPLUS_ENV", "dev") == "prod" {
817-
PROD_BOT_USER
818-
} else {
819-
DEV_BOT_USER
820-
};
806+
let bot_user = get_env_var_or_default("BOT_USER", "filplus-github-bot-read-write[bot]");
821807

822808
let res: bool = match app_state {
823809
AppState::Submitted => {

0 commit comments

Comments
 (0)