description: What Oak reads from a GitHub Actions workflow in .oak/workflows/, and where it differs from GitHub.
title: Workflow file reference · Docs
image: https://oak.space/social-card-217ab603.png
Get started
Everyday work
Agents
Large repositories
CI
Organizations and access
Integrations
Reference
For agents
<details>
<summary>Docs menu ▾
Get started
Everyday work
Agents
Large repositories
CI
Organizations and access
Integrations
Reference
Workflow file reference
Copy page .md
What Oak reads from a GitHub Actions workflow in `.oak/workflows/`, and where it differs from GitHub.
Workflows live in .oak/workflows/ and use GitHub Actions syntax. Oak reads each file to decide which jobs run and where; your runner executes them, so steps, uses: actions, expressions, services:, container: and the rest behave as they do on GitHub. This page covers what Oak itself reads, and where it differs from GitHub.
A workflow that fails to parse still produces a run — one that fails immediately and shows the error — so a broken workflow can’t silently stop testing anything.
Files #
- Location: directly in
.oak/workflows/, ending in.ymlor.yaml. Subdirectories are ignored. (.github/workflows/is not read; copy or move files you want Oak to run.) - Name: the file name without its extension.
.oak/workflows/ci.ymlis the workflowci— that’s the nameoak ciand the API use. - Size: at most 256 KiB.
- Independence: each file that matches an event starts its own run, and the merge gate checks each one.
A complete example #
# .oak/workflows/ci.yml
name: CI
on:
push:
paths-ignore: ['docs/**']
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [linux, macos]
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: ~/.cargo/registry
key: cargo-${{/* hashFiles('Cargo.lock') */}}
- run: cargo test --locked
deploy-docs:
needs: test
runs-on: linux
if: github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v4
- run: ./scripts/publish-docs.sh
env:
DOCS_TOKEN: ${{ secrets.DOCS_TOKEN }}on #
Which events start the workflow. As on GitHub, on: is an event name, a list, or a map of events to filters:
| You write | Runs when |
|---|---|
push | Any branch is pushed — its first push too — and when a branch is merged onto main (a push to main). |
pull_request | A branch other than main is pushed. An Oak branch is its own pull request against main, so branches: here filters the base branch. A workflow listing both push and pull_request runs once, as push. |
workflow_dispatch | Someone triggers it with oak ci trigger or the API. |
branches, branches-ignore, paths, and paths-ignore work as on GitHub: * matches within one path segment, ** crosses directories, a ! pattern excludes, and the last matching pattern wins. Two Oak-specific rules keep the merge gate honest:
- On a feature branch, “changed” means the whole branch — everything that differs from where it left
main— not just the latest push. Otherwise a docs-only push after a broken code push would leave the head untested, and ungated. - A change to the workflow file itself always runs it.
Other events (schedule, release, issues, workflow_call, …) are accepted, so a file shared with GitHub keeps working, but never fire on Oak. Oak’s original event names still work too: branch.created (pushes to branches other than main), merge (merges onto main), and manual (workflow_dispatch).
jobs #
Oak reads these job keys; everything else (env, container, services, timeout-minutes, outputs, continue-on-error, defaults, …) passes through to the runner unchanged.
| Key | Required | What Oak does with it |
|---|---|---|
runs-on | yes | The labels a runner must all carry to take the job. A string, a list, or {labels: [...]}. May use ${{ matrix.* }} values, and nothing else. |
steps | yes | Listed on the run page before the runner reports on them. Each step needs run or uses. |
needs | no | The job waits until these jobs finish. Must name jobs in this file. |
if | no | Evaluated by the runner. Without one, a job whose dependency didn’t succeed is skipped; with one (always(), failure(), …) the runner decides. |
environment | no | The environment the job deploys to: a fixed name, or {name, url}. A workflow with such a job never runs on a push or an ordinary trigger, only when someone deploys it with oak ci deploy, and must have exactly one job. |
strategy.matrix | no | Expanded into one job per combination, include / exclude as on GitHub. The matrix must be written out — one computed by an expression (fromJSON(...)) isn’t supported. |
name | no | Display name; ${{ matrix.* }} values are filled in. |
Not supported: reusable workflows (jobs.<id>.uses), and runner groups in runs-on. Either is an error.
What a job sees #
The runner gives every job a GitHub-shaped environment:
githubcontext —github.repositoryisowner/name,github.refisrefs/heads/<branch>,github.event_nameis the event above, andgithub.server_urlis oak.space.github.shais a git commit id. Oak’s commit ids are 64 hex characters, which git tooling doesn’t accept, so each run’s commit is presented as a single-commit git snapshot andgithub.shanames that. Oak’s own id is in$OAK_CI_COMMIT.- Checkout history is one commit deep.
actions/checkoutworks, butfetch-depth: 0, tags, andgit describefind a single commit with no history. OAK_CI_*variables in every step:OAK_CI_RUN_ID,OAK_CI_COMMIT(the Oak commit), andOAK_CI_BRANCH. Names starting withOAK_CI_are reserved in everyenv:.secrets.GITHUB_TOKENauthenticates fetching this repo’s source, for this job only. It can’t call any other API.uses:actions are fetched from GitHub by the runner. JavaScript actions need Node (or Bun) on host-mode runners — see Self-hosted runners.- Caching:
actions/cacheworks against the runner’s own built-in cache server, so a cache is local to the machine that saved it. - Artifacts:
actions/upload-artifactanddownload-artifactaren’t supported yet. Pass small values between jobs with joboutputsandneeds.\<job\>.outputs.
Differences from GitHub, in one place #
| GitHub Actions | On Oak |
|---|---|
.github/workflows/ | .oak/workflows/ |
GitHub-hosted runners (ubuntu-latest) | Your runners; runs-on names their labels |
github.sha is the pushed commit | A single-commit snapshot of the pushed commit; Oak’s id is $OAK_CI_COMMIT |
| Full history on checkout | One commit |
pull_request from forks | Oak branches are pull requests; there are no forks |
schedule, release, … | Accepted, never fire |
| Reusable workflows, computed matrices | Not supported |
| Artifacts | Not supported yet |
environment: jobs run on push and wait for approval | They run only when deployed, on runners dedicated to the environment — see Environments |
GITHUB_TOKEN calls the GitHub API | It fetches this repo’s source only |
Something here wrong or missing? Run oak feedback -m "…" or email [email protected].
On this page