php – using add_action for a header hook that has an additional parameter


The theme I’m using has a hook inside header.php file to separate the header into two parts, left & right. I want to add some content into the right section but I don’t understand how can I add the additional parameter when using add_action(). Code as below,

do_action( 'sinatra_header_widget_location', 'left' );
            get_template_part( 'template-parts/header/logo' );
            do_action( 'sinatra_header_widget_location', 'right' );

How can I pass 'right' parameter into add_action? my funcions.php looks like:

add_action('sinatra_header_widget_location', 'my_custom_function');
function my_custom_function() {
    echo 'test';
}