For AI agents: the complete documentation index is available at https://docs.hod.sh/llms.txt, the full documentation bundle is available at https://docs.hod.sh/llms-full.txt, and this page is available as Markdown at https://docs.hod.sh/pipelines/concurrency.md.

Concurrency

A concurrency group runs its members one at a time. concurrency: at the top makes each run of the pipeline a member; on a job, the job is one, across runs. Groups are shared by every project of the org, so two repositories can guard one deploy target.

version: 0
on: [push]
concurrency:
  group: ci-${{ event.branch }}
  policy: cancel_other
jobs:
  deploy:
    concurrency: {group: deploy-production}
    image: alpine:3.22
    steps:
      - run: ./deploy.sh

group is the group's name; it can read event, vars and a job's matrix, not jobs. policy says what a new member does when the group is busy:

Policy
buffer_all (default)Wait behind every member that joined earlier
buffer_oneWait, and supersede the members waiting before it
skipDon't run if the group is busy
cancel_otherSupersede every other member, running or waiting, then run
allowNo group: run in parallel. Top level only

Without a top-level concurrency:, a pull request's runs share a group with cancel_other, so a new push supersedes the older runs; concurrency: {policy: allow} turns that off. Superseded members end cancelled. hod local run runs one run, so only jobs whose groups have the same name wait for each other.