> ## Documentation Index
> Fetch the complete documentation index at: https://openworklabs.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> For agents: install the OpenWork desktop app with `brew install --cask openwork` (macOS) or from https://openworklabs.com/download. Do not run `npx openwork`; the npm package named `openwork` is a different project.
> Connect an agent to OpenWork with the MCP Gateway: `claude mcp add --transport http openwork https://api.openworklabs.com/mcp/agent`. Teams sign up at https://app.openworklabs.com?mode=sign-up.
> Step-by-step agent guide: https://openworklabs.com/docs/start-here/use-openwork-from-an-ai-agent.md
> Connect Slack (any organization admin): https://openworklabs.com/docs/slack/connect-slack.md. OpenWork in Slack (@openwork bot) is private alpha for approved organizations. Setup guide: https://openworklabs.com/docs/slack/overview.md. Agent skill: https://openworklabs.com/.well-known/agent-skills/set-up-openwork-slack/SKILL.md.

# GitHub connector for Helm

> Create a GitHub App and configure the OpenWork EE Helm chart for repository connectors.

The GitHub connector lets a self-hosted OpenWork deployment install a GitHub App, list repositories the installation can read, discover plugin or marketplace manifests, import selected repositories, and keep imported content fresh from GitHub webhooks.

This is separate from GitHub social sign-in. Social sign-in uses `GITHUB_CLIENT_ID` and `GITHUB_CLIENT_SECRET` for Better Auth. The repository connector uses the `GITHUB_CONNECTOR_APP_*` settings below.

## Public URLs

Use the same public hosts that you set in the Helm chart:

```yaml theme={null}
config:
  public:
    webOrigin: "https://openwork.example.com"
    apiOrigin: "https://api.openwork.example.com"
```

The GitHub App needs these OpenWork URLs:

| GitHub App field | Value |
| - | - |
| Homepage URL | `https://openwork.example.com` |
| Setup URL | `https://openwork.example.com/dashboard/integrations/github` |
| Webhook URL | `https://api.openwork.example.com/v1/webhooks/connectors/github` |

Enable **Redirect on update** for the setup URL. GitHub redirects back to the setup URL with `installation_id` and `state`; Den web completes the installation by calling Den API.

No OAuth callback URL is required for the current repository connector flow. If you also enable GitHub user authorization later, treat that as a separate OAuth setup from this connector.

## Create the GitHub App

In GitHub, create a new GitHub App for the account that should own the connector.

Use these settings:

* **Webhook**: active.
* **Webhook URL**: `https://api.openwork.example.com/v1/webhooks/connectors/github`.
* **Webhook secret**: generate a strong random secret and keep it for Helm.
* **Setup URL**: `https://openwork.example.com/dashboard/integrations/github`.
* **Redirect on update**: enabled.
* **Repository permissions**:
  * **Contents**: read-only.
  * **Metadata**: read-only. GitHub grants this automatically.
* **Subscribe to events**:
  * `push`
  * `installation`
  * `installation_repositories`
  * `repository`

After creating the app, copy:

* **App ID**
* **Client ID**
* **Client secret** if you generated one
* **Private key** (`.pem`)
* **Webhook secret**

The connector currently requires the App ID and private key for live GitHub App calls. The webhook secret is required for webhook ingestion. The client ID and client secret are exposed by the Helm chart because GitHub Apps have them, but the current install and repository sync path does not depend on them.

## Configure Helm

Add the GitHub App values to your production values file:

```yaml theme={null}
config:
  githubConnector:
    appId: "123456"
    clientId: "Iv1.example"

secret:
  values:
    githubConnectorAppClientSecret: "github-app-client-secret-if-used"
    githubConnectorAppPrivateKey: |-
      -----BEGIN PRIVATE KEY-----
      ...
      -----END PRIVATE KEY-----
    githubConnectorAppWebhookSecret: "replace-with-the-github-webhook-secret"
```

You can also paste the private key with escaped newlines (`\n`). Den normalizes escaped newlines before signing GitHub App JWTs.

