An Azure Function App that receives HTTP form posts containing a comment for a blog and turns them into pull request against your GitHub repository.
The app includes two functions:
PostComment
- receives form POST submission and creates a PR to add the comment to your Jekyll sitePreload
- consider calling this from inside your textarea's change event notificiation to warm up the function
To set this up, you'll need to have an Azure Portal account.
- Fork this repository
- Create a v3 Azure Function
- Set up your function to deploy from your fork
- Set up the following App Settings for your Azure Function
Setting | Value |
---|---|
PostCommentSettings__PullRequestRepository |
owner/name of the repository that houses your Jekyll site for pull requests to be created against. For example, damieng/damieng.com will post to https://github.com/damieng/damieng.com |
PostCommentSettings__GitHubToken |
A GitHub personal access token with access to edit your target repository. |
PostCommentSettings__CommentWebsiteUrl |
The URL to the website that hosts the comments. This is used to make sure the correct site is posting comments to the receiver. |
PostCommentSettings__CommentFallbackCommitEmail |
The email address to use for GitHub commits and PR's if the form does not supply one. |