mehrancodes / laravel-harbor

a cli tool to Quickly create on-demand preview environment for your app on Laravel Forge.
https://www.laravel-harbor.com
MIT License
75 stars 7 forks source link

Harbor overwrites changes to environment variables #109

Open gbradley opened 3 months ago

gbradley commented 3 months ago

I'm currently having an issue where I need to modify my environment variables on a branch that I'd like previews for. On initial provision, Harbor takes the environment variables that I've defined in GitHub secrets, which is great.

However if I make a change to the environment via Forge and then push some changes to the PR, Harbor will then overwrite those changes with the ones from GitHub, meaning I have to re-edit them, restart the queue etc.

Is is possible to change the behaviour here, so when updating an existing site, Harbor gives existing variables priority?

Hannsre commented 2 months ago

What we did to prevent this: We removed the updated trigger in the harbor provisioning workflow. We found there to be no reason to re-provision with harbor every time there is some code pushed to the PR.

Not exactly the solution you're looking for, but maybe it helps.

gbradley commented 2 months ago

Thanks for the suggestion, I think you’re right - we’ll probably ignore the synchronize event in the workflow and turn on quick deploy.

mehrancodes commented 1 month ago

Hi @gbradley, maybe Harbor shouldn't touch .env after the first run. Just wondering if there's a reason someone would want to overwrite it every time