Skip to content

Commit

Permalink
Merge pull request #16 from moneymeets/feature/add-option-to-disable-…
Browse files Browse the repository at this point in the history
…setup-python-caching

feat(action): add option to disable setup python cache
  • Loading branch information
felix11h authored Oct 30, 2023
2 parents 14d8453 + 66eacc3 commit e4c3689
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ inputs:
description: "Working directory, defaults to GITHUB_WORKSPACE"
required: false
default: ${{ github.workspace }}
# ToDo: Remove disable cache option when https://github.com/actions/setup-python/issues/361 is fixed
poetry_cache_enabled:
description: "Caching of Poetry environment"
default: "true"

outputs:
python-version:
Expand Down Expand Up @@ -56,8 +60,9 @@ runs:
id: setup-python
with:
python-version: '${{ steps.detect-versions.outputs.python-version }}'
cache: 'poetry'
cache-dependency-path: ${{ inputs.working_directory }}/poetry.lock
# ToDo: Remove conditional expressions below when https://github.com/actions/setup-python/issues/361 is fixed
cache: ${{ inputs.poetry_cache_enabled == 'true' && 'poetry' || ''}}
cache-dependency-path: ${{ inputs.poetry_cache_enabled == 'true' && format('{0}/poetry.lock', inputs.working_directory) || ''}}

- run: |
if [ "$(echo ${{ steps.detect-versions.outputs.poetry-version }} | cut -c1-4)" == "1.5." ]; then
Expand Down

0 comments on commit e4c3689

Please sign in to comment.