---
title: CI
description: Check a project in CI and publish reports.
---

In CI, run [`pun check`](/docs/commands/check) without `--fix`, so it reports findings without editing files. It exits 0 when clean, 1 on findings, and 2 when Pun could not run. Warnings fail the run only with `--deny-warnings` or when they exceed `--max-warnings`.

## GitHub Actions

Add this step after your PHP setup and `composer install`, which installs Pun from `require-dev`:

```yaml .github/workflows/style.yml
- name: Check
  run: vendor/bin/pun check
```

When `GITHUB_ACTIONS=true`, Pun adds annotations to its default output. `pun check --format=github` prints only annotations.

## Write a report file

```bash
pun format --test --output-to-file=pun.xml --output-format=checkstyle
```

`--output-format` also accepts `junit`, `gitlab`, `json`, `xml`, and `txt`.

## Add a pre-commit hook

```bash
pun check --staged
```

`--staged` selects files with staged changes, but Pun checks their working-tree contents, including unstaged edits.
