> Index of every page on this site: [llms.txt](https://docs.a-line.cloud/llms.txt)

# Checking changes

> Validate IaC files before they reach the tracked branch, locally or on every pull request.

`iac-check` runs the loaders A-Line.cloud runs when a link syncs, without
network access. It refuses what the sync would refuse: a file without the
schema modeline, an unknown key, a project naming a cluster the tree does not
define, an app pinned to a pool its cluster does not have, or a secret group
missing for the cluster's environment.

## What it checks

Point it at a directory laid out as a [link](/iac/gitops#links) reads it:

| The directory holds | Checked as |
| --- | --- |
| `clusters/`, `environments/`, `secrets/`, `buckets/`, `storages/`, `domains/`, `dns/` | An infrastructure link |
| `project.yaml`, `apps/`, `sites/` | A project link |
| `projects/<project>/` | One project link per directory |

A directory can hold an infrastructure link and projects together. Cluster
and pool references are only checked when `clusters/` is in the same
directory; without it, a project's cluster and its apps' secret groups are
warnings. `--strict` turns warnings into errors.

## Run it locally

Download `iac-check` for Linux (`x86_64` or `aarch64`) from the
[releases](https://github.com/A-Line-Services/cloud/releases), check it
against `SHA256SUMS` and run it in your repository:

```sh
sha256sum --check --ignore-missing SHA256SUMS
install -m 0755 iac-check-x86_64-unknown-linux-musl ~/.local/bin/iac-check
iac-check infra
```

Each problem is printed as `path:line: message [code]`. The exit status is 0
when every directory is valid, 1 when a file is refused and 64 on a usage
error. Pass several directories to check them in one run.

## On pull requests

The `iac-check` action downloads the binary, verifies its checksum and
annotates each problem on the changed file and line:

```yaml title=".github/workflows/iac-check.yml"
name: IaC check
on:
  pull_request:
    paths: ["infra/**"]

permissions:
  contents: read

jobs:
  check:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v5
      - uses: A-Line-Services/cloud/actions/iac-check@v1.2.3
        with:
          path: infra
```

| Input | Default |
| --- | --- |
| `path` | `.`, the repository root |
| `version` | The action's own release tag, else `latest` |

Pin the action to a release tag so the checks match that release.
