Skip to content

Missing validation for WORKSPACE environment variable in create_ci_badge.py #514

@brianredbeard

Description

@brianredbeard

Description

The script uses os.environ['WORKSPACE'] without checking if it exists, which will raise KeyError if the variable is not set.

Location

https://github.com/validatedpatterns/multicloud-gitops/blob/main/tests/interop/create_ci_badge.py#L60

with open(f"{os.environ['WORKSPACE']}/badge.txt", "w") as badge:

Expected Behavior

Validate the environment variable exists before use, or use os.environ.get() with a fallback.

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