git-deploy icon indicating copy to clipboard operation
git-deploy copied to clipboard

Local commits / uncommitted changes are always reset when using gitlab webhooks

Open sk1ll10 opened this issue 5 years ago • 0 comments

When using gitlab webhooks the field "checkout_sha" will always be present. This causes the deployer to execute this block always which can have unwanted side effects.

if (!empty($sha)) {
                // write to the log
                fputs($file, "*** RESET TO HASH INITIATED ***" . "\n");

                exec(GIT . " reset --hard {$sha} 2>&1", $output, $exit);

Of course this makes sense since you do not want to have merge conflicts when using an auto deploy mechanism. In our case we have local sql-lite db running in the webapp that always got deleted although it was never checked in.

sk1ll10 avatar Jan 28 '21 21:01 sk1ll10