This question is some kind of follow up of this one:
My goal is to create a static page with GitHub Pages with a simple button.
When a user presses this button, a new file is created in the same repository, with fixed content, in the same branch used for GitHub pages.
Suppose you have the address of GitHub Pages static page, for example:
If this repo is public, anyone can go to this page and see the content in the browser.
Suppose a user wants to press the button to create the new file. I can see 3 scenarios:
the user is not logged in GitHub -> if the user clicks the button, the file cannot be created in the repo
the user is logged in GitHub, but
MyGitHubRepois not one of his repo -> if the user clicks the button, the file cannot be created in the repo
the user is logged in GitHub and
MyGitHubRepois one of his repo
If the user clicks the button, is it possible to create and push the file in the repo?
What are the conditions? Is there any example I can study?
TiddlyWiki does what you want
( host on GH/GL Pages , save via JS and https:// git push with token )
See e.g. the Settings Dialogue here: https://doc-links-manual-howto.github.io/