Skip to content

chore: validate rendered compose YAML in staging deploy - #209

Merged
akandic47 merged 1 commit into
mainfrom
chore/compose-validation-action
Aug 31, 2026
Merged

akandic47 merged 1 commit into
mainfrom
chore/compose-validation-action

Conversation

@akandic47

@akandic47 akandic47 commented Aug 31, 2026 •

Copy link
Copy Markdown

Problem

The staging deploy has been failing on the Rendered docker-compose is invalid check added in #206 (e.g. run 33368743093). The rendered compose file is actually valid — the check itself could never succeed because the self-hosted runner is a container without docker, so docker compose config fails for environmental reasons, and the step suppressed all output, making it look like a compose problem.

Change

Replace the docker compose config check with a plain YAML parse using yq:

- name: Validate rendered docker-compose
  run: yq . docker-compose.rendered.yml > /dev/null

This catches the realistic failure mode (envsubst producing broken YAML from a secret value) and prints the parse error with line/column to the log on failure, while discarding stdout so the rendered file's secret values are never echoed. Full compose-schema validation still effectively happens at deploy time via the Portainer HTTP status check from #206.

Requires

yq in the actions-runner image:

sudo apt-get update && sudo apt-get install -y curl jq git gettext yq

On the ghcr.io/actions/actions-runner base (Ubuntu 24.04, python3 preinstalled) this adds only python3-yaml python3-argcomplete python3-toml python3-xmltodict yq.

Verification

Tested in a clean ubuntu:24.04 container against renders of deploy/docker-compose.staging.yml (with dummy secret values):

  • valid render → exit 0, no output
  • render broken by a multiline secret → exit 1, could not find expected ':' in ..., line 19, column 6

@github-actions

Copy link
Copy Markdown

Go Test coverage is 36.5 %\ ✨ ✨ ✨

The staging deploy runner is a container without docker, so the
docker compose config check always failed and reported the rendered
compose as invalid. Validate with a yq parse instead, which catches
envsubst producing broken YAML and prints the parse error without
echoing the rendered file.

Requires yq in the actions-runner image.
@akandic47
akandic47 force-pushed the chore/compose-validation-action branch from 9e2da86 to c54fdef Compare August 31, 2026 10:17
@github-actions

Copy link
Copy Markdown

Go Test coverage is 36.5 %\ ✨ ✨ ✨

@akandic47
akandic47 merged commit 541e376 into main Aug 31, 2026
7 checks passed
@akandic47
akandic47 deleted the chore/compose-validation-action branch August 31, 2026 10:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants