You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Unnecessary .github folder and missing dependabot implementation when using gitlab as repository host #454
Currently, creating a project from the template with a repository target hosted on gitlab results in an unnecessary .github folder and no dependabot implementation in .gitlab-ci.yml.
This could be fixed with the following logic:
Always create all necessary CI/CD files for both gitlab & github on generation
Remove unnecessary files/folders using a post-generation hook
This hook would be stored in hooks/post_gen_project.py and would look something like this
importosimportshutil# Determine the target platformtarget_platform='{{ cookiecutter.__ci }}'# Define paths to CI directoriesgithub_ci_path=os.path.join(os.getcwd(), '.github')
gitlab_ci_file=os.path.join(os.getcwd(), '.gitlab-ci.yml')
gitlab_dependabot_file=os.path.join(os.getcwd(), 'dependabot.yml')
iftarget_platform=='github':
# Remove the GitLab CI file if the target is GitHubifos.path.exists(gitlab_ci_file):
os.remove(gitlab_ci_file)
os.remove(gitlab_dependabot_file)
eliftarget_platform=='gitlab':
# Remove the GitHub Actions directory if the target is GitLabifos.path.exists(github_ci_path):
shutil.rmtree(github_ci_path)
And for copier? I believe I didn't do this because I was avoiding any custom hooks (we used to have several for things now handled via the template engine). But maybe it would be a good idea to use them for this.
What is dependabot supposed to look like for gitlab?
Activity
henryiii commentedon Jul 17, 2024
And for copier? I believe I didn't do this because I was avoiding any custom hooks (we used to have several for things now handled via the template engine). But maybe it would be a good idea to use them for this.
What is dependabot supposed to look like for gitlab?
mbwinkler commentedon Jul 19, 2024
I am not sure about copier.
Dependabot-gitlab is implemented pretty much the same way Dependabot is on Github.
Add the
.gitlab/dependabot.ymlwith the following basic contents:More information on the setup here.
henryiii commentedon Aug 20, 2024
Can
.gitlab-ci.ymlgo in.gitlab?