Skip to content

Commit

Permalink
Fix GITHUB_ACTION_PATH envvar (#81)
Browse files Browse the repository at this point in the history
* Fix envvar

* Invoke pip via python module
  • Loading branch information
jamescurtin authored Sep 12, 2023
1 parent bef7fc9 commit fd3149b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
12 changes: 7 additions & 5 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,18 +70,20 @@ outputs:
runs:
using: composite
steps:
- run: ${{ github.action_path }}/bin/ensure_python
- run: $GITHUB_ACTION_PATH/bin/ensure_python
shell: bash
- run: >
${{ github.action_path }}/bin/install_packages
$GITHUB_ACTION_PATH/bin/install_packages
${{ inputs.isort-version || inputs.isortVersion }}
${{ inputs.requirements-files || inputs.requirementsFiles }}
shell: bash
- run: echo "::add-matcher::${{ github.action_path }}/isort-matcher.json"
- run: echo "::add-matcher::$GITHUB_ACTION_PATH/isort-matcher.json"
shell: bash
- id: run-isort
run:
${{ github.action_path }}/bin/run_isort ${{ inputs.configuration }} ${{ inputs.sort-paths || inputs.sortPaths }}
run: >
$GITHUB_ACTION_PATH/bin/run_isort
${{ inputs.configuration }}
${{ inputs.sort-paths || inputs.sortPaths }}
shell: bash
- run: echo "::remove-matcher owner=isort-matcher::"
shell: bash
6 changes: 3 additions & 3 deletions bin/install_packages
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@ requirements_files=$2
echo "::group::Install isort"
if [ -z "$isort_version" ] || [ "$isort_version" == "latest" ]; then
echo "Installing latest version of isort"
pip3 install "isort[requirements_deprecated_finder,pipfile_deprecated_finder]"
python3 -m pip install "isort[requirements_deprecated_finder,pipfile_deprecated_finder]"
else
echo "Installing isort==$isort_version"
pip3 install "isort[requirements_deprecated_finder,pipfile_deprecated_finder]==$isort_version"
python3 -m pip install "isort[requirements_deprecated_finder,pipfile_deprecated_finder]==$isort_version"
fi
echo "::endgroup::"

if [ -n "$requirements_files" ]; then
echo "::group::Install modules from requirements arg"
for file in $requirements_files; do
pip install -r "$file"
python3 -m pip install -r "$file"
done
echo "::endgroup::"
fi

0 comments on commit fd3149b

Please sign in to comment.