The setup includes:
- experiment.js file:
- where the experiment is coded
- the commitToRepo() function to send the jsonData to netlify function
- .netlify/functions/api
- where the jsonData is received and pushed to repo
- Create Netlify account and sync with the GitHub repository to be deployed
- Go to Deploy Settings > Functions > Settings > Functions directory and add directory where functions will be stored i.e.,
.netlify/functions/api
- Go to GitHub settings (under your own profile) > Developer settings > Personal access tokens and generate a new token.
- Go to Environment under the same netlify settings to add a
GH_TOKEN
environment variable, which is the value of the personal access token
- Commit information
- REPO_NAME
- REPO_OWNER
- Function: createOrUpdateFileContents()
- committer.name
- committer.email
- author.name
- author.email