It seems that the GLTF exporter only has very crude options for which bones are exported in an animation. Either you export everything (which can include a lot of unnecessary bones for a game engine), or you can select deform bones only. Sometimes you need to include extra bones to indicate attachment points. Is there any way to indicate that you want to include a few extra bones without having to export everything?
When you enable the Deform option on a bone, that bone and any parent bones required to keep its place in the skeleton hierarchy will be exported using the ‘Deform Only’ export option.
Marking a bone with Deform is all you need to do to make sure that it gets exported. It will only have an effect on the mesh if there are weights assigned to it via a vertex group with the same name as the bone. So once you’ve done your weight painting, you can tag as many extra bones as you need with Deform, and they will be included in the export.