Skip to content

Add env --format github-actions for GITHUB_ENV output #495

Description

@jongio

azd app env can print a service's resolved environment as dotenv, shell, or json. Running services in GitHub Actions needs a different shape: values appended to the $GITHUB_ENV file, with multiline values wrapped in heredoc syntax so they are parsed correctly.

Add --format github-actions that emits KEY=VALUE lines and, for values containing newlines, the KEY<<DELIM ... DELIM heredoc form that Actions expects. This lets a workflow do azd app env --service api --format github-actions >> "$GITHUB_ENV".

Acceptance criteria:

  • env --format github-actions prints single-line values as KEY=VALUE.
  • Multiline values use a unique heredoc delimiter that does not collide with the content.
  • Output works when appended to $GITHUB_ENV.
  • Unit tests cover single-line, multiline, and delimiter-collision handling.
  • Documented in the CLI reference.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestideaFeature idea from the idea pipeline

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions