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
[Question] Using direnv in GitHub Actions #903
Comments
Nice! That looks like a good addition for the wiki indeed. Now to answer your question: For single commands, you can use I like your idea of using the |
Ooh, I like that! I can take a stab at a PR, if you want? I've only dabbled a little bit in GO, so might require some handholding. 🙈 |
After messing around with a way to get python packages to show up in my attempts to use |
Oh, that's awesome @mmlb ! lmk if you need anything from me! |
Hey @BeyondEvil I've got #910 up, give it a spin with your GHA setup? I've given it a go on the PR I was working on before, https://github.com/mistifyio/go-zfs/runs/5649577377 and its looking good for my use. |
Happy to test it out @mmlb ! Umm... how do I use your branch tho? 😂 Here's what I'm currently doing: - name: Install direnv
run: |
mkdir -p ~/.local/bin
curl -sfL https://direnv.net/install.sh | bash
direnv allow |
I can put up the binary somewhere that you can fetch instead, but thats not a good idea imo. You'd have to build it and commit locally (like I did in my PR, temporarily and not going to be merged) or build my branch in your ci run. Happy to help with either case. |
Hey, sorry for the late response @mmlb Yeah, I'll pull your branch and build it - I think that's the path of least resistance. I'l have to do it tomorrow tho. |
Tested and works like a charm @mmlb Thank you! |
I spent quite some time getting this to work, so wanted to share it here. Maybe (after som revisions) it can be added to the Wiki.
We wanted to use
direnv
in GitHub Actions, without using a third-party action.Here's the result:
Note that we're running this in a self-hosted Ubuntu runner. YMMV
Unfortunately you have to duplicate
eval "$(direnv export bash)"
for every step.So a question is: Is there a better way of solving that? Maybe involving
$GITHUB_ENV
?The text was updated successfully, but these errors were encountered: