LydianAI Open-source tooling

← All docs

Assurance-as-Code

Connecting a GitHub repository

Set up the GitHub App, configure a repository connector, and add .aac/repo.yml to link source code to requirements automatically.


Overview

The repository integration links your GitHub codebase to your AAC project’s compliance record. Once connected:

Prerequisites

Create the GitHub App

Register a new GitHub App under your GitHub account or organisation:

  1. Go to Settings → Developer settings → GitHub Apps → New GitHub App
  2. Set a name and homepage URL (your AAC deployment URL works)
  3. Set the webhook URL to: https://<your-deployment>/api/v1/integrations/github/webhook/<connector_id> (you will get the connector_id after step 4 — you can update this URL then)
  4. Set a webhook secret (keep this for the connector config below)

Required repository permissions:

PermissionLevel
Repository metadataRead
ContentsRead
ChecksWrite
Pull requestsRead

Subscribe to events: push, pull_request

  1. Save the App and note the App ID
  2. Generate a private key (PEM file) — download and keep it securely

Install the App on the target repository: App page → Install App → select the repository. Note the Installation ID from the URL after install (https://github.com/settings/installations/<installation_id>).

Configure the connector

In the AAC web console, go to Project → Settings → Repository Connectors → Add connector.

FieldValue
ProviderGitHub
NameAny label (e.g. main-repo)
OwnerGitHub user or organisation name
RepositoryRepository name
Default branchmain (or your default)
GitHub App IDFrom the App you created
Installation IDFrom the install URL
Private keyPaste the PEM content
Webhook secretThe secret you set when creating the App

Secrets are encrypted at rest and never returned by the API after submission — you cannot retrieve them; only replace them.

Click Test connection to verify the App can reach the repository before saving.

Add .aac/repo.yml to your repository

Commit a mapping file to your repository at the path .aac/repo.yml. This file tells the scanner what each piece of code implements.

Minimum structure:

version: 1

implementation_items:
  - id: brake_monitor
    path: src/brake/monitor.py
    language: python
    satisfies:
      - SSR-001          # requirement ID in your AAC project

source_references:
  - path: src/brake/monitor.py
    lines: 10-80
    implements:
      - brake_monitor

build_configurations:
  - id: ci-main
    workflow: github-actions
    build_ref: main

The satisfies values must match requirement IDs that already exist in your AAC project. The scanner creates the traceability link but does not create the requirement itself.

The scanner rejects the file if the YAML root is not an object, the version is unsupported, required fields are missing, or a referenced path does not exist in the scanned commit tree.

Trigger a manual scan

After saving the connector, trigger the first scan manually:

Check scan status:

GET /api/v1/projects/{project_id}/repo-connectors/{connector_id}/scans/{scan_id}

A completed scan creates or updates artefacts in your project. Check the project artefact list to see ImplementationItems and SourceCodeReferences.

Webhook setup

Update the webhook URL in your GitHub App settings to:

https://<your-deployment>/api/v1/integrations/github/webhook/<connector_id>

From this point, every push to the default branch and every opened or updated PR triggers a scan automatically. The webhook endpoint verifies the X-Hub-Signature-256 header before processing — invalid signatures are rejected with HTTP 401.

What gets created

Each scan creates or updates the following artefact types:

ArtefactSourceLinks to
ImplementationItemimplementation_items[] entrySoftwareRequirement or SoftwareSafetyRequirement via satisfies
SourceCodeReferencesource_references[] entryImplementationItem via implements
BuildConfigurationbuild_configurations[] entry

All repository-sourced artefacts include: connector ID, repository URL, file path, commit SHA, and branch. This metadata is what gates baseline generation — the tool requires that implementation and source-code references have connector and commit evidence before a release baseline can be created.