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

Export environment variables from config #36

Open
reitzig opened this issue Feb 4, 2024 · 3 comments
Open

Export environment variables from config #36

reitzig opened this issue Feb 4, 2024 · 3 comments

Comments

@reitzig
Copy link

reitzig commented Feb 4, 2024

I want make use of setting environment variables through mise, attempting to replace direnv in simple cases at least.

Unfortunately, the action does not export the variables included in the configuration:

Example config:
image

Example workflow:
image
The build subsequently fails because changie doesn't find its config.

@reitzig
Copy link
Author

reitzig commented Feb 4, 2024

Workaround:

    - uses: jdx/mise-action@v2
      with:
        install: false # we only need env

    - name: Load mise env
      run: |
          mise env -s bash \
              | grep -v 'export PATH=' \
              | cut -d' ' -f2 \
              >> "$GITHUB_ENV"

@y-nk
Copy link

y-nk commented Jul 1, 2024

this is painful, should probably be fixed under an option

@jdx
Copy link
Owner

jdx commented Jan 1, 2025

I stumbled on this code in direnv: https://github.com/direnv/direnv/blob/master/internal/cmd/shell_gha.go

I'm not entirely sure how it works, but it might be useful here since I am pretty sure it's solving a similar problem

@jdx jdx pinned this issue Jan 1, 2025
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