Workflow file reference
Every key a workflow file in .codepinion/workflows accepts, and the rules each one follows.
Workflow files are YAML files in .codepinion/workflows/. A file that breaks any rule below fails validation when it is pushed, with a message naming the job and key, and nothing runs. For a walkthrough, see CI/CD pipelines.
Top level
| Key | Required | Value |
|---|---|---|
name | No | The workflow's display name. |
concurrency | No | Which runs supersede each other. See Superseded runs. |
on | Yes | The events that start it. See Triggers. |
jobs | Yes | A non-empty mapping of job name to job. See Jobs. |
Triggers
| Event | Options | Runs when |
|---|---|---|
push | branches, tags, paths (each with an -ignore form) | A branch is pushed (any branch when no branches), or a tag is pushed and the workflow declares tags. |
pull_request | branches, paths (each with an -ignore form) | A merge request is opened or updated. branches matches the target branch. |
workflow_dispatch | inputs: | Someone clicks Run workflow on the Actions tab. |
schedule | a list of cron: entries | On a schedule. |
Branch and tag patterns use shell-style wildcards: main, release/*, "**". A pattern
starting with ! re-excludes what earlier patterns matched. A filter and its -ignore
form cannot be combined.
on:
push:
branches: [main, "release/*"]
paths: ["src/**", "pyproject.toml"]
schedule:
- cron: "0 3 * * 1"
Tag pushes run only workflows that declare tags or tags-ignore. An unfiltered
on: push means branch pushes, so turning on tag CI never adds runs to existing
workflows. Use tags: ["v*"] for version builds. There is no release event: a Git
tag, a successful build and a published release are separate records.
Path filters compare the files changed by the push (the previous commit of the
branch to the new one; a new branch is compared with its merge-base on the default
branch) or by the merge request (its merge-base with the target branch). In paths,
* stays inside one directory and ** crosses directories. paths runs the workflow
when at least one changed file matches; paths-ignore skips it only when every
changed file matches. If the change set cannot be determined, or has more than 3,000
files, the workflow runs rather than being silently skipped. Path filters do not
apply to tag pushes.
Superseded runs and concurrency
A new push cancels the older queued or running runs of the same workflow on the same branch, so only the latest commit keeps using runners. Push and merge-request runs never cancel each other, tag runs and manual runs are never cancelled automatically, and a run whose deploy job is already running is left to finish. Cancelled jobs say which run superseded them.
Change this with concurrency at the top level of a workflow:
concurrency:
group: deploy-${{ branch }} # runs sharing a group supersede each other
cancel-in-progress: false # keep every run (the default is true)
concurrency: some-group is shorthand for a group with cancellation on. A declared
group applies to every trigger, including manual runs. ${{ ref }}, ${{ ref_name }},
${{ branch }}, ${{ workflow }} and ${{ event }} are substituted in the group.
Queueing runs behind each other without cancelling is not supported.
Dispatch inputs
workflow_dispatch.inputs declares up to 20 inputs, which the Run workflow dialog asks for.
| Key | Value |
|---|---|
type | string (default), boolean or choice. |
description | Help text in the dialog. |
required | true to refuse a run without a value. |
default | Used when no value is given. |
options | The choices; required for choice, and only allowed there. |
Names match [A-Za-z_][A-Za-z0-9_]*. Each value reaches every step as CP_INPUT_<NAME> (upper-cased), so two names that differ only in case are refused. A boolean arrives as true or false.
Jobs
| Key | Value |
|---|---|
image | The container image. A full reference (python:3.12-slim, ghcr.io/org/img:1) is used as-is and must run as a non-root user with uid 1000 and have /bin/sh. A profile name — python, or node, polyglot, general for the general image with Node and Python — picks a CodePinion CI image. Omitted: the general image. |
steps | A non-empty list. Each step is a command string, or a mapping with run: and an optional name:. Not needed on a deploy job. |
needs | A job name or list of names this job waits for. Must name real jobs, and the graph cannot loop. |
if | A condition; the job is skipped when it is false. See Conditions. |
matrix | A mapping of keys to non-empty lists; the job runs once per combination. See Matrix. |
secrets | A list of repository secret names the job may read, each matching [A-Z_][A-Z0-9_]*. Each arrives as an environment variable of the same name, masked in logs. A missing secret fails the job; fork pipelines get none. |
environment | Makes this a deploy job for a named environment. |
deploy_app | Makes this a build-and-deploy job for a hosted app, by its slug. |
strategy | How a deploy job releases. Deploy jobs only. See Strategy. |
artifact | path: of a directory this job produces, kept for a later deploy job (static sites). Not allowed on a deploy job. |
security_scan | Makes this a security check that fails on new problems. Runs on CodePinion, so no steps or image. See Security scan. |
There is no runs-on, uses, with or step-level env.
Rules for deploy jobs
deploy_appcannot be combined withenvironment,steps,imageormatrix: its steps are generated.strategyis only allowed on a job withenvironmentordeploy_app.artifact.pathmust be relative and stay inside the repository: no leading/, no...
Security scan
name: security
on: [push, pull_request]
jobs:
security:
security_scan:
fail_on: high
| Key | Value |
|---|---|
fail_on | critical, high (the default), medium, low, or never to report without failing. |
scanners | Any of secrets, dependencies, code, files. Default: the ones switched on in the repository's Settings → Security. A listed scanner that can't run fails the job. |
The job compares the commit with the default branch and fails only on problems this change introduces: secrets in its own commits, and dependency, code and file problems that the default branch doesn't have. Problems already on the default branch, and anything dismissed on the Security tab, never fail it.
It writes the codepinion/security check for the commit. Add that name to Required status checks in the repository settings to block merging, or to the deploy checks to block deploys, until it passes.
security_scancannot be combined withsteps,image,matrix,secrets,environment,deploy_app,strategyorartifact. Useneeds:andif:as with any job.- The scan runs on CodePinion, not in a runner container, so nothing in the workflow can change its result.
Conditions
if: is a small expression language, evaluated when the run is created.
| Name | Value |
|---|---|
ref | The full ref, such as refs/heads/main. |
branch | The branch name, such as main. |
event | push, pull_request, manual or schedule. |
actor | Who started the run. |
inputs.<name> | A dispatch input. |
It supports quoted strings, == and !=, in [...], &&, ||, parentheses, and true/false. A bare name is true when it is non-empty and not the string false.
if: branch == 'main' && event == 'push'
if: event == 'manual' && inputs.confirm
Matrix
jobs:
test:
image: python
matrix:
db: [postgres, mysql]
tier: [unit, integration]
steps:
- run: pytest
This runs four jobs, one per combination, each labelled with its values, such as db=postgres,tier=unit.
Strategy
| Key | Value |
|---|---|
type | Required: rolling, blue-green or canary. |
health_path | An absolute path such as /healthz, checked before traffic moves. |
steps | Canary only: the new version's share of traffic at each stage. Must climb and end at 100, at most 10 steps. Default [10, 100]. |
interval | Canary only: seconds each step waits, from 30 to 86,400. Default 300. |
Whether a target supports a strategy is checked before anything ships; see Environments and deploy targets. For a complete workflow file using each strategy, see Deploy recipes.
Environment variables in every job
| Variable | Holds |
|---|---|
CP_INPUT_<NAME> | Each dispatch input. |
| your secret names | Each secret listed in secrets:. |
CP_STEP_SUMMARY | A file path. Markdown written to it appears on the job's Summary tab. |
Runner limits and troubleshooting
These describe the Kubernetes normal CI job profile. Build/deploy profiles have separate permissions; none of this promises arbitrary privileged containers.
| Symptom or requirement | Cause / supported approach |
|---|---|
apt-get reports a read-only filesystem; sudo fails | Normal jobs are non-root with a read-only root. Use an image with OS packages preinstalled. |
| pip/global npm installation or cache writes fail | Use a checkout-local Python virtual environment, local Node dependencies, or a prefix/cache under /workspace or /tmp. Install required native libraries in the image. |
| Image starts but commands fail | A usable /bin/sh, compatible architecture, and tools readable/executable by UID 1000 are required. Root-owned startup scripts must not require root writes. The runner supplies its own entrypoint, so an image's default daemon does not start automatically. |
docker, Docker Compose or Testcontainers cannot connect | No Docker daemon/socket or privileged Docker-in-Docker is supplied to normal jobs. Use supported application build/deploy jobs, or redesign tests to use processes in the job or an explicitly approved test service. |
| A database or internal endpoint times out | Normal CI has no inbound access. The checked-in isolation policy allows public-internet egress and backend callbacks but blocks private IPv4 ranges and link-local metadata. A private service needs an operator-reviewed network arrangement. Loopback processes within the job can communicate. |
| A database image fails to initialize | /var is read-only and the process is not root. Use a prepared image with supported non-root startup and data/socket directories under writable mounts. No workflow services: feature is supplied. |
exec format error, missing ARM emulator | Match the runner node's architecture or provide explicit user-mode emulation. An ARM64 cross-build is not an ARM64 runtime test. QEMU tests are slower and are not native-hardware evidence. |
ImagePullBackOff, denied image pull, registry rate limit | Check the exact image/digest, architecture and registry availability. Private-image credentials must be available to Kubernetes before the job starts; shell-level docker login cannot fix startup. |
| Missing secret | Declare an existing repository secret in secrets:. Fork pipelines receive no secrets. Signing/publishing jobs must run only from trusted source. |
| Output disappears in another job or the next run | Jobs have fresh ephemeral workspaces. Do not assume shared files or persistent dependency caches; use the documented artifact/deploy mechanisms where applicable. |
| OOM termination, slow tests, job deadline | CPU, memory, storage and runtime are bounded. Reduce test parallelism, split jobs, and ask the operator to review the runner tier. A larger test timeout alone does not fix resource exhaustion. |
| A GitHub workflow does not validate | uses, runs-on, services and step-level env are not supported. Matrix values currently do not reach steps as variables. Follow this reference. |
Default code settings for normal jobs are a 1 CPU / 2 GiB limit and a one-hour pod lifetime; operators can override these, so they are not a hosted-plan guarantee. Application build jobs have a separate resource tier. Public package downloads can still fail because of upstream outages, rate limits or blocked destinations. Pin inputs, use bounded retries for safe downloads, and keep secrets out of images, source and artifacts. Image digests pin content; they do not make an image trustworthy or automatically apply security updates.
Tag build identity and manual recovery
When tag CI is enabled, on.push.tags and tags-ignore filter short tag names;
branch filters and tag filters apply independently, and a workflow without a tag
filter never runs for a tag. Automatic run identity includes
the full ref. CP_REF is the full ref, CP_REF_NAME its short name and CP_REF_TYPE
is branch or tag. CP_BRANCH is empty for tag builds. Annotated tag objects are
resolved to their commit before checkout. Deleting a tag does not build it.
Manual dispatch accepts a full refs/tags/<name> ref when enabled. The signed CLI
workflow is subject to additional server-controlled trust, source and environment
validation; declaring signing secrets in arbitrary YAML grants no release authority.