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 file support #426

Merged
merged 12 commits into from
Jan 12, 2021
Merged

GitHub env file support #426

merged 12 commits into from
Jan 12, 2021

Conversation

torbjornvatn
Copy link
Contributor

@torbjornvatn torbjornvatn commented Nov 20, 2020

This PR attempts to add support for the new Environment Files since the ::set-env command has been deprecated.

I found a way to download a tar of the envs.txt file that I've assigned to $GITHUB_ENV from a previous step's container and merge the contents into the env map that is passed to the next step.
It's possible that there are more elegant ways of doing this, but I couldn't find any other way of getting access to that file between steps.

UPDATE: I did an new attempt at solving this using the existing command handler, but it didn't work as the new way of setting the envs uses the >> to file syntax. That output can be generated from any command that's called within the run: and as far as I understand that can't be intercepted in the command handler.

DEPRECATION? We should probably add a warning or an error if you try to use the old and deprecated ::set-env syntax, but I'm not sure how to best handle that @cplee

Fixes #384

@torbjornvatn torbjornvatn marked this pull request as ready for review November 26, 2020 14:50
@torbjornvatn torbjornvatn changed the title [WIP] GitHub env GitHub env file support Nov 26, 2020
@cplee
Copy link
Contributor

cplee commented Nov 30, 2020

@torbjornvatn - i really appreciate you working on this!

I'm going to need more time to review...lots of changes and it is a bit hard to discern which changes are related to #384 and which were just general "clean up" changes.

@dkravetz
Copy link

dkravetz commented Dec 8, 2020

@bixu and I are also running into this issue. I'd be happy to test a release candidate 😃

@cplee
Copy link
Contributor

cplee commented Dec 8, 2020

@torbjornvatn - can you fix the conflict?

@torbjornvatn
Copy link
Contributor Author

@cplee sorry for the delay!
Fixed the conflict with master now

@torbjornvatn
Copy link
Contributor Author

@cplee I've also fixed the linting issue now.

@cplee cplee merged commit 15eaa15 into nektos:master Jan 12, 2021
@2m
Copy link

2m commented Mar 15, 2021

Thank you for this very much! I noticed that writing to GITHUB_PATH to add to system path does not currently work. However it is possible to work around it with:

echo "PATH=$PATH:$(python3 -m site --user-base)/bin" >> ${GITHUB_ENV}

@torbjornvatn torbjornvatn deleted the GITHUB_ENV branch March 15, 2021 15:27
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

Successfully merging this pull request may close these issues.

Support for $GITHUB_ENV
4 participants