From 783a7a4fd6fe30b981456312d4c7af4ba711d08a Mon Sep 17 00:00:00 2001 From: Chris Campbell <808531+ctcampbell@users.noreply.github.com> Date: Tue, 12 Dec 2023 23:29:08 +0000 Subject: [PATCH 1/3] Update README.md --- README.md | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) diff --git a/README.md b/README.md index 8785a37..bbf6b41 100644 --- a/README.md +++ b/README.md @@ -1,21 +1 @@ -# azure-probot-template - -Edit `src/functions/app.ts` as required: - -```ts -export = (app: Probot) => { - app.on("issues.opened", async (context) => { - const issueComment = context.issue({ - body: "Thanks for opening this issue!", - }); - await context.octokit.issues.createComment(issueComment); - }); -``` - -Create a GitHub app and install it on a repo, then deploy this repo to an Azure Function with the following application settings: - -``` -APP_ID=..... -PRIVATE_KEY="-----BEGIN RSA PRIVATE KEY-----\n..... -WEBHOOK_SECRET=..... -``` +# github-webhook-mirror From e7801ac3381ce9c5b77acdea649ec2a49f43f769 Mon Sep 17 00:00:00 2001 From: Chris Campbell <808531+ctcampbell@users.noreply.github.com> Date: Wed, 13 Dec 2023 10:24:38 +0000 Subject: [PATCH 2/3] Add description --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index bbf6b41..c4d54f3 100644 --- a/README.md +++ b/README.md @@ -1 +1,7 @@ # github-webhook-mirror + +Sends a `repository_dispatch` event back to a GitHub repo when a webhook event is sent. This allows Actions to run on events that are not yet supported as direct triggers such as `code_scanning_alert`. + +## Usage + +1. Create an Azure Function App \ No newline at end of file From a4b0528f9edb85a8a6b99be8c014e6a478f2c769 Mon Sep 17 00:00:00 2001 From: Chris Campbell <808531+ctcampbell@users.noreply.github.com> Date: Wed, 13 Dec 2023 16:19:53 +0000 Subject: [PATCH 3/3] Update README.md --- README.md | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index c4d54f3..491e6da 100644 --- a/README.md +++ b/README.md @@ -4,4 +4,27 @@ Sends a `repository_dispatch` event back to a GitHub repo when a webhook event i ## Usage -1. Create an Azure Function App \ No newline at end of file +### Create a GitHub app on your organisation + +1. Set an appropriate name and Homepage URL + +Screenshot 2023-12-13 at 15 02 32 + +2. Uncheck the Webhook active checkbox, we will come back to this later + +Screenshot 2023-12-13 at 15 02 39 + +3. Set the app permissions to allow `Read and write` for repository contents. This allows the Probot app to send `repository_dispatch` events to the source repository. + +Screenshot 2023-12-13 at 15 03 19 + +4. Generate a private key for the app. + +Screenshot 2023-12-13 at 15 03 51 + +5. Don't forget to install the app on an organisation. + +Screenshot 2023-12-13 at 16 15 01 + + +### Create an Azure Function App