I've been working for a company for a few years. Recently, I decided to look for a new job and found a position which requires me to wait for around 6 months to know if I am accepted or not. For some reason, my boss knows about it. After that, when there is an open position or promotion, he always assigns another member from my team instead of me. His reason is that if I am assigned and leave the company for a new job, it would be a waste of the chance for another member. I am wondering if this is discrimination, and if so, what I should do about it.

**Note**: I'm working in the UK.