From fd097fdd52f2cd14ee30610368f126a9023ef075 Mon Sep 17 00:00:00 2001 From: frederikb <232148+frederikb@users.noreply.github.com> Date: Tue, 2 Apr 2024 19:24:42 +0200 Subject: [PATCH] fix: download ignores specified JBang version Fixes #2 --- action.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/action.yml b/action.yml index 1abd21a..1a2d4ea 100644 --- a/action.yml +++ b/action.yml @@ -23,8 +23,13 @@ runs: - name: 'Download JBang' shell: bash if: runner.os != 'Windows' + env: + VERSION_INPUT: ${{ inputs.version }} run: | echo "::group::⬇️ Download JBang" + if [[ "$VERSION_INPUT" != "latest" ]]; then + export JBANG_DOWNLOAD_VERSION=$VERSION_INPUT + fi curl -Ls https://sh.jbang.dev | bash -s - app setup echo "${HOME}/.jbang/bin" >> $GITHUB_PATH ${HOME}/.jbang/bin/jbang version @@ -40,8 +45,13 @@ runs: - name: 'Download JBang (Windows)' shell: pwsh if: runner.os == 'Windows' + env: + VERSION_INPUT: ${{ inputs.version }} run: | echo "::group::⬇️ Download JBang" + if ($env:VERSION_INPUT -ne "latest") { + $env:JBANG_DOWNLOAD_VERSION = $env:VERSION_INPUT + } iex "& { $(iwr https://ps.jbang.dev) } app setup" echo "::endgroup::" - name: 'Setup JBang (Windows)'