-
Notifications
You must be signed in to change notification settings - Fork 87
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
Uploading Project Avatar #698
Comments
Hi. Could you please share a sample config you have tried? |
Yeah, no problem. project_settings:
avatar: './my-photo.jpg',
description: |
Projeto de documentação I tried putting a base64 image, svg, png. Searched some forums and the gitlab api docs but couldnt figure out the format that I should use. |
Thanks for the sample config. What you tried won't work, regardless of value format. It comes down to Gitlab's API. The Project avatar is managed by a different gitlab API. Gitlabform currently doesn't have support for it. PR is welcome though. Would you be interested in implementing it? Let's discuss what the config should be like for this setting. This feature probably should also support deleting a project avatar. |
Oh, ok. Thank you. Do you know what is the avatar prop in Project API? I think their documentation needs a fix, it kind of implies that it is possible to change the avatar from this api. About the config file in my opinion, the easiest way would the passing a relative url of the image file. |
Hmm... I didn't realize earlier that the "Edit project" API endpoint had an curl --silent --request PUT --header "PRIVATE-TOKEN: ${GITLAB_TOKEN}" --url "${GITLAB_API_URL}/projects/<PROJECT_ID>" --form "avatar=@${HOME}/Downloads/sample-logo.jpeg" | jq . The API for "Upload a project avatar" works the same way. So, in theory the config you had is fine. But, I don't think gitlabform has logic to process that config because as you can see the |
Oh I see. I haven't looked into gitlabform's code but maybe it is possible to use the curl to use the already available edit project endpoint when the avatar urls is used? I don't know if im have enought knowledge about gitlabform to send a PR. Maybe in the future, but I think it a good feature to have. Thank you for helping me, @amimas! |
I'm having trouble uploading avatars for my projects. I always get
{"error":"avatar is invalid"}
error.I can't change using curl to change one by one.
I think that the problem is that gitlabform can't find my image file but can't figure out the correct url. Tried relative, absolute, with starting '@'...
The text was updated successfully, but these errors were encountered: