From cf5753b4bc2768cb31483a6ccf850758eba47bee Mon Sep 17 00:00:00 2001 From: Alexander Esgen Date: Wed, 7 Aug 2024 13:43:49 +0200 Subject: [PATCH] Cabal >=3.12: handle additional output of `cabal path --store` When the `cabal.project` contains an s-r-p, invoking `cabal path --store` in a fresh project can return a line like HEAD is now at ... before the actual store path, causing the logic here to fail. --- haskell/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/haskell/action.yml b/haskell/action.yml index 38084f5..02ab5d6 100644 --- a/haskell/action.yml +++ b/haskell/action.yml @@ -94,7 +94,7 @@ runs: if cabal path; then # cabal >= 3.12 has `cabal path` command - echo "cabal-store=$(cabal path --store)" | tee -a "$GITHUB_OUTPUT" + echo "cabal-store=$(cabal path --store | tail -n 1)" | tee -a "$GITHUB_OUTPUT" elif [ "$(printf "3.10\n${{ inputs.cabal-version }}" | sort --version-sort | head -n 1)" = "3.10" ] && [ -n "$XDG_CONFIG_HOME" ]; then echo "Using xdg-config" cabal_config_file="$XDG_CONFIG_HOME/cabal/config"