Closed christophwitzko closed 1 year ago
Not entirely sure about this but it would be my approach (untested as of now):
# gitlab ci job which mirrors the repository on github webhook event
mirror_repository:
only:
- triggers # only run this job on pipeline triggers
# can add additional rules to check for a specific variable set from pipeline trigger webhook
before_script:
# setup ssh/git to be able to push to this repository
script:
- git clone https://github.com/go-semantic-release/semantic-release gh-mirror
- cd gh-mirror
- git remote remove origin
- git remote add origin https://gitlab.com/go-semantic-release/semantic-release
- git push --prune --all
- git push --prune --tags
I never used GitHub Webhooks so I'm not sure about the last step but from what I read it should work. Got the basic idea from a medium article
I did a simple PoC repository which shows the workflow is working:
Using pipeline trigger variables and the webhook this can be customized to your desire. If you need help setting this up or have any questions feel free to ask.
Hey @superewald, thank you so much for looking into this. 👍 I think I will add a push-based approach to GitHub Actions because GitHub is the main development platform.
Until recently, we used https://gitlab.com/go-semantic-release/semantic-release as a mirror for the semantic-release project to test the GitLab integration. On 13-09-2022, GitLab moved this functionality to the Premium tier, and therefore, we need another solution to test our integration. (see https://docs.gitlab.com/ee/user/project/repository/mirror/pull.html)