How to commit to a github repo from a website (IN BROWSER) using javascript

I have a website that needs a JSON file to display a sort of timetable that’s hosted on GitHub pages. People who do not know what javascript or GitHub are need to be able to change that JSON file each week.

To solve this I’ve created a website that reads data from a google sheet they can edit, and turns it into a js object at the click of a button. I now just need to get this object from the website into the JSON file on the first GitHub repo, but I have no clue how to do this. I know you can use the GitHub API somehow, but how??

P.s. I know making the token built into the website is a security risk which is why I plan to only put tokens in the google sheet, which requires the user to authenticate a google account before being accessed.