We use the CI/CD for github feature and have two repositories (one private and one public). Everything works fine except one thing: occasionally there are duplicate pipelines. Happens on the private repo and on the public and also for pull requests and for master branch.
To be a bit more specific: Gitlab CI/CD for Github is supposed to run the CI pipeline on every push to the Github repository. For every push the pipeline runs once using the most recent commit, regardless of how many commits were pushed. This works except that in some cases the pipeline is triggered twice.
Apparently the reason for the duplicate pipelines were the settings of the GitHub webhook created by gitlab. It was created automatically when we set up the CI/CD for external repository on GitLab. I changed two things in the settings and since then there are no duplicate builds on GitLab anymore:
SSL verification was disabled -> enabled it
The ‘Which events would you like to trigger with this webhook’ setting was set to ‘Let me select individual events’ -> Changed this to ‘Just the push event’
I think before changing it only ‘Pull Requests’ and ‘Pushes’ were enabled. So the question remains why this triggered duplicate pipelines even for commits to master. Also it seems strange that the default webhook settings created by GitLab were such that the pipelines were triggered twice.