Skip to content

GitHub Actions

When a pull request changes a map, the schemap Action checks it and comments on the pull request with:

  • a preview image of the map,
  • a link to the interactive map,
  • what changed: nodes, edges, groups, lanes, phases and views added, removed or edited, and which fields,
  • problems: validation errors (the check fails), warnings, and a map.svg that no longer matches its map.json.

There is one comment per pull request, and it updates on every push.

Reviewers see the change, not the JSON. Forty edited lines of JSON are hard to review. A picture and a line like “+1 node · −1 edge · shop-api renamed to orders-api” take seconds.

Architecture changes get noticed. A new service, a dropped dependency or a new call into the database shows up in review instead of hiding in the code.

Maps stay correct. An invalid map fails the check like a failing test, so it can’t be merged. Because deliver is deterministic, a committed map.svg that differs from a fresh render is flagged, so the image in your README never falls behind its source.

Docs stay alive. Maps change in the same pull request as the code they describe, and every change is reviewed. Architecture docs usually rot because nothing checks them; this checks them.

Agent changes stay visible. When a coding agent updates a map as part of its work, the reviewer sees in plain terms what it changed.

Add a workflow to the repository that holds your maps:

.github/workflows/schemap.yml
name: schemap
on:
pull_request:
paths: [".schemap/**"]
permissions:
contents: read
pull-requests: write
jobs:
maps:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: decimozs/schemap/action@v1

@v1 follows the latest 1.x release, so you get fixes without breaking changes. Pin @v1.0.0 for an exact version.

Commit each map with its map.svg (the skill does this: deliver writes it next to map.json). The comment shows the committed image, so a map without one gets a note instead of a preview.

input default meaning
paths .schemap/**/map.json glob of the map files to check
fail-on-error true fail the check when a changed map has validation errors
comment true post or update the pull request comment
preview artifact artifact: the interactive maps as a download; pages: published to GitHub Pages so the link opens in the browser
pages-url https://<owner>.github.io/<repo>/ base URL of your Pages site, if it is different
token github.token token used to comment; needs pull-requests: write

Outputs: maps (number of changed maps) and errors (how many of them have errors).

For each changed map, its title, path and status (added, changed or removed), then:

  • Valid map: the preview, links to the interactive map and to map.json, any warnings, the change summary, and a collapsed table with one row per change.
  • Map with errors: each error with its code and place, and the command to see the fixes. It is not rendered.
  • Removed map: what it contained.

By default the interactive maps are uploaded with the workflow run: the link downloads them, and you open <slug>/map.html from the download. With browser previews the link opens the map directly.

Set preview: pages and the Action publishes each pull request’s maps to the gh-pages branch under pr-<number>/. The comment links to https://<owner>.github.io/<repo>/pr-<number>/<map>/map.html, every push updates it, and closing the pull request removes it.

.github/workflows/schemap.yml
name: schemap
on:
pull_request:
types: [opened, synchronize, reopened, closed]
paths: [".schemap/**"]
permissions:
contents: write # push previews to gh-pages
pull-requests: write
concurrency:
group: schemap-pages
cancel-in-progress: false
jobs:
maps:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: decimozs/schemap/action@v1
with:
preview: pages

Then turn on GitHub Pages for the repository: Settings → Pages → Deploy from a branch → gh-pages. The Action creates the branch on its first run.

The first preview can take a minute to appear while Pages deploys.

The Action uses schemap diff, which you can run anywhere:

Terminal window
git show main:.schemap/shop/map.json > /tmp/base.json
schemap diff /tmp/base.json .schemap/shop/map.json --md
  • Private repositories: previews load for anyone who can see the repository. To use the Action from a private copy of schemap, allow access under the schemap repository’s Settings → Actions → General → Access.
  • Forks: pull requests from forks get a read-only token, so the check runs but cannot comment.