{"id":50030006,"url":"https://github.com/bubustack/github-webhook-impulse","last_synced_at":"2026-05-20T19:51:30.640Z","repository":{"id":352192450,"uuid":"1148068594","full_name":"bubustack/github-webhook-impulse","owner":"bubustack","description":"GitHub webhook Impulse for bobrapet — triggers StoryRuns on push, PR, issue, and other GitHub events.","archived":false,"fork":false,"pushed_at":"2026-05-02T07:11:23.000Z","size":84,"stargazers_count":0,"open_issues_count":3,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-02T09:19:08.116Z","etag":null,"topics":["bubustack","github","go","impulse","kubernetes","trigger","webhook"],"latest_commit_sha":null,"homepage":"https://bubustack.io/","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bubustack.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":"SUPPORT.md","governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":["bubustack"]}},"created_at":"2026-02-02T14:42:22.000Z","updated_at":"2026-04-19T18:55:35.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/bubustack/github-webhook-impulse","commit_stats":null,"previous_names":["bubustack/github-webhook-impulse"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/bubustack/github-webhook-impulse","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bubustack%2Fgithub-webhook-impulse","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bubustack%2Fgithub-webhook-impulse/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bubustack%2Fgithub-webhook-impulse/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bubustack%2Fgithub-webhook-impulse/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bubustack","download_url":"https://codeload.github.com/bubustack/github-webhook-impulse/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bubustack%2Fgithub-webhook-impulse/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33273401,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-20T15:12:43.734Z","status":"ssl_error","status_checked_at":"2026-05-20T15:12:42.300Z","response_time":356,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bubustack","github","go","impulse","kubernetes","trigger","webhook"],"created_at":"2026-05-20T19:51:29.862Z","updated_at":"2026-05-20T19:51:30.634Z","avatar_url":"https://github.com/bubustack.png","language":"Go","funding_links":["https://github.com/sponsors/bubustack"],"categories":[],"sub_categories":[],"readme":"# 🐙 GitHub Webhook Impulse\n\nA BubuStack Impulse that submits durable `StoryTrigger` requests from GitHub webhook events.\n\n## 🌟 Highlights\n\n- **HMAC-SHA256 signature validation** - Secure webhook verification\n- **Event filtering** - Filter by event type, action, repository, branch\n- **Smart session keys** - Automatic session keying by PR/issue/commit\n- **Policy-based routing** - Route different events to different Stories\n- **End event detection** - Graceful session cleanup on PR close/merge\n\n## 🚀 Quick Start\n\n1. Install the ImpulseTemplate:\n\n```bash\nkubectl apply -f Impulse.yaml\n```\n\n2. Create an Impulse instance:\n\n```yaml\napiVersion: bubustack.io/v1alpha1\nkind: Impulse\nmetadata:\n  name: my-github-webhook\n  namespace: default\nspec:\n  templateRef:\n    name: github-webhook-impulse\n  \n  storyRef:\n    name: my-github-story\n  \n  secrets:\n    webhookSecret:\n      name: github-webhook-secret\n  \n  with:\n    path: /webhook\n    validateSignature: true\n    eventsAllowlist:\n      - pull_request\n      - issues\n    actionsAllowlist:\n      - opened\n      - closed\n      - labeled\n```\n\n3. Create the webhook secret:\n\n```bash\nkubectl create secret generic github-webhook-secret \\\n  --from-literal=WEBHOOK_SECRET=your-github-webhook-secret\n```\n\n4. Configure the webhook in GitHub:\n   - Go to your repository → Settings → Webhooks → Add webhook\n   - Payload URL: `https://your-ingress/webhook`\n   - Content type: `application/json`\n   - Secret: Same as `WEBHOOK_SECRET`\n   - Events: Select events you want to receive\n\n## ⚙️ Configuration (`Impulse.spec.with`)\n\n### Event Filtering\n\n```yaml\nwith:\n  # Only accept these event types\n  eventsAllowlist:\n    - pull_request\n    - push\n    - issues\n  \n  # Only accept these actions\n  actionsAllowlist:\n    - opened\n    - synchronize\n    - closed\n  \n  # Only accept from these repositories\n  repositoriesAllowlist:\n    - owner/repo1\n    - owner/repo2\n  \n  # Only accept these branches (supports globs)\n  branchesAllowlist:\n    - main\n    - release/*\n```\n\n### Session Key Strategies\n\n```yaml\nwith:\n  # auto: Smart detection based on event type (default)\n  # - PR events → repo-pr-123\n  # - Issue events → repo-issue-456\n  # - Push events → repo-refs/heads/main\n  sessionKeyStrategy: auto\n  \n  # delivery: Use unique X-GitHub-Delivery header\n  sessionKeyStrategy: delivery\n  \n  # custom: evaluate a template expression\n  # available variables: .event, .action, .deliveryId, .payload, .repository\n  sessionKeyStrategy: custom\n  sessionKeyExpression: 'printf \"%s-pr-%v\" .repository.full_name .payload.pull_request.number'\n```\n\n### Policy-Based Routing\n\nRoute different events to different Stories:\n\n```yaml\nwith:\n  policies:\n    - name: pr-review\n      events:\n        - pull_request\n      actions:\n        - opened\n        - synchronize\n      storyName: pr-review-story\n    \n    - name: issue-triage\n      events:\n        - issues\n      actions:\n        - opened\n      storyName: issue-triage-story\n    \n    - name: release-notify\n      events:\n        - release\n      actions:\n        - published\n      storyName: release-notification-story\n```\n\n### Session Lifecycle\n\n```yaml\nwith:\n  # Events that start a new session\n  startEvents:\n    - \"pull_request:opened\"\n  \n  # Events that end a session (calls StoryDispatcher.Stop)\n  endEvents:\n    - \"pull_request:closed\"\n    - \"pull_request:merged\"\n```\n\n## 📥 Story Inputs\n\nThe impulse provides structured inputs to your Story:\n\n```yaml\n# Common fields (all events)\nevent: \"pull_request\"\naction: \"opened\"\ndeliveryId: \"abc123...\"\nrepository: \"owner/repo\"\nsender: \"username\"\n\n# PR-specific fields\npullRequest:\n  number: 123\n  title: \"Add feature X\"\n  state: \"open\"\n  htmlUrl: \"https://github.com/...\"\n  head:\n    ref: \"feature-branch\"\n    sha: \"abc123...\"\n  base:\n    ref: \"main\"\n    sha: \"def456...\"\n  user: \"author\"\n  draft: false\n  merged: false\n\n# Issue-specific fields\nissue:\n  number: 456\n  title: \"Bug report\"\n  state: \"open\"\n  labels: [\"bug\", \"priority-high\"]\n\n# Comment fields (issue_comment)\ncomment:\n  id: 789\n  body: \"This is a comment\"\n  user: \"commenter\"\n\n# Push-specific fields\npush:\n  ref: \"refs/heads/main\"\n  before: \"abc123...\"\n  after: \"def456...\"\n  commits: [...]\n  pusher: \"username\"\n```\n\n## 📘 Example Stories\n\n### PR Review Assistant\n\n```yaml\napiVersion: bubustack.io/v1alpha1\nkind: Story\nmetadata:\n  name: pr-review-assistant\nspec:\n  pattern: batch\n  \n  steps:\n    - name: fetch-diff\n      ref:\n        name: http-request\n      with:\n        url: \"https://api.github.com/repos/{{ inputs.repository }}/pulls/{{ inputs.pullRequest.number }}\"\n        headers:\n          Accept: \"application/vnd.github.v3.diff\"\n    \n    - name: review\n      needs: [fetch-diff]\n      ref:\n        name: ai-reviewer\n      with:\n        code: \"{{ steps['fetch-diff'].output.body }}\"\n    \n    - name: post-comment\n      needs: [review]\n      ref:\n        name: github-mcp\n      with:\n        action: callTool\n        tool: create_issue_comment\n        arguments:\n          owner: \"{{ inputs.repository | split('/') | first }}\"\n          repo: \"{{ inputs.repository | split('/') | last }}\"\n          issue_number: \"{{ inputs.pullRequest.number }}\"\n          body: \"{{ steps['review'].output.text }}\"\n```\n\n### Issue Triage Bot\n\n```yaml\napiVersion: bubustack.io/v1alpha1\nkind: Story\nmetadata:\n  name: issue-triage-bot\nspec:\n  pattern: batch\n  \n  steps:\n    - name: analyze\n      ref:\n        name: openai-chat\n      with:\n        userPrompt: |\n          Analyze this GitHub issue and suggest:\n          1. Priority (P0-P3)\n          2. Labels (bug, feature, docs, etc.)\n          3. Suggested assignee team\n          \n          Title: {{ inputs.issue.title }}\n          Body: {{ inputs.issue.body }}\n    \n    - name: apply-labels\n      needs: [analyze]\n      ref:\n        name: github-mcp\n      with:\n        action: callTool\n        tool: add_issue_labels\n        arguments:\n          owner: \"{{ inputs.repository | split('/') | first }}\"\n          repo: \"{{ inputs.repository | split('/') | last }}\"\n          issue_number: \"{{ inputs.issue.number }}\"\n          labels: \"{{ steps['analyze'].output.structured.labels }}\"\n```\n\n## 🩺 Health Endpoints\n\n- `GET :8081/health` - Liveness probe\n- `GET :8081/ready` - Readiness probe\n\n## 🧪 Local Development\n\n```bash\n# Build binary\nmake build\n\n# Run tests\nmake test\n\n# Build Docker image\nmake docker-build VERSION=v0.1.0\n\n# Push to registry\nmake docker-push VERSION=v0.1.0\n```\n\n\n## 🤝 Community \u0026 Support\n\n- [Contributing](./CONTRIBUTING.md)\n- [Support](./SUPPORT.md)\n- [Security Policy](./SECURITY.md)\n- [Code of Conduct](./CODE_OF_CONDUCT.md)\n- [Discord](https://discord.gg/dysrB7D8H6)\n\n## 📄 License\n\nCopyright 2025 BubuStack.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbubustack%2Fgithub-webhook-impulse","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbubustack%2Fgithub-webhook-impulse","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbubustack%2Fgithub-webhook-impulse/lists"}