This is noted/highlighted with the orange text on Secret Env Vars, that those variable are not available for Pull Request builds, due to security concerns.
If you need a variable to be available for every build you should use App Env Vars instead of Secrets.