The shortest way to say this would probably be
I work an overnight shift.
This means that you start at some point in the evening and finish at some point the following morning.
For phrasing it as a conditional, you might say "If you are on an overnight shift" or "If you are working an overnight shift", but I do think that "If your shift is overnight" is acceptable.