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

Document the equivalent of core.exportVariable for Docker actions #61

Closed
WaldoJeffers opened this issue Aug 16, 2019 · 5 comments
Closed
Assignees

Comments

@WaldoJeffers
Copy link

WaldoJeffers commented Aug 16, 2019

Hello,

I'm sorry if this is not the best place to ask this, I've looked if there aren't already communities more "support-oriented", but as GitHub actions is still in beta, it seems this question hasn't been properly settled yet.

There's a core.exportVariable method which allows one to "export variables and secrets for future steps". However, I haven't found a way to do the same thing with a Docker action.
I (naïvely) tried adding something like export MY_VAR='tada' to the entrypoint.sh file from the template, but I am unable to read the variable from a subsequent step.

  • Is there an equivalent of exportVariable for Docker actions? If so, I think it should be documented in the template. If not, it should also be documented 😄

Thanks for your help!

@damccorm
Copy link
Contributor

damccorm commented Aug 20, 2019

I'm sorry if this is not the best place to ask this

This is a great place!

Is there an equivalent of exportVariable for Docker actions?

Well, if you run javascript in the container you can call exportVariable with this library and it should work. Otherwise, you should be able to replicate what we do in our exportVariable function by doing something like echo "::[set-env name=FOO;]BAR", which will set FOO=BAR in the env for future steps.

Note that docs for this are tracked in #57 and that this doesn't match exactly what exportVariable does yet because of #59

@damccorm
Copy link
Contributor

damccorm commented Aug 20, 2019

Actually, scratch that - for now you should still use echo "##[set-env name=FOO;]BAR". Note though, that we're going to replace ## with :: in the near future and ## will be (gracefully) deprecated.

@damccorm damccorm self-assigned this Aug 20, 2019
@WaldoJeffers
Copy link
Author

I can confirm this is working @damccorm , thanks for your help :)

@damccorm
Copy link
Contributor

Awesome! I'm going to close here and follow up in #57

@damccorm
Copy link
Contributor

Closing since we have docs as of #105 (and I said I'd close 2 weeks ago 😳)

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

3 participants
@WaldoJeffers @damccorm and others