Skip to content

GitHub Action ​

KarolNov/linopress@v0 runs plan on pull requests and push on pushes to your default branch. The output goes to the job summary, and optionally to a comment on the pull request.

Workflow ​

yaml
# .github/workflows/docs.yml
name: Docs
on:
  push:
    branches: [main]
  pull_request:

permissions:
  contents: write # push saves the manifest to a branch
  pull-requests: write # and opens a pull request to merge it

concurrency:
  group: linopress-${{ github.ref }} # one push at a time, so manifest saves don't race

jobs:
  docs:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: 22
      - run: npm ci # linopress-cli, TypeDoc and your project's dependencies
      - uses: KarolNov/linopress@v0
        with:
          linear-api-key: ${{ secrets.LINEAR_API_KEY }}
      # On push, the Markdown editions are now in their `out` folders: build and deploy the site here.

Install your dependencies in a step before the action. It runs the linopress your project installs, looking in node_modules/.bin from working-directory up to the repository root, because the config imports linopress-cli/config and TypeDoc needs your project's dependencies.

Add comment: true under with: to also post the plan on the pull request. The comment is edited in place on later pushes. Pull requests from forks get a read-only token, so they only get the job summary.

Inputs ​

InputDefaultMeaning
commandautoplan, push, or auto: push on a push to the default branch, else plan
editionevery edition (--all)One edition from the config
team, projectLinear team or project id, overriding the config (needs edition)
argsExtra CLI arguments, e.g. --verbose
working-directory.Folder with linopress.config
linear-api-keyLINEAR_API_KEY from the environmentNeeded to push to Linear
commentfalseOn pull requests, also post the plan as a comment (edited on later pushes)
save-manifesttrueAfter push, save a changed manifest to a branch and open a pull request
github-tokengithub.tokenToken for the manifest branch and pull request
manifest:(top,glob)**/.linopress-manifest.jsonGit pathspec of the manifests to save

Outputs: command (plan or push), manifest-branch and manifest-pr (when the manifest changed).

The manifest in CI ​

push records which Linear document each page became in .linopress-manifest.json, and the next push needs that record to update those documents instead of creating new ones.

The action doesn't commit to your default branch, since it's often protected. When a push changes the manifest, the action commits just that file to linopress/manifest-<branch> and opens a pull request from it, or updates the one that's open. Merge it when convenient. Until then, every run reads the manifest from that branch, so pushes in between still update the same documents.

  • The manifest is saved even if the push failed part-way, since the documents created so far are in it.
  • If the manifest changed but can't be saved (it's gitignored, the run was on a tag, or the branch can't be pushed), the job fails rather than lose it.
  • If only the pull request can't be opened, the job warns and links to open it by hand. To let the action open it, allow GitHub Actions to create pull requests (Settings → Actions → General).
  • Pull requests opened with the default GITHUB_TOKEN don't trigger workflows. If your default branch requires checks, pass a PAT or a GitHub App token as github-token.

Markdown output isn't committed. It stays in the working tree for later steps, such as building and deploying your site.

MIT licensed. Not made by or affiliated with Linear.