diff --git a/README.md b/README.md index 8785a37..491e6da 100644 --- a/README.md +++ b/README.md @@ -1,21 +1,30 @@ -# 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 + +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 + +### 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