fix: Fix error handler token injection (#2598)

* fix: Fix error handler token injection

* Add frontend
This commit is contained in:
Guillaume Bouvignies
2023-11-09 11:58:45 +01:00
committed by GitHub
parent 198e282566
commit aefa43dcaf
6 changed files with 24 additions and 29 deletions

View File

@@ -596,9 +596,10 @@ pub async fn run_error_handler<
}
// TODO: this should be injected when the EH is defined in the BE.
if error_handler_path
.to_string()
.eq("hub/6512/workspace-or-schedule-error-handler-slack")
if error_handler_path.to_string().starts_with("hub/")
&& error_handler_path
.to_string()
.ends_with("/workspace-or-schedule-error-handler-slack")
{
// default slack error handler being used -> we need to inject the slack token
let slack_resource = format!("$res:{WORKSPACE_SLACK_BOT_TOKEN_PATH}");
@@ -1036,9 +1037,10 @@ pub async fn handle_on_failure<
}
// TODO: This should be inject when the EH is defined in the FE.
if on_failure_path
.to_string()
.eq("script/hub/6512/workspace-or-schedule-error-handler-slack")
if on_failure_path.to_string().starts_with("script/hub/")
&& on_failure_path
.to_string()
.ends_with("/workspace-or-schedule-error-handler-slack")
{
// default slack error handler being used -> we need to inject the slack token
let slack_resource = format!("$res:{WORKSPACE_SLACK_BOT_TOKEN_PATH}");