From 427123ec0d52a6606503294a73b03af0cd97c82b Mon Sep 17 00:00:00 2001 From: "Trez.One" Date: Mon, 6 Oct 2025 08:09:33 -0400 Subject: [PATCH] ... --- .gitea/workflows/compose-services-readme.yml | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/.gitea/workflows/compose-services-readme.yml b/.gitea/workflows/compose-services-readme.yml index 376c291..fa4e420 100644 --- a/.gitea/workflows/compose-services-readme.yml +++ b/.gitea/workflows/compose-services-readme.yml @@ -53,7 +53,7 @@ jobs: - name: Generate combined service list run: | - # Load environment variables from .env + # Load .env variables safely if [ -f ".env" ]; then set -o allexport source .env @@ -76,13 +76,16 @@ jobs: echo "Processing combined Compose files:" echo "$COMPOSE_FILES" - # Replace env variables in compose files before merging yq -o=json eval-all ' explode(.) | - .services |= with_entries( - .value.image |= sub("\\$\\{VERSION\\}", env(VERSION) // "") - ) | - .services | to_entries | map({"service": .key, "image": .value.image}) + .services | to_entries | + map({ + "service": .key, + "image": (.value.image // "" | + sub("\\$\\{VERSION\\}", env(VERSION) // "") | + sub("\\$\\{PULL_POLICY\\}", env(PULL_POLICY) // "") | + sub("\\$\\{.*?\\}", "")) + }) ' $COMPOSE_FILES \ | jq -s add | jq 'unique_by(.service)' > services.json