Actually, closer gamma-ray bursts would be extinction events.
<https://www.universetoday.com/118140/are-gamma-ray-bursts-da...> (Via Wikipedia: <https://en.wikipedia.org/wiki/Gamma-ray_burst#Rate_of_occurr...>)
The energy released, in a few tens of milliseconds to a few hours, exceeds that of the Sun over its entire 10+ billion year lifespan.
(I'm not sure if neutron star / black hole events might trigger larger emissions lethal at greater ranges.)
A galaxy is a pretty dangerous place to be. Probably we should get clear at first opportunity.
A pretty big pair is scheduled to merge sometime in the next three years. Probably we will get enough warning to be watching carefully when it happens.