-
Notifications
You must be signed in to change notification settings - Fork 54
Output actual ghc-version, stack-version, and cabal-version #77
Comments
A workaround is to insert a step like: - shell: bash
run: |
echo "GHC_VER=$(ghc --numeric-version)" >> ${GITHUB_ENV}
echo "CABAL_VER=$(cabal --numeric-version)" >> ${GITHUB_ENV}
echo "STACK_VER=$(stack --numeric-version)" >> ${GITHUB_ENV} Then, these variables can be used in the next steps, e.g.: - run: |
echo "GHC_VER = ${{ env.GHC_VER }}"
echo "CABAL_VER = ${{ env.CABAL_VER }}"
echo "STACK_VER = ${{ env.STACK_VER }}" Or, in shell commands, as environment variables: - run: |
echo "GHC_VER = $GHC_VER"
echo "CABAL_VER = $CABAL_VER"
echo "STACK_VER = $STACK_VER" However, this is all a bit more manual, brittle and OS-specific than getting these directly as outputs from the setup-action. @jared-w |
That sounds like a great idea. The 'latest' variables are resolved to their "actual" ones fairly early on in the code-path and there's a very natural insertion point to include an output for this (the
|
The resolved versions are available at the end of Lines 130 to 131 in f0ecab9
There, or after it returns, in the run function, the outputs could be written via core.setOutput(variable, value) .actions/setup/src/setup-haskell.ts Lines 25 to 30 in f0ecab9
|
Using
latest
as input forghc-version
,stack-version
andcabal-version
is very convenient, but then it is not so convenient later in the workflow when one needs these versions.Suggestion: Also output these three variables, filling them with the actually chosen versions of the tools.
This would also open the path for other wildcards for versions, like
ghc-version: 8.10.latest
etc. which could be used conveniently.The text was updated successfully, but these errors were encountered: