Skip to main content

Check pull requests with GitHub Actions

The preset AI GitHub Action checks the files each pull request changes. It runs in one of two modes.

ModeWhat it checksWhat you need
GenericNative HTML form elements, hardcoded Tailwind colors, arbitrary spacing, and AI-slop markers. The same checks for every team.Only the workflow file.
Your design systemEverything above, plus your design system's own rules: forbidden primitives, token usage, and pattern compliance.A Standard API key and your design system's id.

In a workflow file, the Action is preset-ai/compliance-check@v1. The GitHub page in preset AI shows both workflows, with your design system's id already filled in.

Check against your design system

  1. Create a Standard API key on the API page. Standard is the default when you create a key.
  2. In your repository on GitHub, add the key as an Actions secret named PRESET_API_KEY.
  3. Add this workflow as .github/workflows/preset-check.yml, with your design system's id in place of YOUR_DESIGN_SYSTEM_ID:
name: Design System Check
on: [pull_request]

permissions:
  contents: read
  pull-requests: write

jobs:
  preset:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: preset-ai/compliance-check@v1
        with:
          github-token: ${{ secrets.GITHUB_TOKEN }}
          # Forks and Dependabot can't read secrets. The Action detects this itself and runs the generic checks for those PRs.
          design-system-id: 'YOUR_DESIGN_SYSTEM_ID'
          preset-api-key: ${{ secrets.PRESET_API_KEY }}

On the next pull request, the check's log names the design system it is checking against, and violations show up as annotations on the changed lines.

Pull requests from forks and from Dependabot can't read repository secrets. The Action detects this on its own and runs the generic checks for those, and says so in the run log. (It can't post its pull request comment there: GitHub gives those runs a read-only token.) On every other pull request, a missing or misnamed PRESET_API_KEY fails the check instead of quietly dropping to the generic checks.

When the check fails

The check fails when it finds errors. It also fails when it could not check your rules at all:

  • The key belongs to a different design system. The check fails instead of reporting results against rules you didn't name. Use a key created for the design system in design-system-id.
  • preset AI can't be reached, or the key is rejected. The check fails. It never falls back to the generic checks, because a run that couldn't check your rules isn't a pass.
  • None of your rules applied to a changed file. The check fails by default. See What an "unchecked" validation result means.

FAQ

Can the Action sign in with GitHub instead of an API key? Not on its own yet. Signing in through the preset AI GitHub App can read your design system, but it can't run checks unless checking is turned on for your installation, and there is no setting for that in preset AI today. Use an API key.

I already use supabase-url and supabase-key. Do I need to change anything? Those inputs still work, with a warning on every run, but they can't read a private design system, which is the default. Remove both and add preset-api-key as above.

Was this page helpful?

Last reviewed by @jschuyler
All systems operationalDocsDevelopersPlatformPricing
PrivacyTerms© 2026 fndd, LLC