Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
WEBHOOK_PROXY_URL=
GITHUB_TOKEN=
GITHUB_WEBHOOK_SECRET=
12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,10 +177,18 @@ To ensure that you follow the development workflow, please setup the pre-commit
uv run pre-commit install
```

To test the webhook handler, use the `compose.yaml` file with the following command:
### Run the application locally

To test the webhook handler you need to fill an `.env` file, run:

```shell
cp .env.example .env
```

then run:

```shell
WEBHOOK_PROXY_URL=https://smee.io/XXX docker compose up
docker compose up
```

## Acknowledgements
Expand Down
1 change: 1 addition & 0 deletions compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ services:
- ./tests:/opt/app/tests:z
environment:
- GITHUB_TOKEN=$GITHUB_TOKEN
- GITHUB_WEBHOOK_SECRET=$GITHUB_WEBHOOK_SECRET
entrypoint:
- uv
- run
Expand Down
2 changes: 1 addition & 1 deletion scripts/github_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from fastgithub import GithubWebhookHandler, SignatureVerificationSHA256, webhook_router
from fastgithub.recipes.github import AutoCreatePullRequest, LabelsFromCommits

signature_verification = SignatureVerificationSHA256(secret="mysecret") # noqa: S106
signature_verification = SignatureVerificationSHA256(secret=os.environ["GITHUB_WEBHOOK_SECRET"]) # noqa: S106
webhook_handler = GithubWebhookHandler(signature_verification)

github = Github(auth=Auth.Token(os.environ["GITHUB_TOKEN"]))
Expand Down
Loading