Skip to content

Is it possible to use environment variables inside copy.bara.sky file? #142

Open
@scriptnull

Description

@scriptnull

Let us say that we have some information (like the commit header) in a environment variable of the system in which copybara runs (say COMMIT_MESSAGE_ENV)

Is it possible to refer to that environment variable in the metadata transformations.

core.workflow(
    name = "default",
    origin = git.github_pr_origin(
       ....
    ),

    destination = git.github_pr_destination(
       ....
    ),

   ....

    transformations = [
        metadata.add_header("COMMIT_MESSAGE_ENV should be present here"),
    ],
)

Currently, we are able to refer only the implicit labels like GITHUB_PR_NUMBER. But I wonder if there is a way to reference just the environment variables inside the copy.bara.sky file.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions