I looked all documentation, but it doesn't answer my question.
There is a way to write to a repo (upload a file)? Something like create a folder, and upload a readme.md
Folders do not need to be created as they only exists implicitly in git. Meaning that if you have a file with path folder/file.txt
then your git client knows to create a folder called "folder" where the file "file.txt" is saved, but to git it is just a file with the name "folder/file.txt"
You can use: PUT /repos/{owner}/{repo}/contents/{path}
where {path}
is the folder path and file name, and put message and file content (Base64 encoded) in the body.
When you are updating a file you also need to indicate which version in the git history of the file you want to update. Read more here https://docs.github.com/en/rest/reference/repos#create-or-update-file-contents
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With