Skip to content

How to create a job with init README? #765

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Tiger-zzZ opened this issue Apr 29, 2019 · 1 comment · Fixed by #1067
Closed

How to create a job with init README? #765

Tiger-zzZ opened this issue Apr 29, 2019 · 1 comment · Fixed by #1067
Labels

Comments

@Tiger-zzZ
Copy link

Tiger-zzZ commented Apr 29, 2019

Description of the problem, including code/CLI snippet

I want to use gitlab project create ... to create a job and Initialize repository with a README,
but there is no options.
gitlab api https://docs.gitlab.com/ee/api/projects.html#create-project in create job has option initialize_with_readme.
in the last i use this command create README .gitlab project-file create --project-id $(shell cat REPO_INFO | grep 'id' | sed 's/^id: //g') --file-path README.md --branch master --content '# makefile-init' --commit-message init-with-makefile
if there has better choice?

Expected Behavior

Actual Behavior

Specifications

  • python-gitlab version:
  • API version you are using (v3/v4):
  • Gitlab server version (or gitlab.com):
@nejch
Copy link
Member

nejch commented Apr 7, 2020

Hi @Tiger-zzZ, this is quite late but there are two options:

  1. If you just need a placeholder README so that you have a clonable repo with a master branch, then the following will be enough after fix(project): add missing project parameters #1067 is merged:
gitlab project create --path "your-repo" --initialize-with-readme true
  1. If you need specific content, as shown in your post above with --content 'your content', then I think your approach makes sense. The GitLab API (or UI) does not provide a way to already provide the content of the readme when creating projects with READMEs initialized.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 7, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants