Avoiding merge into Develop

I have a gitlab-runner that runs my jobs. One is only run on master and generated my changelog from commit and bumps my package.json version and publishes + pushes the changes.

I need to get those changes done as part of the pipeline that are committed on master into the develop branch from which the original merge request comes from. I want to avoid the runner doing this as someone could push that causes a merge conflict.

Is there some way to run the changes as part of the merge request that then get pushed to master, but then only are committed to develop if the merge request passes?