The diet of a hedgehog has given it the reputation of being the gardener’s friend. Hedgehogs root through hedges and other undergrowth in search of insects, worms, centipedes, snails, mice and frogs.
They like to make nests with dead leaves and branches, therefore, the pile that makes up a bonfire seems to them a nice place to sleep. So before you light the fire, check for hedgehogs. If you find one, simply release it under a hedge or bush.
If checking is too much bother, at least light the fire from one side only and keep people away from the unlit side so any hedgehogs can hopefully escape.
Pic: Hedgehog Street