Search code examples
githubgithub-apioctokit-js

What is the octokit.js's method for updating Readme file?


I am using Octokit/rest to edit github files. When I am trying to edit the ReadMe file using the octokit.repos.createOrUpdateFileContents it throws the following error:

HttpError: Not Found

And this is the url I received in the error message:

https://api.github.com/repos/bob/repo-name/contents/README.md

So the error must be that the API call to get the readme file is wrong. So what is the correct method to use to update the ReadMe file?

edit:Created another file with a random name and tried to reach it via this method, it also throws the same error.

Thank you.


Solution

  • Sorry, it's my bad that I used underscore in the repo owner value. I should have used a hyphen. That's the error. Leaving it here so someone might find it helpful in the future.