Skip to content

Commit

Permalink
Change: Improve enabling caching in poetry action
Browse files Browse the repository at this point in the history
The extra step to determine the caching is not necessary. We can use an
expression here.
  • Loading branch information
bjoernricks committed Jul 12, 2023
1 parent 151932b commit 9baacab
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions poetry/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,6 @@ branding:
runs:
using: "composite"
steps:
- name: Enable/Disable caching
run: |
if [[ "${{ inputs.cache }}" = "true" ]]; then
echo "Caching is enabled"
CACHE="poetry"
else
echo "Caching is disabled"
CACHE=""
fi
echo "CACHE=${CACHE}" >> $GITHUB_ENV
shell: bash
- name: Get pip cache dir
id: pip-cache
if: ${{ inputs.cache-poetry-installation == 'true' }}
Expand All @@ -68,7 +57,7 @@ runs:
uses: actions/setup-python@v4
with:
python-version: ${{ inputs.python-version }}
cache: ${{ env.CACHE }}
cache: ${{ inputs.cache == 'true' && 'poetry' || '' }}
cache-dependency-path: ${{ inputs.cache-dependency-path }}
- name: Install pip
run: |
Expand All @@ -94,6 +83,7 @@ runs:
- name: Parse inputs
if: ${{ inputs.install-dependencies == 'true' }}
run: |
ARGS=""
if [[ -n "${{ inputs.no-root }}" ]]; then
ARGS="--no-root"
fi
Expand Down

0 comments on commit 9baacab

Please sign in to comment.