Skip to main content
The GitHub integration enables GitOps workflows, allowing you to store stack configurations in Git and maintain a full audit trail of infrastructure changes.

Overview

Connecting GitHub to Ankra enables:
  • Configuration Storage: Store Helm values and manifests in your repository
  • Version Control: Track all infrastructure changes with Git history
  • GitOps Workflows: Sync changes between Ankra and your repository
  • Audit Trail: Full history of who changed what and when
  • Collaboration: Use pull requests and code review for infrastructure changes

Connecting GitHub

1

Navigate to Cluster Settings

Go to your cluster and click SettingsRepository tab.
2

Connect GitHub

Click Connect GitHub. You’ll be redirected to GitHub to authorize the Ankra GitHub App.
3

Authorize Access

Review the permissions requested:
  • Read access to metadata
  • Read and write access to repository contents
Click Authorize to grant access.
4

Select Repository

Choose an existing repository or create a new one. Ankra will create a clusters/ folder in this repository to store your configuration.
5

Configure Sync

Choose your sync settings:
  • Branch: Which branch to sync with (default: main)
  • Auto-sync: Whether to automatically sync changes

Repository Structure

When connected, Ankra creates the following structure in your repository:

Files Explained


Sync Behavior

Ankra → GitHub

When you make changes in Ankra:
  1. Changes are saved to the platform
  2. Configuration is exported to the connected repository
  3. A commit is created with the changes
  4. You can see the commit in GitHub history

GitHub → Ankra

When you make changes in GitHub:
  1. Push changes to the configured branch
  2. Ankra detects the changes
  3. Configuration is imported and validated
  4. Changes are applied to your cluster

Using GitOps

Making Changes via Git

1

Clone the Repository

2

Edit Configuration

Modify values files or manifests:
3

Commit and Push

4

Sync in Ankra

Navigate to your cluster’s GitOps page and click Sync to pull the changes, or wait for auto-sync if enabled.

Pull Request Workflow

For production environments, use pull requests:
  1. Create a feature branch
  2. Make configuration changes
  3. Open a pull request
  4. Review changes with your team
  5. Merge to trigger sync

Ankra AI on Pull Requests

The Ankra GitHub App can also take part in the pull requests of every repository it is installed on. The capabilities are switched on per installation under AISettingsConnectionsSource control & AI reviewGitHub, and each can be overridden for an individual repository with a repository rule. AI code review is the canonical guide to those switches: what each one does, how repository rules layer over the installation-wide defaults, which model a review runs on, what the review posts, and when one is skipped. This page covers what is specific to GitHub.

Ask Ankra in a Comment

Mention @ankraai anywhere in a pull request comment or review comment, and Ankra AI replies on the pull request with the diff and the pull request’s metadata as its context:
The mention is matched case-insensitively and can sit anywhere in the comment. Ankra reacts to your comment with 👀 as soon as it picks the mention up, so you can see it is working while the answer is being written, and the answer then arrives as a new comment on the pull request, posted by ankra-platform[bot]. A mention always gets an answer while Mention replies is on: it is not subject to the draft, target-branch, and daily-budget rules that gate automatic reviews, and it does not start a new automatic review. How far the answer goes depends on the integration’s AI mode:
  • Ask (the default) - the reply is read-only. Ankra explains, reviews, and points out problems in the diff, but changes nothing; asked to act, it says the conversation is read-only and points you to the portal.
  • Agent - when the fix is clear (a failing pipeline, a broken manifest, a small defect visible in the diff), the reply can propose a concrete, ready-to-apply fix: the root cause, the exact file changes as code blocks, and an offer to open the fix as a pull request. Ankra still does not run code or execute platform actions from the comment thread.
Only comments written by people trigger a reply. Comments from bots (including Ankra’s own review and reply comments) and comments on plain issues are ignored, and Ankra reads the first 4,000 characters of the comment.

Merge when green

Not yet available. The capability that gates merge-when-green has no control in the portal, the CLI, or the API today, so it is off for every organisation and every request below is refused with that reason. The mechanism described here is built and this is what it will do; nothing merges until the switch ships.
Mention @ankraai merge when green in a pull request comment and Ankra records the request instead of answering it as an ordinary mention - a plain question containing the phrase, or the phrase negated (“please do not merge when green”), is left to the ordinary reply lane. The same request is also available by asking Ankra AI in chat (Agent mode, with a confirmation card) and over the API; all three converge on the same evaluation. The pull request merges (squash) the moment every one of these holds, evaluated fresh about every 30 seconds and the instant the pipeline run concludes, whichever comes first:
  • Merge when green is on for the binding, and its AI mode is Agent - in Ask mode, or with the switch off, the request is refused and says which.
  • The requester’s GitHub login is linked to a member of your Ankra organisation.
  • The pull request’s head is not a fork.
  • The newest Ankra Pipelines run for the head concluded successfully, and its gate step, if the definition declares one, passed.
  • The run executed under plainly approved authority - one that fell back to an earlier approval, or none, is refused rather than merged under it.
  • Ankra’s own AI review has not requested changes on that exact commit.
  • No human reviewer’s most recent review is Changes requested - unlike the AI review’s check above, this one is not scoped to the current commit: a changes-requested left on an earlier push still blocks until the same reviewer clears it with a later review.
The request expires 24 hours after it is made, and a new push to the pull request invalidates it - both post a note to the pull request. Every refusal is posted once, naming the exact condition that failed. This works on GitHub only today: the same request against a GitLab or Bitbucket Cloud pull request is accepted and then refused, because neither provider adapter reports the capability to merge yet.

