cypress-io / cypress-io/github-action

Suggestion: Allow passing environment variables separated by line breaks for easier input

Open
#1,501 1 comment 0 reactions 0 assignees View on GitHub
type: enhancement
Dominant language
JavaScript
Stars
1.5k
Forks
353
Avg merge
1d 22h
Merged PRs (30d)
27

Description

The documentation says the following on passing environment variables:

> ```yaml
> env: host=api.dev.local,port=4222
> ```
> When passing the environment variables this way, unfortunately due to GitHub Actions syntax, the variables should be listed in a single line, which can be hard to read.

What a lot of other actions tend to do is allow passing multiple items on multiple lines, making use of YAML's linebreak preserving syntax:

```yaml
env: |
host=API.dev.local
port=4222
```

In the action code, you can then just do something akin to `env.includes("\n") ? env.split("\n") : env.split(",")` for improved ergonomics with very little effort.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.