DevelopersWorkflow file reference

Workflow file reference

Every key a workflow file in .codepinion/workflows accepts, and the rules each one follows.

Reference10 min read

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

KeyRequiredValue
nameNoThe workflow's display name.
concurrencyNoWhich runs supersede each other. See Superseded runs.
onYesThe events that start it. See Triggers.
jobsYesA non-empty mapping of job name to job. See Jobs.

Triggers

EventOptionsRuns when
pushbranches, 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_requestbranches, paths (each with an -ignore form)A merge request is opened or updated. branches matches the target branch.
workflow_dispatchinputs:Someone clicks Run workflow on the Actions tab.
schedulea list of cron: entriesOn 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.

YAML
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:

YAML
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.

KeyValue
typestring (default), boolean or choice.
descriptionHelp text in the dialog.
requiredtrue to refuse a run without a value.
defaultUsed when no value is given.
optionsThe 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

KeyValue
imageThe 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.
stepsA non-empty list. Each step is a command string, or a mapping with run: and an optional name:. Not needed on a deploy job.
needsA job name or list of names this job waits for. Must name real jobs, and the graph cannot loop.
ifA condition; the job is skipped when it is false. See Conditions.
matrixA mapping of keys to non-empty lists; the job runs once per combination. See Matrix.
secretsA 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.
environmentMakes this a deploy job for a named environment.
deploy_appMakes this a build-and-deploy job for a hosted app, by its slug.
strategyHow a deploy job releases. Deploy jobs only. See Strategy.
artifactpath: of a directory this job produces, kept for a later deploy job (static sites). Not allowed on a deploy job.
security_scanMakes 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_app cannot be combined with environment, steps, image or matrix: its steps are generated.
  • strategy is only allowed on a job with environment or deploy_app.
  • artifact.path must be relative and stay inside the repository: no leading /, no ...

Security scan

.codepinion/workflows/security.ymlYAML
name: security

on: [push, pull_request]

jobs:
  security:
    security_scan:
      fail_on: high
KeyValue
fail_oncritical, high (the default), medium, low, or never to report without failing.
scannersAny 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_scan cannot be combined with steps, image, matrix, secrets, environment, deploy_app, strategy or artifact. Use needs: and if: 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.

NameValue
refThe full ref, such as refs/heads/main.
branchThe branch name, such as main.
eventpush, pull_request, manual or schedule.
actorWho 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.

YAML
if: branch == 'main' && event == 'push'
YAML
if: event == 'manual' && inputs.confirm

Matrix

YAML
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

KeyValue
typeRequired: rolling, blue-green or canary.
health_pathAn absolute path such as /healthz, checked before traffic moves.
stepsCanary only: the new version's share of traffic at each stage. Must climb and end at 100, at most 10 steps. Default [10, 100].
intervalCanary 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

VariableHolds
CP_INPUT_<NAME>Each dispatch input.
your secret namesEach secret listed in secrets:.
CP_STEP_SUMMARYA 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 requirementCause / supported approach
apt-get reports a read-only filesystem; sudo failsNormal jobs are non-root with a read-only root. Use an image with OS packages preinstalled.
pip/global npm installation or cache writes failUse 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 failA 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 connectNo 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 outNormal 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 emulatorMatch 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 limitCheck 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 secretDeclare 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 runJobs 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 deadlineCPU, 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 validateuses, 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.