Skip to content
This repository has been archived by the owner on Mar 25, 2023. It is now read-only.

Allow remote_repo_create/3 to use more value in body request #19

Open
SimonLab opened this issue May 20, 2022 · 0 comments
Open

Allow remote_repo_create/3 to use more value in body request #19

SimonLab opened this issue May 20, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@SimonLab
Copy link
Member

gitea/lib/gitea.ex

Lines 35 to 48 in 0c2bb0e

@spec remote_repo_create(String.t(), String.t(), boolean) :: {:ok, map} | {:error, any}
def remote_repo_create(org_name, repo_name, private \\ false) do
url = api_base_url() <> "org/#{org_name}/repos"
Logger.info("remote_repo_create api endpoint: #{url}")
params = %{
name: repo_name,
private: private,
description: repo_name,
readme: repo_name
}
Gitea.Http.post(url, params)
end

I would like to be able to setup more params and be able to define the current default ones:

   params = %{ 
     name: repo_name, 
     private: private, 
     description: repo_name, 
     readme: repo_name 
   } 

Maybe in this case having a keyword list as third parameter might be a good option:

opts = [private: true. auto_init: true, ...]
def remote_repo_create(org_name, repo_name, opts) do 

linked to #18 as I want to use especially the auto_init value to have the repository created with a default Readme

@SimonLab SimonLab added the enhancement New feature or request label May 20, 2022
@nelsonic nelsonic changed the title Allow remote_create_repo to use more value in body request Allow remote_repo_create/3 to use more value in body request May 20, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant