Skip to main content
The GitHub Actions job agent triggers workflow dispatch events to execute your deployments. This is ideal for teams already using GitHub Actions for CI/CD.

How It Works

  1. Ctrlplane creates a job and dispatches it to GitHub
  2. GitHub triggers your workflow with workflow_dispatch
  3. Your workflow fetches job context (version, environment, resource)
  4. Your workflow executes the deployment
  5. GitHub sends a workflow_run webhook event to Ctrlplane as the run progresses
  6. Ctrlplane automatically updates the job status (in progress, successful, failure, etc.)

Prerequisites

  • A GitHub App registered in your organization (see GitHub App Setup)
  • The GitHub App installed on the repositories you want to dispatch workflows to
  • A workflow file with workflow_dispatch trigger in each target repository
  • Ctrlplane’s workspace engine configured with the GitHub App credentials (see Server Configuration)

GitHub App Setup

Ctrlplane authenticates with GitHub using a GitHub App. The workspace engine generates a JWT from the App’s private key and exchanges it for a short-lived installation token to dispatch workflows.

Creating a GitHub App

  1. Go to GitHub → Settings → Developer settings → GitHub Apps → New GitHub App
  2. Fill in the required fields:
    • GitHub App name: e.g. ctrlplane-bot
    • Homepage URL: your Ctrlplane instance URL
  3. Under Webhook:
    • Webhook URL: https://<your-ctrlplane-domain>/api/github/webhook
    • Webhook secret: generate a strong secret (e.g. openssl rand -hex 32)
    • Subscribe to the Workflow runs event
  4. Under Permissions, grant the following Repository permissions:
    • Actions: Read and write (required to dispatch workflow events)
    • Contents: Read-only (required to access workflow files)
    • Metadata: Read-only (granted by default)
  5. Click Create GitHub App

Gathering Credentials

After creating the App, collect the following values:

Installing the App

  1. From the GitHub App settings page, click Install App in the left sidebar
  2. Choose the organization or account to install on
  3. Select the repositories the App should have access to
  4. Note the Installation ID — you can find it in the URL after installation: https://github.com/settings/installations/INSTALLATION_ID
You can also retrieve it via the GitHub API:

Server Configuration

The workspace engine (and the API server) need the GitHub App credentials to authenticate with the GitHub API. These are provided via environment variables.

Environment Variables

The workspace engine uses GITHUB_BOT_APP_ID and GITHUB_BOT_PRIVATE_KEY to generate JWTs for authenticating with the GitHub API and dispatching workflows. If either is missing, dispatching will fail with a GitHub bot not configured error. The API server uses GITHUB_WEBHOOK_SECRET to verify incoming workflow_run webhook events from GitHub. When configured, Ctrlplane automatically updates job status as workflows progress — no manual status reporting is needed in your workflow.

Helm Chart Configuration

When deploying with the Ctrlplane Helm chart, configure the GitHub App credentials in your values.yaml under global.integrations.github.bot:
All bot values support either inline strings or Kubernetes valueFrom references for secrets:
The full set of Helm values for the GitHub bot:

Docker / Manual Deployment

When running the workspace engine directly, pass the environment variables:

Configuration

Job Agent Setup

Create a job agent with type github-app:

Deployment Configuration

Configure the deployment to use GitHub Actions:

Finding Your Installation ID

The installation ID is the numeric ID assigned when the GitHub App is installed on an organization or user account. You can find it:
  1. From the URL: after installing the App, the URL will be https://github.com/settings/installations/INSTALLATION_ID
  2. From the API:
Look for the id field in the response.

Finding Your Workflow ID

Use the GitHub API to find your workflow ID:
The id field in each workflow object is the numeric workflow ID you need.

Workflow Setup

Create a workflow file in your repository:

Available Job Context

The get-job-inputs action provides these outputs:

Templating

You can use Go templates in your job agent config to dynamically configure workflows:

Status Reporting

When the GitHub App webhook is configured (see GitHub App Setup), Ctrlplane automatically receives workflow_run events from GitHub and updates job status without any extra steps in your workflow. The API server listens at /api/github/webhook and maps GitHub workflow run states to Ctrlplane job statuses: Ctrlplane matches the workflow run to a job by extracting the job ID from the workflow run name. The get-job-inputs action includes the job ID in the run name automatically.
For automatic status reporting to work, ensure:
  • The GitHub App webhook URL is set to https://<your-ctrlplane-domain>/api/github/webhook
  • The GITHUB_WEBHOOK_SECRET env var matches the secret configured in the GitHub App
  • The App is subscribed to Workflow runs events

Manual via API (Fallback)

If you are not using webhooks, you can manually report status from the workflow using the Ctrlplane API:

Example: Kubernetes Deployment

Troubleshooting

GitHub bot not configured error

The workspace engine cannot find the App credentials. Verify:
  • GITHUB_BOT_APP_ID is set and is a valid numeric ID
  • GITHUB_BOT_PRIVATE_KEY is set and contains the full PEM-encoded private key
  • If using Helm, check that global.integrations.github.bot.appId and global.integrations.github.bot.privateKey are set in your values

failed to get installation token error

The App credentials are set but the token exchange failed. Check:
  • The App ID matches the GitHub App you created
  • The private key has not been revoked or regenerated
  • The installation ID in your deployment config is correct
  • The GitHub App is still installed on the target organization/account

Workflow not triggered

  • Verify the workflow file has workflow_dispatch as a trigger
  • Ensure the ref in your config points to a branch where the workflow file exists
  • Check that the GitHub App has Actions: Read and write permission on the repository
  • Confirm the workflow ID is correct (use the API to verify)

Job status not updating automatically

  • Verify the GitHub App webhook URL is set to https://<your-ctrlplane-domain>/api/github/webhook
  • Ensure GITHUB_WEBHOOK_SECRET is set on the API server and matches the secret in GitHub App settings
  • Check that the App is subscribed to Workflow runs events
  • Confirm the API server is reachable from GitHub (not behind a firewall)

Authentication errors in the workflow

  • Ensure CTRLPLANE_API_KEY is set as a repository or organization secret in GitHub
  • Verify the API key has permissions to read jobs in your Ctrlplane workspace