Skip to content

GitHub Integration

GitHub API integration for issues and pull requests.

Configuration

json
{
  "credentials": {
    "github": {
      "token": "{{env.GITHUB_TOKEN}}"
    }
  }
}

Endpoints

Issues

MethodEndpointDescription
GET/integrations/github/repos/:owner/:repo/issuesList issues
GET/integrations/github/repos/:owner/:repo/issues/:numberGet issue
POST/integrations/github/repos/:owner/:repo/issuesCreate issue
PATCH/integrations/github/repos/:owner/:repo/issues/:numberUpdate issue

Pull Requests

MethodEndpointDescription
GET/integrations/github/repos/:owner/:repo/pullsList PRs
GET/integrations/github/repos/:owner/:repo/pulls/:numberGet PR
POST/integrations/github/repos/:owner/:repo/pullsCreate PR

Actions (for workflows)

getIssue

json
{
  "integration": "github",
  "action": "getIssue",
  "params": {
    "owner": "owner",
    "repo": "repo",
    "issueNumber": 123
  }
}

createIssue

json
{
  "integration": "github",
  "action": "createIssue",
  "params": {
    "owner": "owner",
    "repo": "repo",
    "title": "Bug report",
    "body": "Description...",
    "labels": ["bug"]
  }
}

listIssues

json
{
  "integration": "github",
  "action": "listIssues",
  "params": {
    "owner": "owner",
    "repo": "repo",
    "state": "open",
    "labels": "bug"
  }
}

createPullRequest

json
{
  "integration": "github",
  "action": "createPullRequest",
  "params": {
    "owner": "owner",
    "repo": "repo",
    "title": "Feature: Add login",
    "head": "feature-branch",
    "base": "main",
    "body": "Description..."
  }
}

Examples

List Issues

bash
curl http://localhost:3000/integrations/github/repos/owner/repo/issues \
  -H "Authorization: Bearer <token>"

Create Issue

bash
curl -X POST http://localhost:3000/integrations/github/repos/owner/repo/issues \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Bug: Login fails",
    "body": "Steps to reproduce...",
    "labels": ["bug", "priority-high"]
  }'

Webhook Receiver

Receive GitHub webhooks:

json
{
  "webhooks": [{
    "name": "github-events",
    "path": "/webhooks/github",
    "provider": "github",
    "secret": "&#123;&#123;env.GITHUB_WEBHOOK_SECRET&#125;&#125;",
    "actions": [{
      "type": "slack",
      "action": "sendMessage",
      "params": {
        "text": "GitHub: &#123;&#123;payload.action&#125;&#125; on &#123;&#123;payload.repository.name&#125;&#125;"
      }
    }]
  }]
}

Released under the ISC License.