From 9baacab5edd7ab390bc5fae7d941326c6250e247 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Ricks?= Date: Tue, 11 Jul 2023 12:01:34 +0200 Subject: [PATCH] Change: Improve enabling caching in poetry action The extra step to determine the caching is not necessary. We can use an expression here. --- poetry/action.yaml | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/poetry/action.yaml b/poetry/action.yaml index 30fb13e6..a72e6b39 100644 --- a/poetry/action.yaml +++ b/poetry/action.yaml @@ -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' }} @@ -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: | @@ -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