Turning It On

1

Open the GitHub integration

Go to AISettingsConnectionsSource control & AI review and find the GitHub installation. Each installation has its own switches and AI mode.
2

Choose the installation-wide switches

On the All repositories row, turn on AI review, Mention replies and PR previews as needed. They apply to every repository the installation covers.
3

Add repository rules for exceptions

Add a rule for a repository to give it its own switches. A rule replaces the installation-wide switches for that repository; remove the rule and the repository follows them again.
If the app was installed before the Pull requests permission was added to it, GitHub shows a review updated permissions prompt on the installation. An owner has to approve it before Ankra can read pull requests and post comments - see Permission Errors.
For the review model, the per-pull-request review cap, draft handling, and your organisation’s review instructions, see AI code review. Related repositories sits at the bottom of each installation’s panel and is GitHub-only, because the cross-repository search runs on GitHub code search. Use it to tell a review that two repositories belong together when nothing in your deploy already says so - a client and the API it calls, or a shared library and the service that consumes it. Both are picked from drop-downs listing the repositories that installation can reach, since the review reads them with that installation’s token. See Relating two repositories directly.

A Mention Gets No Reply

  • Mention replies is off for the installation, or a repository rule for that repository has it off. A rule overrides the installation-wide switch, so check both.
  • The comment does not contain @ankraai. Mentioning the app’s own login, @ankra-platform, is not enough.
  • The comment was posted by a bot, or on an issue rather than a pull request.
  • Ankra reacted with 👀 but never answered: the reply failed on Ankra’s side, for example because the AI provider did not answer. Nothing is posted in that case; mention @ankraai again to retry.
  • No 👀 appeared at all: the mention never reached Ankra, so check the switches and the wording above before retrying.

Viewing Git History

In Ankra

Navigate to your cluster’s GitOps page to see:
  • Last sync timestamp
  • Recent commits affecting this cluster
  • Sync status and any errors

In GitHub

View the full commit history in your repository to see:
  • All configuration changes over time
  • Who made each change
  • Commit messages explaining changes

Managing Access

Repository Permissions

The Ankra GitHub App requests:
Contents and Pull requests are required for the application setup flow (Dockerfile, manifests, and CI/CD pipeline generation). Workflows is required only when the setup pull request commits a .github/workflows file: GitHub treats that path as protected, so it needs the dedicated permission in addition to Contents. Grant it anyway if you may ever ask for a generated workflow.
Secrets is required for Application CI/CD. Ankra writes ANKRA_REGISTRY_USERNAME and ANKRA_REGISTRY_PASSWORD as encrypted Actions secrets so the generated workflow can publish to the organisation’s private registry. Approve it under Settings → Applications → Installed GitHub Apps → Ankra → Configure.

Revoking Access

To disconnect GitHub:
  1. Go to cluster SettingsRepository
  2. Click Disconnect
To revoke the GitHub App entirely:
  1. Go to GitHub Settings → Applications → Installed GitHub Apps
  2. Find Ankra and click Configure, then Uninstall (or adjust which repositories it can access)

Troubleshooting

Sync Failures

If sync fails, check:
  1. Repository Access: Ensure the Ankra app still has access to the repository
  2. Branch Exists: Verify the configured branch exists
  3. Valid YAML: Ensure all configuration files are valid YAML
  4. Conflicts: Resolve any merge conflicts in the repository

Permission Errors

If you see permission errors:
  1. Go to GitHub Settings → Applications → Installed GitHub Apps
  2. Find Ankra and click Configure
  3. Ensure the repository is in the “Selected repositories” list
  4. If GitHub shows a review updated permissions prompt, approve it. New permissions added to the Ankra App (such as Pull requests or Workflows) are not granted to existing installations until an owner re-approves them.
HTTP 403 - Resource not accessible by integration on the first write of an application setup means the installation cannot write to that repository at all - it is not a Workflows problem. Either the repository is not among the repositories the installation was granted (a repository created after the App was installed is not covered unless the installation was granted all repositories), or Contents (read/write) or Pull requests (read/write) is missing, or an updated permission set is still awaiting approval. Add the repository and approve any pending permissions under Settings → Applications → Installed GitHub Apps → Ankra → Configure for a user account, or Organization settings → GitHub Apps → Ankra → Configure for an organisation, then re-run setup. Public-repository reads succeed with such a token, which is why repository analysis can complete and only the write fails.A genuinely missing Workflows (read/write) permission reads differently: GitHub answers with its own body, refusing to allow a GitHub App to create or update workflow … without 'workflows' permission (422 on the Git Data API, 403 on the Contents API), and Ankra’s message names Workflows explicitly. It can only happen when the setup pull request actually commits a .github/workflows file - which, since Ankra Pipelines, is no longer the default.

Out of Sync

If Ankra and GitHub are out of sync:
  1. Navigate to the cluster’s GitOps page
  2. Click Force Sync to re-sync from the repository
  3. Review any conflicts and resolve them

Best Practices

Use Protected Branches: Require pull request reviews for the main branch to ensure all changes are reviewed.
Meaningful Commits: Write clear commit messages that explain why changes were made.
Separate Repositories: Use different repositories for different environments (dev, staging, prod).
Secret Management: Don’t store secrets in Git. Use Kubernetes Secrets or external secret management.

CI/CD Integration

Integrate with CI/CD pipelines:

GitHub Actions Example

Deployment Pipeline


Still have questions? Join our Slack community and we’ll help out.