From eed69597ad1598e20492c6718b1bdf657851f700 Mon Sep 17 00:00:00 2001 From: Hansung Kim Date: Fri, 26 Jan 2024 00:06:04 -0800 Subject: [PATCH] Include date in conda env grep to prevent miss on date-change Currently the grep expression used to filter existing conda envs only use ${{ env.conda-env-name-no-time }}, whereas the full env name includes the date. This results in false hits when jobs in a single workflow runs across multiple dates. --- .github/actions/create-conda-env/action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/actions/create-conda-env/action.yml b/.github/actions/create-conda-env/action.yml index b9fd6066..7532f9da 100644 --- a/.github/actions/create-conda-env/action.yml +++ b/.github/actions/create-conda-env/action.yml @@ -5,8 +5,8 @@ runs: steps: - name: Create conda environments run: | - if conda env list | grep -q "envs/${{ env.conda-env-name-no-time }}"; then - echo "Using pre-existing conda environments with prefix ${{ env.conda-env-name-no-time }}" + if conda env list | grep -q "envs/${{ env.conda-env-name-no-time }}-$(date --date \"${{ env.workflow-timestamp }}\" +%Y%m%d)"; then + echo "Using pre-existing conda environments with prefix ${{ env.conda-env-name-no-time }}-$(date --date \"${{ env.workflow-timestamp }}\" +%Y%m%d)" else echo "Creating a conda environment for each toolchain with the toolchain installed" conda activate base