How to programmatically modify GitHub repository wiki using API

I’m working on a project and I want to automatically generate documentation and push it to my GitHub repository’s wiki section. I’ve been using automated documentation tools to create HTML files and I’m wondering if there’s a way to upload these files programmatically through GitHub’s API.

I’ve looked through the GitHub API documentation but couldn’t find any clear endpoints for wiki management. I was hoping there might be a simple way to transfer the generated documentation files, maybe through some file upload mechanism or API calls.

Has anyone successfully automated the process of updating GitHub wiki pages? I’m particularly interested in bulk uploading documentation files rather than manually copying them each time I update my project.

Any suggestions on the best approach would be really helpful. I’m open to using different methods as long as they can be automated.

for sure! just clone the wiki with the .wiki.git suffix, then u can use git commands to push your files. it’s so much simpler than dealing with the api!

Had the same problem a few months ago setting up automated docs for my team. GitHub’s REST API doesn’t have wiki endpoints, which sucks but makes sense since wikis are basically separate git repos. I ended up treating the wiki like any other git repo and automating it through shell commands in CI. Clone the wiki repo, create or update markdown files programmatically, commit, and push back. I wrote a quick script to convert my generated HTML docs to markdown first since GitHub wikis want markdown. Main gotcha: wiki page names become filenames, so your script needs to handle special characters properly. You’ll also need personal access tokens or deploy keys for auth depending on your setup.