How to not execute additional code in OnActionExecutionAsync for specific actions?

Not sure how do you design your BaseController, but usually we custom Action Filters if you want do anything before the action executes.

First way you can custom ActionFilterAttribute and add this attribute on the action which you want to run any other additional code.

public class CustomActionFilterAttribute : ActionFilterAttribute
{
    public override async Task OnActionExecutionAsync(ActionExecutingContext context, ActionExecutionDelegate next)
    {
        var controllerName = context.RouteData.Values["controller"].ToString();
        string action = context.RouteData.Values["action"].ToString();
       //xxxxxxx.Query["YourQueryStringName"].....
        var query = context.HttpContext.Request.Query["tenantID"].ToString();

       //do your stuff....
    }
}

Controller:

public class TestController:BaseController
{
    [CustomActionFilter]
    public IActionResult Index()
    {
        return Ok();
    }
}

Second way you can get your request controller and action name in the method to make them as a condition:

public class CustomActionFilter: IActionFilter
{
    public void OnActionExecuting(ActionExecutingContext context)
    {
        var controllerName = context.RouteData.Values["controller"].ToString();
        string action = context.RouteData.Values["action"].ToString();
        if(controllerName!="xxx"&&action!="xxx")
        {
            //do your stuff...
        }
    }
    public void OnActionExecuted(ActionExecutedContext context)
    {
        
    }
}

Note:

If you want to get the controller and action value, be sure you configure the route template like below:

app.MapControllerRoute(
    name: "default",
    pattern: "{controller=Home}/{action=Index}/{id?}");