diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index 485372ad..fbdd3629 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -59,7 +59,10 @@ jobs: run: make test build: - if: ${{ success() && ! startsWith(github.ref, 'refs/tags') }} + if: | + always() && + (needs.code-quality.result == 'success' && needs.test.result == 'success') && + ! startsWith(github.ref, 'refs/tags') runs-on: ubuntu-latest needs: - code-quality @@ -107,7 +110,13 @@ jobs: fi manual-semver: - if: ${{ startsWith(github.ref, 'refs/tags') }} + if: | + always() && + (needs.code-quality.result == 'success' && needs.test.result == 'success') && + startsWith(github.ref, 'refs/tags') + needs: + - code-quality + - test uses: climatepolicyradar/reusable-workflows/.github/workflows/semver.yml@v3 secrets: inherit with: diff --git a/.trunk/configure-pyright-with-pyenv.sh b/.trunk/configure-pyright-with-pyenv.sh index 72bf4202..88936607 100644 --- a/.trunk/configure-pyright-with-pyenv.sh +++ b/.trunk/configure-pyright-with-pyenv.sh @@ -7,15 +7,18 @@ venv_name=$(grep -m 1 venv pyproject.toml | tr -s ' ' | tr -d '"' | tr -d "'" | # Check if pyrightconfig already exists. if [[ ! -f pyrightconfig.json ]]; then # Check if pyenv-pyright plugin is installed - if ! command -v pyenv 1>/dev/null; then + if ! command -v pyenv &>/dev/null; then echo "pyenv not installed. Please install pyenv..." exit 1 fi pyenv_root=$(pyenv root) - dir_exists=$(ls -A "${pyenv_root}"/plugins/pyenv-pyright) - if [[ -z ${dir_exists} ]]; then - git clone https://github.com/alefpereira/pyenv-pyright.git "${pyenv_root}"/plugins/pyenv-pyright + dir_path="${pyenv_root}"/plugins/pyenv-pyright + if [[ ! -d ${dir_path} ]]; then + # trunk-ignore(shellcheck/SC2312) + if [[ -n $(ls -A "${dir_path}") ]]; then + git clone https://github.com/alefpereira/pyenv-pyright.git "${dir_path}" + fi fi # Generate the pyrightconfig.json file.