Skip to content

[Bug]: COOLIFY_BRANCH inconsistent when building and within run container #9572

@mlitwiniuk

Description

@mlitwiniuk

Error Message and Logs

$COOLIFY_BRANCH behaves inconsistently between setting dynamic env variables and what's actually passed to container.

In ApplicationDeploymentJob it's set to $this->application->git_branch while bootstrap/helps/parser.php set's it to "pull/{$pullRequestId}/head"

Steps to Reproduce

  1. Create new app with preview deployment enabled
  2. Edit environmental variables and set (for preview) TEST=${COOLIFY_BRANCH} - this will be set to actual git branch
  3. Deploy preview instance from any branch
  4. Open deployed container and echo $COOLIFY_BRANCH - this will be set to "pull/PULL_REQUEST_ID/head"

Example Repository URL

No response

Coolify Version

v4.0.0-beta.473

Are you using Coolify Cloud?

No (self-hosted)

Operating System and Version (self-hosted)

Ubuntu 24.04.4 LTS

Additional Information

I have in my app set (in preview ENV) DATABASE_URL to postgres://xyz/app_${COOLIFY_BRANCH}, this is what I'm seeing after entering the container: https://shots.hmdr.io/rSxTql8Z

Metadata

Metadata

Assignees

No one assigned

    Labels

    🔍 TriageIssues that need assessment and prioritization.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions