How to prevent github file changes?

I have a github repo where I have two branches.

  • master branch // has production keys and variables
  • dev branch // has development keys

On the dev branch a lot of the components have development keys and API urls defined, while the same files on the main branch have production level keys and API urls. Every update is pushed first to the dev branch and after QA to the main branch(and lastly to live env). The issue I’m facing is that every time I create pull request from dev into main these keys are overwritten( even if components with keys were not updated still pr sees as these files different and overrides main production keys). How can I prevent components with dev values from being in the pull request when they haven’t been updated?