-
Notifications
You must be signed in to change notification settings - Fork 40
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
Provide alternative for $GITHUB_PATH inside MSYS2 with path-type: minimal #347
Comments
May I ask why you are using that workaround? Would not the |
I've not thought of that and I'm unsure if that would work. My rationale is that I would add my path directly to PATH by exporting it in .bashrc. I'm not sure if the changes are inherited in next steps (that's what I want). |
Yes, the changes are "inherited" in next steps if you are using |
That did not seem to work. Here is a snippet of what I am doing: build_windows_msys2:
name: Windows
runs-on: windows-2019
strategy:
matrix:
config:
- {msystem: MINGW32, arch: i686}
- {msystem: MINGW64, arch: x86_64}
defaults:
run:
shell: msys2 {0}
steps:
- uses: actions/checkout@v3
- uses: msys2/setup-msys2@v2
with:
msystem: ${{ matrix.config.msystem }}
release: false
install: >-
git
zip
wget
curl
mingw-w64-${{ matrix.config.arch }}-gcc
mingw-w64-${{ matrix.config.arch }}-ntldd
- name: Set Environment Variables
run: |
echo "INSTALL_REF=${GITHUB_REF##*/}" >> "$GITHUB_ENV"
echo "INSTALL_NAME=lite-xl-${GITHUB_REF##*/}-windows-${{ matrix.config.arch }}" >> "$GITHUB_ENV"
export PATH="$PATH:$HOME/.local/bin:$USERPROFILE/.local/bin:$(cygpath '${{ steps.git-path.outputs.path }}')"
- uses: actions/setup-python@v4
id: install-python
with:
python-version: '3.11'
- name: Cache Poetry and other build tools
id: build-tools
uses: actions/cache@v3
with:
path: ~/.local
key: build-tools-msys2-${{ runner.os }}-${{ steps.install-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
- name: Install Poetry
if: steps.build-tools.outputs.cache-hit != 'true'
uses: snok/install-poetry@v1
- name: Configure Poetry
run: |
echo "$PATH" # does not have %USERPROFILE%/.local/bin and ~/.local/bin
poetry config virtualenvs.path "$(cygpath -w "$USERPROFILE/.local/virtualenvs")" Hopefully this explains my intentions better. |
Now I wonder why poetry need additional directories in PATH environment variable. But that would be different topic. Please wait for other to comment on this issue. |
I have exactly the same problem, exporting the same path in every step isn't ideal, in every other shell env. I can add to GITHUB_PATH once and that's it, but on MSYS2 it doesn't work like that of course. |
Appending to .bashrc is a nice workaround for this problem, thx |
Also, would be nice to have eg. |
+1 for adding a I would think this would be rather easy to implement. Could add a new case here (https://github.com/msys2/MSYS2-packages/blob/99ac5123c37254e5e3fdda53663d8c09d30cf1cd/filesystem/profile#L28-L45) which is almost the same as the |
I want to use
path-type: minimal
(the default), but I want to be able to add things to PATH like appending to$GITHUB_PATH
does. I don't want to inherit$env:PATH
entirely.Currently, a workaround I use is to do
echo 'export PATH=$PATH:/blabla' >> .bashrc
, which I don't think is as elegant as the$GITHUB_PATH
solution. I propose$MSYS2_PATH
as the equivalent to$GITHUB_PATH
in MSYS2.The text was updated successfully, but these errors were encountered: