Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/workflows/docker-image-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,10 @@ on:
description: "Space-separated compose files to validate (forwarded to lint-compose)."
type: string
default: "compose.yml"
compose-version:
description: "Docker Compose version to validate against (forwarded to lint-compose)."
type: string
default: "latest"
env-substitutions:
description: "Newline-separated KEY=VALUE placeholder pairs for compose validation (forwarded to lint-compose)."
type: string
Expand Down Expand Up @@ -214,6 +218,7 @@ jobs:
contents: read
with:
compose-files: ${{ inputs.compose-files }}
compose-version: ${{ inputs.compose-version }}
env-substitutions: ${{ inputs.env-substitutions }}

build:
Expand Down
19 changes: 19 additions & 0 deletions .github/workflows/lint-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,14 @@ on:
description: "Copy `.env.example` to `.env` (when the example file exists) before validating, so committed placeholders resolve."
type: boolean
default: true
compose-version:
description: >-
Docker Compose version to validate against, e.g. "v5.5.1" or
"latest". The runner's preinstalled version lags behind and rejects
keys that current compose accepts, so validation would otherwise
fail on files that are in fact valid.
type: string
default: "latest"
env-substitutions:
description: >-
Newline-separated KEY=VALUE pairs. For each pair, an empty
Expand Down Expand Up @@ -149,6 +157,17 @@ jobs:
rm -f "$subs_file"
fi

# The runner image ships whatever compose version it happens to carry
# (v2.38 as of writing), which rejects keys that current compose
# accepts - `pre_start` among them. Validating against an older parser
# than the one deployments run would report valid files as broken, so
# this pins the version being validated against instead of inheriting
# the runner's.
- name: Set up Docker Compose
uses: docker/setup-compose-action@4eb059ff7f16592f9c84d5ca339c53cb7c5064e2 # v2.3.0
with:
version: ${{ inputs.compose-version }}

- name: Validate compose configuration
env:
COMPOSE_FILES: ${{ inputs.compose-files }}
Expand Down
Loading