Skip to content

feat: add env-file input for compose interpolation - #56

Open
defangdevs wants to merge 3 commits into
mainfrom
feature/env-file-input
Open

feat: add env-file input for compose interpolation#56
defangdevs wants to merge 3 commits into
mainfrom
feature/env-file-input

Conversation

@defangdevs

Copy link
Copy Markdown
Contributor

Migrated from #51 so the source branch lives in the upstream repository. Earlier discussion and reviews remain on the original PR.## What

Adds an env-file input so workflows can point Compose interpolation at a non-default environment file (e.g. .env.production), matching docker compose --env-file.

The input is mapped to the COMPOSE_ENV_FILES environment variable that the Defang CLI reads (whitespace-delimited input is converted to the comma-separated form the CLI expects), the same way project maps to COMPOSE_PROJECT_NAME. Using the env var means it applies to whatever command runs, not just compose up.

Depends on the CLI-side support in DefangLabs/defang#2178.

Usage

- uses: DefangLabs/defang-github-action@v2
  with:
    env-file: ".env.production"        # or: ".env .env.production"

Changes

  • action.yaml: new env-file input; set COMPOSE_ENV_FILES in the env-setup step.
  • README.md: new "Using an Environment File" section.
  • .github/workflows/test.yaml + test/compose.envfile.yaml + test/action.env: a step that runs compose config with env-file and asserts the interpolated value reaches the CLI output.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Sw7j9FYnbChZJbYArxbhuo

Summary by CodeRabbit

  • New Features

    • Added optional deployment summaries with a services table and primary HTTPS endpoint output.
    • Added an optional env-file input for deployment environment files.
    • Supports multiple space-separated files, with later files overriding earlier values.
    • Environment files can be configured in YAML, with .env behavior documented.
    • Output capture is now disabled by default.
  • Tests

    • Added deployment coverage verifying environment variables load correctly from specified files.

defangdevs and others added 3 commits July 20, 2026 02:53
Exposes the CLI's new --env-file support via a COMPOSE_ENV_FILES
environment variable, so workflows can point compose interpolation at a
non-default env file (e.g. .env.production). Whitespace-delimited input
is converted to the comma-separated form the CLI expects, matching how
`project` maps to COMPOSE_PROJECT_NAME.

- action.yaml: new env-file input; set COMPOSE_ENV_FILES
- README: document the env-file input
- test.yaml + fixtures: assert env-file interpolation reaches the CLI

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Sw7j9FYnbChZJbYArxbhuo
@defangdevs
defangdevs requested a review from a team as a code owner August 21, 2026 18:41
@coderabbitai

coderabbitai Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 5825ae44-ec9f-4ab1-bb85-2ca7936e4b6a


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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.

2 participants