Skip to content

The Action

SHEET
C4
REV
flowfig 0.8.4
DATE
2026-10-06

The GitHub Action runs verify on every figure in a pull request. For each SVG that the PR changes, it comments the old image, the new image and the spec changes. It also names each figure whose linked code the PR changes.

.github/workflows/figures.yml
name: figures
on: pull_request
jobs:
figures:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # the Action reads the old figure from the base commit
- uses: actions/setup-node@v4
with:
node-version: 22
- uses: iamalvisng/flowfig@v0.9.0
with:
figures: 'docs/**/*.svg' # default **/*.svg
Input What it does Default
figures A glob for the SVGs to check. Only an SVG with a flowfig spec inside counts. **/*.svg
comment Post one comment on the pull request with the diagram diff and the verify faults. true

The Action posts one comment per pull request. On each push, it updates that comment. On a pull request from a fork, the token is read-only, so the Action posts no comment. A verify error still fails the job.

This is the comment body for a pull request that renames getCached to getEntry and renders the figure again. It is a real run of action/comment.sh:

comment
<!-- flowfig -->
## flowfig
### `docs/cached-request.svg`
| before | after |
|---|---|
| ![before](https://raw.githubusercontent.com/iamalvisng/flowfig/609f7bfd7b504e6ed6351fc6f4e08768775760aa/docs/cached-request.svg) | ![after](https://raw.githubusercontent.com/iamalvisng/flowfig/1ba227812ee1a965de3bac267f1b603201e1e5f2/docs/cached-request.svg) |
- box changed: `cache` (source "examples/shop/cache.ts#getCached" -> "examples/shop/cache.ts#getEntry")
### Linked code changed
- this PR changes `examples/shop/api.ts`, linked from `docs/cached-request.svg`. Review the figure.
- this PR changes `examples/shop/cache.ts`, linked from `docs/cached-request.svg`. Review the figure.
### verify
- docs/cached-request.svg: 3 of 3 boxes defined; edges: 2 found, 0 not found, 0 unsure, 1 not checked