cli / cli/gh-webhook

Simulate `installation` key in event body

Open
#6 2 comments 4 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
43
Forks
16
PR merge metrics
No merged PRs in 30d

Description

In order to fully simulate a webhook event request that was triggered by a GitHub App, the `"installation"` key needs to be present. As `--repo` or `--org` need to be passed, we could retrieve the installation object with one of these requests

- https://docs.github.com/en/rest/apps/apps#get-an-organization-installation-for-the-authenticated-app
- https://docs.github.com/en/rest/apps/apps#get-a-repository-installation-for-the-authenticated-app

However the CLI would need the the GitHub App ID and Private Key in order to authenticate for these endpoints, the latter is quite long. Maybe a path to a `.pem` file would work?

```
gh webhook forward --url http://localhost:3000 --events issues --repo my-org/my-repo --secret '' --app-id 123 --app-private-key-path ./private-key.pem
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.