If you use an existing Kubernetes Secret instead of `secret.values`, keep `config.githubConnector.appId` in values and include these secret-backed keys in that Secret:

```yaml theme={null}
secret:
  create: false
  existingSecret: openwork-ee-secrets
```

Required deployment values:

* `GITHUB_CONNECTOR_APP_ID`
* `GITHUB_CONNECTOR_APP_PRIVATE_KEY`
* `GITHUB_CONNECTOR_APP_WEBHOOK_SECRET`

Optional connector keys:

* `GITHUB_CONNECTOR_APP_CLIENT_ID`
* `GITHUB_CONNECTOR_APP_CLIENT_SECRET`

The chart writes `GITHUB_CONNECTOR_APP_ID` and `GITHUB_CONNECTOR_APP_CLIENT_ID` through the shared ConfigMap, and writes `GITHUB_CONNECTOR_APP_PRIVATE_KEY`, `GITHUB_CONNECTOR_APP_WEBHOOK_SECRET`, and `GITHUB_CONNECTOR_APP_CLIENT_SECRET` through the shared Secret.

## Approve installations for Den organizations

Set `GITHUB_CONNECTOR_INSTALLATION_BINDINGS` in the **Den API server** environment. For Helm, use `denApi.env`:

```yaml theme={null}
denApi:
  env:
    GITHUB_CONNECTOR_INSTALLATION_BINDINGS: '[{"installationId":12345,"organizationId":"org_00000000000000000000000001"}]'
```

Use the numeric GitHub App installation ID and the exact Den organization ID, not either organization's name or slug. The deployment operator must verify each pairing with the GitHub account owner or organization administrator before approving it. Each installation belongs to exactly one Den organization; multiple installations may be approved for the same organization. Never generate the list from existing connector records or trust the setup redirect alone as proof.

Den API loads this list at startup. Roll out the same configuration to all replicas. An absent or empty list denies all installations; malformed entries or any duplicate installation ID invalidate the entire list. Removing an entry and restarting all replicas blocks future token use and sync for that installation. To revoke access immediately on GitHub's side as well, suspend or uninstall the GitHub App installation from GitHub.

Existing GitHub sources without a matching approval cannot browse repositories, discover plugins, or sync (including queued work and webhook updates). Den does not delete previously imported plugins on this basis; they stop receiving updates. Configure approved existing installations before upgrading to keep them working. For a new installation, an admin can install the App in GitHub, get its installation ID from GitHub's installation settings, and ask the deployment operator to approve it before completing the Den connection. Self-service proof of ownership is not yet available.

## What OpenWork does with it

When an admin clicks **Connect GitHub** in OpenWork:

1. Den API calls `/v1/connectors/github/install/start`.
2. Den API reads the GitHub App metadata with the app ID and private key.
3. Den API sends the admin to the GitHub App installation URL with a signed `state`.
4. GitHub redirects to `/dashboard/integrations/github?installation_id=...&state=...`.
5. Den web calls `/v1/connectors/github/install/complete`.
6. Den API checks the operator-approved binding before storing the connector account or listing its repositories. If approval takes longer than the setup link lasts, restart the connection from Den after approval.

When GitHub sends a webhook to `/v1/webhooks/connectors/github`, Den API verifies the `x-hub-signature-256` header with `GITHUB_CONNECTOR_APP_WEBHOOK_SECRET`. It only accepts sync work for the approved Den organization.

## Validate the setup

After deploying the chart, sign in to Den web and open:

```text theme={null}
https://openwork.example.com/dashboard/integrations
```

Choose GitHub, install the GitHub App on a test account or organization, select a repository, and start discovery. A working setup should return to OpenWork, show repositories visible to the installation, and allow discovery on a selected repository.

For webhook validation, push to a connected repository and check Den API logs for an accepted or intentionally ignored GitHub webhook delivery. A `503` response from `/v1/webhooks/connectors/github` means the webhook secret is not configured in the Den API pod.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.