GitHub Action that runs designlang on every pull request, diffs the extracted design tokens against a committed baseline, annotates each changed token on the PR, and fails the job on drift.
name: Design Regression Guard
on:
pull_request:
paths:
- 'src/**'
- 'app/**'
- 'tailwind.config.*'
jobs:
design-diff:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with: { node-version: '22' }
- uses: Manavarya09/design-extract/github-action@v13.3.2
with:
url: https://preview-${{ github.event.number }}.yoursite.dev
baseline: ./design-tokens.baseline.jsonPin to a release tag. The action installs the designlang version it was tagged with, so a gate on @v13.3.2 never changes behaviour under you.
| Name | Required | Default | Description |
|---|---|---|---|
url |
✅ | — | URL to extract from. Typically a PR preview deploy. |
baseline |
✅ | — | Path to the committed baseline tokens file. |
comment |
true |
Post a PR comment with the diff. | |
fail-on-change |
true |
Fail the job if any token changed. Set false to report without gating. |
|
full |
false |
Pass --full to designlang. |
|
extra-args |
— | Extra CLI args. |
changed—true/falsechanged-count— number of changed tokensdiff-path— path to the generated diff markdownversion— the designlang version that ran
A failed job always says which of these it was, so a flaky preview deploy is never mistaken for a design regression:
| designlang exit | Meaning |
|---|---|
0 |
Extracted; compared against the baseline |
1 |
Drift over threshold (designlang drift / ci / lint) |
2 |
Extraction failed: page error, bad input, no browser |
3 |
Navigation timeout: retryable, the design was not checked |
The action's own "Fail on change" step exits 1 when tokens changed.
fail-on-change now defaults to true. Pass fail-on-change: false to keep report-only behaviour.