---
title: "Create or update GitHub Actions integration"
method: PUT
path: "/api/v1/apps/{app_id}/integrations/github"
tags: ["Apps", "apps-github"]
---

# Create or update GitHub Actions integration

`PUT /api/v1/apps/{app_id}/integrations/github`

## Request

- Base URL: `https://cloud-api.phala.com`
- URL: `https://cloud-api.phala.com/api/v1/apps/{app_id}/integrations/github`
- Auth: OAuth 2
  - Authorization code
  - Token URL: `token`
- TypeScript: <https://skmtc.dev/phala/apis/phala-cloud-api/docs/api/v1/apps/:app_id/integrations/github/put.ts> (a function with typed inputs; its response is checked against the schema)

Trust one GitHub repository to deploy this app with OIDC. Replaces any previous configuration.

## Path parameters

- `app_id` string, required: Hex app identifier

## Request body

- GitHubIntegrationUpsert
  - `repository` string, required: GitHub repository in owner/repo format
  - `allowed_ref` string, nullable: Restrict to a specific git ref (e.g. refs/heads/main)
  - `allowed_workflow` string, nullable: Restrict to a specific GitHub workflow ref

## Response `200`

GitHub integration saved

- GitHubIntegrationResponse
  - `app_id` string, required
  - `repository` string, required
  - `allowed_ref` string, nullable
  - `allowed_workflow` string, nullable
  - `created_at` string, date-time, required

## Other responses

- `401`: Not authenticated
- `403`: No workspace access
- `404`: App not found
- `422`: Validation Error

## Changes

- **2026-11-07** `c71a8dc90391`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/phala/apis/phala-cloud-api/changes/api/v1/apps/:app_id/integrations/github/put.md)

---

[API](https://skmtc.dev/phala/apis/phala-cloud-api.md) - [All operations](https://skmtc.dev/phala/apis/phala-cloud-api/llms.txt) - [OpenAPI document](https://skmtc.dev/phala/apis/phala-cloud-api/revisions/c71a8dc90391?raw)
