Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Environment variables #256

Open
zonescape opened this issue Feb 18, 2025 · 0 comments
Open

Environment variables #256

zonescape opened this issue Feb 18, 2025 · 0 comments

Comments

@zonescape
Copy link

Is this intentional behavior or a bug?

Currently environment variables are eligible for shell parameter expansion. For example, this task gives string "xxxyyy":

task:
  - name: prints xxxyyy
    script: printenv FOO
    env: {BAR: yyy, FOO: xxx$BAR}

this one gives string "qwe":

task:
  - name: prints qwe
    script: printenv PASSWORD
    env: {PASSWORD: qwe$rty}

commands are also supported:

task:
  - name: prints xxx
    script: printenv FOO
    env: {FOO: $(echo xxx)}

Golang's %q encoding may produce unexpected behavior. This task escapes new line character:

task:
  - name: prints a\nb (new line is escaped)
    script: printenv FOO
    env: {FOO: "a\nb"}

this one escapes part of the emoji:

task:
  - name: prints 👨\u200d🦰
    script: printenv FOO
    env: {FOO: 👨‍🦰}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant