Help
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Copilot Lvl 2
Message 1 of 2

How to modify a file during a fork?

I’d like to build an app that will respond to an HTTP POST form submission by:
* forking a GitHub repo that contains an HTML template file
* replacing template text in the file (for example, the HTML title tag) with user-provided text (from a form field)
* saving the fork in the user’s account with the modified HTML file

So basically I want to initiate a fork from an HTTP POST and modify a file during a fork.

 

Can this be done with a GitHub app? Is there a better way to do it? Can you point me to the API documentation or example code?

1 Reply
Highlighted
Copilot Lvl 2
Message 2 of 2

Re: How to modify a file during a fork?

Lots of views but no replies :-(

 

I'm guessing this can't be done as a GitHub App. I'm assuming that the fork process can't have an extra step inserted between retrieving the repo and saving the repo. Would like to have that assumption confirmed.

 

If it can't be done as aGitHub App, I'll build a standalone application that uses the GitHub API to retrieve a file, make the changes, and create a new repo.