Enable LLMs to handle webhooks with plaintext files
at main 54 lines 2.2 kB view raw
1--- 2verify: 3 hmac: 4 header: X-Hub-Signature-256 5 prefix: "sha256=" 6 secret: $GITHUB_WEBHOOK_SECRET 7payload: 8 contentType: json 9--- 10 11You have received a GitHub webhook from the **{{ payload.repository.full_name }}** repository. 12 13Event: `{{ headers["x-github-event"] }}` 14 15{% if headers["x-github-event"] == "push" %} 16**{{ payload.pusher.name }}** pushed {{ payload.commits | size }} commit(s) to `{{ payload.ref }}`: 17 18{% for commit in payload.commits %} 19- `{{ commit.id | slice: 0, 7 }}` {{ commit.message }} {{ commit.author.name }} 20{% endfor %} 21 22Summarize what changed across these commits and whether any follow-up is warranted (e.g. deployment, documentation update, or review). 23{% endif %} 24 25{% if headers["x-github-event"] == "pull_request" %} 26Pull request **{{ payload.action }}**: [#{{ payload.pull_request.number }} {{ payload.pull_request.title }}]({{ payload.pull_request.html_url }}) 27 28- Opened by: **{{ payload.pull_request.user.login }}** 29- Merging `{{ payload.pull_request.head.ref }}` `{{ payload.pull_request.base.ref }}` 30- Status: {{ payload.pull_request.state }}{% if payload.pull_request.draft %} (draft){% endif %} 31 32{{ payload.pull_request.body }} 33 34Summarize the intent of this pull request and note any action required based on its current state. 35{% endif %} 36 37{% if headers["x-github-event"] == "issues" %} 38Issue **{{ payload.action }}**: [#{{ payload.issue.number }} {{ payload.issue.title }}]({{ payload.issue.html_url }}) 39 40- Opened by: **{{ payload.issue.user.login }}** 41- Labels: {% for label in payload.issue.labels %}{{ label.name }}{% unless forloop.last %}, {% endunless %}{% endfor %} 42 43{{ payload.issue.body }} 44 45Summarize this issue and determine whether any immediate action or response is needed. 46{% endif %} 47 48{% if headers["x-github-event"] == "pull_request_review" %} 49**{{ payload.review.user.login }}** submitted a **{{ payload.review.state }}** review on [#{{ payload.pull_request.number }} {{ payload.pull_request.title }}]({{ payload.pull_request.html_url }}). 50 51{{ payload.review.body }} 52 53Note the outcome of this review and whether the pull request is now ready to merge, needs further changes, or requires discussion. 54{% endif %}