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

GITHUB_ENV missing from @actions/core node process.env object #645

Closed
nomad-mystic opened this issue Nov 21, 2020 · 1 comment
Closed

GITHUB_ENV missing from @actions/core node process.env object #645

nomad-mystic opened this issue Nov 21, 2020 · 1 comment
Labels
bug Something isn't working

Comments

@nomad-mystic
Copy link

nomad-mystic commented Nov 21, 2020

I'm running into an issue when I try to use core.exportVariable() on version @actions/core@1.2.6.

Describe the bug
GITHUB_ENV is not part of the process.env object when calling core.exportVariable()

To Reproduce
Actions runner environment: https://github.com/nomad-mystic/test-actions/runs/1434434458?check_suite_focus=true
Git Repo: https://github.com/nomad-mystic/test-actions/

Expected behavior
GITHUB_ENV variable should be part of the node process.env object when using the @actions/core module.

Screenshots
11_20_2020 Testing commit 1 by nomad-mystic · Pull Request #1 · nomad-mystic:test-actions

Github actions environment:

  • runs-on: ubuntu-latest
  • matrix: node_version: [14]
  • uses actions/checkout@v2

Additional context
If there is something I'm missing here, pointers would be appreciated.

Thanks

@nomad-mystic nomad-mystic added the bug Something isn't working label Nov 21, 2020
@thboop
Copy link
Collaborator

thboop commented Nov 23, 2020

The use of sudo here is resetting your environment variables.

You have a couple ways you can address this:

  • Do you need to use sudo or can you remove it? Your workflow should work without sudo
  • You can pass the env variable into the sudo script or pass it as an input into the node process
  • There may be a way to get sudo to preserve your environment variables when executing

I'm going to close out this issue, but if the above steps don't resolve it, please let me know and we can reopen it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants