I'd like to be able to publish to Github one way. I've read part of the API here at https://docs.github.com/en/rest/quickstart.
It looks like it's possible to read resources from github using this API but I didn't see if it's possible to publish to a repository.
I believe I'd need the user to have git installed and run that. But I'm in a web based environment. That web based environment can't access or run local git calls.
Since my goal is only to push a complete set of files (no diffs) to a specific repository folder, is that possible with the github API?
For example, consider a web form that has an upload feature. In the web page you choose a file with a file input and then send that file with a network request like so:
var request = new XMLHttpRequest(); var formData = new FormData(); formData.append('file', file); request.addEventListener('load', responseHandler, false); request.open('POST', '/upload', true); request.send(formData);
I want to do the same thing. Basically, upload a file or files to a folder in my repository. I can probably reuse the credentials if I'm logged into Github in another tab or authorize through github login.
UPDATE:
This is for the user to be able to post to their own repository not mine. The use case is that the user wants one way write support to a directory of their repository (the github pages directory). They don't need diffs or git or anything else because they are creating the content on their local machine.