pez-infra/.github/workflows/lint-docker-compose.yml
dependabot[bot] 352bfbe3bc
chore(deps): bump the github-actions group with 2 updates
Bumps the github-actions group with 2 updates: [actions/checkout](https://github.com/actions/checkout) and [actions/cache](https://github.com/actions/cache).


Updates `actions/checkout` from 6 to 7
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v6...v7)

Updates `actions/cache` from 5 to 6
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](https://github.com/actions/cache/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '7'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions
- dependency-name: actions/cache
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-06-24 16:04:43 +00:00

45 lines
1.6 KiB
YAML

name: Lint Docker Compose
on:
pull_request:
jobs:
compose-lint:
name: docker compose config
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Stub missing env files referenced by Compose
run: |
shopt -s globstar nullglob
for f in ansible/services/**/docker-compose.yml ansible/services/**/docker-compose.yaml ansible/services/**/compose.yml ansible/services/**/compose.yaml; do
dir=$(dirname "$f")
# Create empty stubs for any env_file entries that don't exist
grep -oP 'env_file:\s*\K.*|^\s*-\s*\K\S+\.env' "$f" 2>/dev/null | while read -r envfile; do
envfile=$(echo "$envfile" | sed 's/^["'\'']*//;s/["'\'']*$//')
if [ -n "$envfile" ] && [ ! -f "$dir/$envfile" ]; then
echo "Creating stub: $dir/$envfile"
touch "$dir/$envfile"
fi
done
done
- name: Validate Compose files
run: |
failed=0
found=0
shopt -s globstar nullglob
for f in ansible/services/**/docker-compose.yml ansible/services/**/docker-compose.yaml ansible/services/**/compose.yml ansible/services/**/compose.yaml; do
echo "::group::Validating $f"
if ! docker compose -f "$f" config --quiet 2>&1; then
echo "::error file=$f::Compose validation failed"
failed=1
fi
echo "::endgroup::"
found=1
done
if [ "$found" -eq 0 ]; then
echo "No Compose files found — skipping."
fi
exit $failed