question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Environment Variables not passed through

See original GitHub issue

Describe the bug Environment variables set on the workflow step (via the env keyword) are not passed through to the command when the workflow runs.

From my workflow:

- name: Destroy Infrastructure
  id: retry_on_error
  uses: nick-fields/retry@v2
  env:
    ENVIRONMENT: dev
    NODE_OPTIONS: '--max_old_space_size=7168'
  with:
    timeout_minutes: 60
    max_attempts: 3
    retry_wait_seconds: 60
    retry_on: error
    command: npx nx destroy ${{matrix.project}} --stage=${{ steps.git-branch.outputs.name }}

Expected behavior Environment Variables set on the workflow step are used when invoking the command, which is the standard behaviour for the default run action, that this is meant to be a drop-in replacement for.

Screenshots N/A

Logs I can gather logs if necessary, but I feel like this is part feature request part bug report, so I’m not sure how useful logs would be.

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:1
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
tstackhousecommented, Aug 4, 2022

I had to explicitly make my reference nick-fields/retry@v2.8.0, but it looks like that did the trick! Thanks for looking into this so quickly, and I’m glad my research was helpful! ❤️

1reaction
nick-fieldscommented, Aug 4, 2022

Just published v2.8.0 that I think should resolve this. Thanks for your issue and research!

Can you confirm whether this resolves your issue?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Environment variables not passed other jobs with ... - GitLab
As opposed to documentation, environment variables are not passed to other jobs when explicit dependencies are in place. Steps to reproduce.
Read more >
Environment variables not passed to program
I'm on macOS, and I use skhd as my hotkey daemon. It's basically a program that lets me assign keyboard shortcuts to shell...
Read more >
Docker-compose not passing environment variables to docker ...
Compose supports declaring default environment variables in an environment file named .env placed in the folder where the docker-compose ...
Read more >
Environment variables are not accessible in bash script
Variables are not passed to child shells by default, only if they are exported. Think of each bash session as independent (they largely...
Read more >
Docker run: Passthrough environment variables do not get ...
Problem description Passthrough environment variables do not get passed through; the documentation says they do.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found