Joe Girardi had to know this was coming.

The Mets’ managerial opening of course came up as Girardi — likely a top candidate for the job — helped call the Astros’ 3-1 win over the Rays in Game 2 of the ALDS Saturday night.

Asked by Fox colleague Kenny Albert whether he’s been studying Pete Alonso, the former Yankees manager said: “I have a little bit. He’s a pretty good player. I did a bunch of games this year.”

Girardi has been doing his homework on Alonso and the Mets since the Mets fired Mickey Callaway last week, as The Post’s Mike Puma previously reported.

“Is (Alonso) going to be batting second for you next year in New York?” former major leaguer AJ Pierzynski followed up.

The members of the broadcast booth laughed, and Girardi said, “I’m taking the Fifth. I’m a broadcaster right now.”

Girardi is expected to take over one of the seven managerial vacancies, and reportedly will meet with the Cubs this week.

“I do want to manage again, so we’ll see what happens,” Girardi told The Post’s Kevin Kernan in Houston.

The 54-year-old spent seven seasons in two stints with the Cubs as a player. The Giants, Padres, Pirates, Royals and Angels are also looking for new managers.

Girardi wasn’t retained by the Yankees after the 2017 season and is working as an analyst for MLB Network and Fox.