Long-term daily melatonin use is generally considered pretty safe by most sleep specialists, especially at the dose you're taking. The main thing is that melatonin isn't like prescription sleep meds where your body builds up tolerance and you need more and more - it doesn't work that way. That said, are you actually still needing it every single night, or has this become more of a habit thing? Because there's a difference between dependence (where your body physically needs it) and psychological dependence (where you just feel like you can't sleep without it).
One thing worth considering - has your sleep schedule actually stabilized enough that you might be able to taper down? A year is a decent amount of time for your circadian rhythm to adjust to night shifts. You could try dropping it a night or two a week and see what happens, or gradually lowering the dose to like 2.5mg and see if that still works. Some people find they don't actually need it anymore once their body's gotten used to the new schedule. Also, are you doing other stuff to support sleep on night shifts - like getting bright light exposure when you wake up, keeping your bedroom dark enough, that kind of thing? Because sometimes people rely on melatonin when fixing the environment would actually help more.
The safety profile is solid, so you're not harming yourself, but if you're worried about dependency it's worth experimenting with whether you actually still need the full 5mg every night. What does your sleep look like on the nights you've accidentally missed it?