Skip to main content
Raigal connects to GitHub to create status checks when pull requests open, evaluate code changes with six diagnostic engines, and enforce branch protection.

Architecture

How this setup works:
  • Local AST processing: Rule evaluation and AST analysis run entirely inside your CI runner. Raigal Cloud does not clone or store your codebase.
  • Immediate pending check: When a pull request opens or receives new commits, the GitHub App instantly registers a "Raigal Quality Gate" check in in_progress status on the head commit.
  • Check run resolution: Once the CI runner posts scan metrics to /v1/runs, Raigal Cloud matches the commit SHA and updates the check run with a detailed markdown summary.
  • Branch protection enforcement: The "Raigal Quality Gate" check can be selected as a required status check in GitHub branch protection rules.
  • Automatic updates on merge or close: GitHub sends merge and close webhook events directly to the app, updating board cards without extra CI steps.
  • Safety timeout: If a CI job is cancelled or fails before running raigal ci, Raigal Cloud automatically cleans up orphaned pending check runs after 20 minutes to prevent PRs from being blocked indefinitely.

Setup: GitHub App and Actions

1

1. Install the GitHub App

  1. Open the Raigal Cloud GitHub App.
  2. Click Install.
  3. Choose your organization or personal account.
  4. Select all repositories or choose specific ones.
  5. Click Install & authorize.
2

2. Copy your organization token

  1. Sign in to your dashboard at app.raigal.dev.
  2. Open Settings.
  3. Under API Tokens, select Create new token.
  4. Name the token (e.g., ci-runner) and copy the generated key (rgl_live_...).
3

3. Add token to GitHub repository

  1. In your GitHub repository, open Settings > Secrets and variables > Actions.
  2. Click New repository secret.
  3. Set the name to RAIGAL_TOKEN and paste your key.
  4. Click Add secret.
If you prefer not to manage static tokens, add permissions: id-token: write to your workflow. Raigal Cloud validates the runner using GitHub OIDC directly.
4

4. Add the GitHub Actions workflow

Create .github/workflows/raigal.yml in your repository:
Because the GitHub App receives pull_request.closed events directly, you do not need an additional workflow to notify Raigal when PRs close.
5

5. Require status check in branch protection

  1. In your GitHub repository, open Settings > Branches (or Rules > Rulesets).
  2. Under Branch protection rules, edit the rule for your default branch (main).
  3. Check Require status checks to pass before merging.
  4. Search for and select Raigal Quality Gate.
  5. Save changes.

Three-state quality gate verdicts

GitHub Check Runs and pull request cards evaluate results into three clear states:

Standalone CI mode (without GitHub App)

If your organization policies prevent installing third-party GitHub Apps, you can run Raigal using GitHub Actions alone:
1

1. Configure secret

In Settings > Secrets and variables > Actions, add RAIGAL_TOKEN.
2

2. Add workflow

Add .github/workflows/raigal.yml using the workflow above. In standalone mode, the gate reports status as a standard Actions job.
3

3. Add close sync workflow (optional)

To update the board when PRs close without the GitHub App, add a lifecycle sync workflow:

Tracking PRs on the board

In Raigal Cloud, open your repository board:
  1. Pull requests column:
    • Passed: shows the quality score (e.g. 94/100), author, source branch, and target branch.
    • Blocked: shows blocker counts and failing rule categories.
  2. Inspection drawer:
    • Click a card to open its detail panel.
    • Review blocking findings with rule IDs, file paths, and line numbers.
    • Inspect diff statistics and unified diff preview.
    • Copy the git checkout command to inspect changes locally, or select Open on GitHub to jump directly to the pull request.

Troubleshooting