Cross the finish line

Are you required to cross the finish line on a bike?Suppose you get a flat 100m-1km (or some distance that you can sprint/run) from the finish line. Can you leave your bike and run the remaining distance to the finish line?

In my opinion, in pro racing,
they don’t fix punctures during the race they replace the complete wheel and tyre and fix it later. You have to choose the best for you. I think it is necessary to carry a bike till the finish line.

I think you are free to forfeit the race in that case. But the rules may differ per event