Although it doesn't appear to be a Dirt E, this video may be of some help:
Since the Dirt E is a mountain bike, Giant may not have provided for a light, since the bike is designed for off road use, primarily during daylight hours.
Rather than try to tap into the wiring harness, why not use a handlebar mount light with an internal battery? That way, it can be easily removed when not needed. It can also be used as a flashlight for making nighttime repairs. If the Dirt E has a USB port, it can be used to recharge the light while mounted on the bike.
There are many such lights available with a wide range in prices. I've had great luck with this one for off road riding at night:
One of the best bike lights on the planet. Incredibly wide and even beam pattern, USB-C quick charge, robust quick release mount and built in Chicago, IL.
www.outboundlighting.com
I have several bikes, and the light can be switched between them as necessary. When mounted to the bike, I leave it plugged into the USB port so it's always charged and ready to go.
Welcome to the forum and good luck with your project!