Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
You need to make a seperate API call to create the file, check documentation to know how.
-
@theabbie I'm not able to find this in docs or I can say I'm too dumb to understand docs properly I've searched a lot the only thing I found is the code I mention above.
-
If I had to guess:
First, upload a file: https://docs.github.com/en/rest/...
Second, create a tree:
https://docs.github.com/en/rest/...
Last, a commit:
https://docs.github.com/en/rest/... -
@PonySlaystation non standard behavior, hard to refactor away, no need for the dependency when there is HTML5 fetch. Use that and polyfill on node, if needed.
Related Rants
I know I sound stupid but I need help, I create a repo on GitHub using gh-api ```js
export async function createARepo({name,description,token}) {
const headers = {
"Authorization": `token ${token}`,
"Accept": "application/vnd.github.v3+json",
}
const {data} = await axios(
{
method: "POST",
url: "https://api.github.com/user/repos",
data: {name,description,auto_init: true},
headers
}
)
return data
// console.log(res)
}```
when I run this code it only creates an empty project with a readme but I also want to create a file with a .html extension of the project can anybody help me with how I do this?
question
github
js