Skip to Content
Xeonr Developer Docs
Pipelines

Isolate a step from the job

Run a typed step among run: steps with isolated: true, and choose what it receives and hands back with workspace:.

Available in repositories branchd reads pipeline files for. It is switching repositories on one at a time: until yours is, it keeps running its .forge-ci.yaml or .xeonr-ci.yaml. See What is available.

A job's steps are processes in one container, so a run: line can read anything a neighbouring step holds. A typed step (uses: ci/…) carries an identity or secrets of its own, so it never shares a container with the job's other steps. Written among them, it says so with isolated: true, and says what it needs from the steps before it with workspace::

.branchd/pipelines/dashboards.yaml
# .branchd/pipelines/dashboards.yaml
# A typed step among run: steps is marked isolated: true. It runs as a node
# of its own, receives dashboards/** from the steps before it, and hands
# back what it writes there. Nothing else crosses: not $HOME, not exported
# variables, not services. Step outputs do.
name: Dashboards
on:
  push:
    branches: [main]
jobs:
  deploy:
    image: node:22
    steps:
      - id: gen
        run: |
          npm ci
          npm run dashboards
          echo "count=$(ls dashboards | wc -l)" >> "$BRANCHD_OUTPUT"
      - uses: ci/lantern-apply@1
        isolated: true
        workspace: [dashboards/**]
      - run: echo "applied ${{ steps.gen.outputs.count }} dashboards"
      - if: always()
        run: rm -rf node_modules/.cache
  • The marker is required. A typed step among other steps without isolated: true is refused. The refusal names the step, says why it runs on its own (an image package; the identity tokens it asks for; the secrets it reads), and prints the step with isolated: true and a workspace:.
  • workspace: is what the step receives from the working directory as the steps before it left it, generated, untracked and ignored files included:
    • a list of paths, globs relative to the working directory (dashboards/**, dist, *.json), at most 32. A list carries only what it names, so a step that runs git on its tree needs .git/** in it;
    • all, everything;
    • left out, the checkout only: the step gets what it would as a job of its own, and hands nothing back.
  • What it writes inside those paths comes back to the steps after it. A file it deletes comes back deleted only with workspace: all.
  • Nothing else crosses, either way: anything outside the working directory ($HOME, /tmp, tools installed into the image), exported variables and shell functions, the current directory, background processes, and services (each part starts its own). Step outputs do cross: ${{ steps.gen.outputs.count }} above.
  • isolated: true on a run: step or a composite step works the same: that step runs as a node of its own.

How it runs

The job is split into parts, one node each: the steps before the isolated step, the step itself, and the steps after it. Each part is a check, named <job> [k/n], and the last has the job's own name, so needs: [deploy] and needs.deploy.outputs reach it unchanged. Here: Dashboards / deploy [1/3], Dashboards / deploy [2/3] and Dashboards / deploy. Require the last one in a branch rule.

  • The cost. The working directory is packed and unpacked at each boundary. With node_modules or build output that can be hundreds of megabytes, and each part starts its own container, services and cache restore. If a hand-over is slow, make the step a job of its own and pass only what it needs as artifacts:.
  • if: always() after it runs whatever the parts before it did. The isolated step needs a workspace: then, to carry its result back. if: failure() on the isolated step is refused.
  • continue-on-error on the isolated step lets the steps after it run. On the job it is refused.
  • Refused on the job: a concurrency lock (another run could take it between the parts) and continue-on-error.
  • Secrets. The isolated step gets only the secrets its package declares. One it reads that is also listed on the job reaches the other parts too, and the plan warns.
  • At most 8 isolated steps in a job.

branchd ci plan prints the job once, with its parts and, under the isolated step, what it receives, what it hands back and what does not cross.

Not yet available (console): showing a job's parts as the one job you wrote. Each part is its own check for now.

On this page