President Trump gave away the game last week. Confronted with one of the largest mass-assassination attempts in U.S. history, Trump bemoaned the fact that it was taking the focus away from politics at a time when Republicans were supposedly ascendant.

And more specifically, it was taking the focus off his closing campaign message of choice: immigration and the “invasion” of a migrant caravan headed to the U.S.-Mexico border.

That and other context is vital when considering Trump’s claim to be planning to revoke birthright citizenship via executive action. There is quite frankly very little reason to believe this is a serious proposal — either legally or practically speaking — and it should be viewed and covered accordingly. There is abundant reason to believe this is primarily a ploy to fire up his base on the eve of an election.

The first important bit of context is the Constitution. The idea that someone born in the United States is entitled to citizenship is enshrined in the 14th Amendment, and while there has been some debate about whether a narrow scaling back might be allowed to stand — perhaps in the case of undocumented immigrants, for instance — there is precedent here. In U.S. v. Wong Kim Ark in 1898, the Supreme Court ruled that anyone born in the United States was a citizen. The justices in that case noted that the amendment made no specifications about what status or potential status the parents might have. That was reaffirmed in 1982′s Plyler v. Doe, which stated that “no plausible distinction with respect to Fourteenth Amendment ‘jurisdiction’ can be drawn between resident aliens whose entry into the United States was lawful, and resident aliens whose entry was unlawful.”

Even those who favor revoking birthright citizenship generally agree that it would require a new constitutional amendment.

What really calls into question the supposed gambit’s prospects is the method: executive action. Executive actions are permitted to interpret existing law, not make new ones. It would be one thing for Congress to attempt to revoke birthright citizenship; Trump trying to do it via executive action adds another huge hurdle for passing legal muster, beyond the already high hurdle of effectively undoing a Constitutional amendment.

“There’s an active academic debate over whether mere legislation could change it with respect to illegal immigrants and tourists,” the Cato Institute’s Ilya Shapiro told The Post’s Robert Barnes, “but regardless it’s not something that can be done by executive action alone.”

But perhaps the most important context here is the context of Trump. The president has a tendency to float unserious and fanciful ideas — on the eve of an election and otherwise — for political impact.

Before the 2016 election, Trump promised to sue his sexual harassment and assault accusers — a supposed sign that he was serious about proving his innocence — and he still never has. In recent weeks, he has been talking about how Congress could pass a new, middle-class tax cut before the election, even though Congress hasn’t even been in session.

Trump has since moved the goal posts on this, instead promising a nonbinding resolution pledging to do this after the election. The idea that Republicans would actually undertake this idea with a budget deficit that is ballooning to $1 trillion is tough to swallow. And most tellingly of all, almost no GOP members of Congress are echoing Trump’s message.

Sometimes these notions crop up even outside election season. Earlier this year, Trump floated the idea of Congress giving him a line-item veto, which Bill Clinton tried unsuccessfully to obtain and would also very likely require a constitutional amendment. Treasury Secretary Steven Mnuchin suggested the administration had some kind of secret workaround to do it without an amendment. White House spokesman Raj Shah said, “There are certain things being discussed with respect to House and Senate rules.” We’re still waiting to find out what the magical workaround is, because Trump hasn’t actually pursued it, seven months later.

The point is that Trump tends to float ideas as if he will definitely pursue them, often simply because he wishes they were true. He has done this repeatedly without consideration for the law and political practicalities. And he has an ever greater incentive to do this on the eve of the 2018 elections, because he feels like his ace-in-the-hole message on immigration is being overshadowed. This is why he’s calling the caravan an “invasion,” and that’s why he’s sending 5,200 troops to the border just before the midterms, even though the last caravan’s asylum seekers simply surrendered themselves at a port of entry.

A pretty good indicator of Trump’s actual intentions here is the fact that he has provided no actual timetable for attempting to end birthright citizenship. That means it won’t happen before the election next week, and if and when he hasn’t done it after several months, the electoral impact will already have registered and it won’t matter. Trump has broken so many promises to his base, this will simply be thrown on the scrap heap — an idea that was supposed to be “taken seriously, not literally.”

These things must be covered somewhat credulously, because it’s impossible to rule out what Trump might or might not do, and it’s impossible to prejudge an eventual Supreme Court decision. But the totality of it points very clearly in the direction of a cynical ploy that, even if it’s attempted, will likely fail. And it probably won’t even be attempted.