Webhooks not working between GitHub and Hostinger

ERROR: I successfully deployed my website from GitLab to Hostinger, and have set up a webhook to sync any changes. However, whenever I push any changes to GitLab I get the following message in Hostinger and the changes do not sync. What am I doing wrong?! TIA

Deployment start
Repository git@gitlab.com:username/project.git
Checking project directory is empty
Project directory is git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

Deployment failed

Solution

I got the same error with GitHub and to fix it this is what I did:

  1. in Hostinger file manager I backed up my public_html folder then removed its content.
  2. I deleted my repository in Hostinger manage repositories section.
  3. I added a new repository BUT this time I only clicked Auto Deployment don’t click on deploy.
  4. I made my repository as public since I am only using it for learning
  5. I added the Webhooks and everytime I push to main my build branch will be auto deployed.

Leave a Comment