> ## Documentation Index
> Fetch the complete documentation index at: https://docs.nika.sh/llms.txt
> Use this file to discover all available pages before exploring further.

# Nika × GitHub Actions

> Plan with receipts on every PR: the check verdict, the honest cost floor, required secrets and the DAG — before anyone runs anything.

[`supernovae-st/nika-action`](https://github.com/supernovae-st/nika-action)
turns every PR that touches a `.nika` into a reviewed plan: a sticky
comment with the `nika check` verdict, the cost floor (never a fake zero),
the models and secrets the change needs, its egress statics, and the DAG —
rendered natively by GitHub as mermaid.

```yaml theme={"system"}
name: nika
on:
  pull_request:
    paths: ['**.nika']  # fire only when a workflow file changes
permissions:
  contents: read
  pull-requests: write     # drop it and the body lands in the step summary
jobs:
  check:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
      # in real use, pin the action by full commit SHA with the release in a
      # comment, the form Dependabot/Renovate bump: @<sha> # v1.0.28
      - uses: supernovae-st/nika-action@v1
        with:
          workflow: flows/report.nika
          mode: check        # or: test → adds the offline mock golden lane
```

No workflow yet? `nika compile hello hello.nika` writes the offline
lesson. For `chain`, preview with `nika compile chain --json` and answer
its questions before naming a destination —
[authoring in 10 minutes](https://docs.nika.sh/integrations/quickstart.md).

## Already have CI? One line

The starter repo publishes a **reusable workflow** that wraps the action
with the same fork-safe posture — adopting the check in an existing repo
is a single `uses:` block:

```yaml theme={"system"}
jobs:
  nika:
    permissions:
      contents: read
      pull-requests: write
    uses: supernovae-st/nika-actions-starter/.github/workflows/nika-check.yml@main
    with:
      workflow: path/to/your.nika
```

Starting fresh instead? [`nika-actions-starter`](https://github.com/supernovae-st/nika-actions-starter)
is a template repo — **Use this template**, and the verdict lands on your
first PR with zero further wiring. Its own pull requests run the check
live, so you can read a real sticky comment before adopting anything.

## What lands on the PR

<video autoPlay muted loop playsInline controls poster="/images/posters/pr-check-comment.png" aria-label="A pull request adds a Nika workflow; nika-action posts a red sticky comment naming one finding, a second push fixes that line, and the same comment turns clean and draws the workflow's graph" alt="A pull request adds a Nika workflow; nika-action posts a red sticky comment naming one finding, a second push fixes that line, and the same comment turns clean and draws the workflow's graph">
  <source src="https://mintcdn.com/supernovae-acdf3706/3tG2rJOQxMP3h2LO/videos/pr-check-comment.webm?fit=max&auto=format&n=3tG2rJOQxMP3h2LO&q=85&s=0f770388e40f2c703bac41f9240d97a5" type="video/webm" />

  <source src="https://mintcdn.com/supernovae-acdf3706/3tG2rJOQxMP3h2LO/videos/pr-check-comment.mp4?fit=max&auto=format&n=3tG2rJOQxMP3h2LO&q=85&s=5b17ba380d43a09c255faa904fbed25c" type="video/mp4" />
</video>

**Every pull request gets a verdict.** The first push refers to a task that does not exist, and the comment names the finding (`NIKA-DAG-002`, *did you mean `assess`?*). The second push fixes that line, and the same comment turns clean and draws the graph. *Both comments are the action's own renderer run on `nika check --json` and `nika inspect` from nika 0.121.0; the pull request page is an illustration.*

> ✅ **nika check** — clean · `flows/report.nika` · 3 task(s) · 3 wave(s)
> 💰 \*\*cost floor ≥ $0.12** · ⚠ 1 unpriced task — never rendered as $0
> 🔐 **requires** — models: `ollama/qwen3.5:4b` · `openai/gpt-5.2` · secrets: `OPENAI_API_KEY`
> 🌊 **schedule** — 3 wave(s), max width 1
> 🗺 DAG *(collapsible mermaid)*

One comment per workflow file, upserted in place on every push — never
thread spam.

## The lanes — and the missing one

| lane | runs | secrets |
| - | - | - |
| `check` (default) | static analysis only, nothing executes | none |
| `test` | + `nika test` vs `<file>.golden.json` — mock provider, offline | none |
| ~~run~~ | **refused by design.** A `.nika` can declare `exec:` shell steps — executing PR content under a CI token is your decision to make explicitly, in your own workflow, never on fork-origin events | — |

## Security posture

* The engine download is **verified against the release's `SHA256SUMS`**
  before extraction.
* Fork PRs carry a read-only token: the comment degrades to the **step
  summary** automatically. Never wire any of this via `pull_request_target`
  with a checkout of the PR head.
* Pin the action itself by commit SHA — the marketplace norm.

## Honesty semantics

The comment's cost figure is a **floor** (`spend ≥ floor`); unpriced tasks
render as `unpriced` with their reason verbatim, never `$0`. When the DAG
has parallel waves the comment states the budget bound explicitly: a
mid-run `--max-cost-usd` stops *new* admissions, so the worst-case
overshoot is one full wave (`spend ≤ floor + W · c_max`). The full
semantics: [cost honesty](https://docs.nika.sh/guides/cost-honesty.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.