diff --git a/.github/workflows/example-linux.yaml b/.github/workflows/example-linux.yaml index f3767a6..2e2f461 100644 --- a/.github/workflows/example-linux.yaml +++ b/.github/workflows/example-linux.yaml @@ -7,7 +7,6 @@ on: type: string required: false description: "Version of YQ to install" - default: "v4.35.1" download-compressed: type: boolean required: false diff --git a/.github/workflows/example-macos.yaml b/.github/workflows/example-macos.yaml index 83f076b..df47029 100644 --- a/.github/workflows/example-macos.yaml +++ b/.github/workflows/example-macos.yaml @@ -7,7 +7,6 @@ on: type: string required: false description: "Version of YQ to install" - default: "v4.35.1" download-compressed: type: boolean required: false diff --git a/.github/workflows/example-windows.yaml b/.github/workflows/example-windows.yaml index 3af6010..b5680bd 100644 --- a/.github/workflows/example-windows.yaml +++ b/.github/workflows/example-windows.yaml @@ -7,7 +7,6 @@ on: type: string required: false description: "Version of YQ to install" - default: "v4.35.1" download-compressed: type: boolean required: false @@ -31,6 +30,7 @@ jobs: force: '${{ inputs.force }}' - name: 'Check yq' + # language=powershell run: | Get-Command "yq.exe" yq.exe --version diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index fc8c63f..c8e3586 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -38,7 +38,11 @@ jobs: force: - 'true' - 'false' - name: "Test Action - (img: ${{ matrix.image }}; dlcmp: ${{ matrix.download-compressed }}; force: ${{ matrix.force }})" + version: + - '' + - 'v4.44.3' + + name: "Test Action - (img: ${{ matrix.image }}; dlcmp: ${{ matrix.download-compressed }}; force: ${{ matrix.force }}; v: ${{ matrix.version }})" runs-on: ${{ matrix.image }} steps: - uses: actions/checkout@v4 @@ -49,6 +53,7 @@ jobs: with: force: '${{ matrix.force }}' download-compressed: '${{ matrix.download-compressed }}' + version: '${{ matrix.version }}' - name: Check yq - Unix-ish if: runner.os == 'Linux' || runner.os == 'macOS' diff --git a/action.yaml b/action.yaml index 3250bb4..d9a67bc 100644 --- a/action.yaml +++ b/action.yaml @@ -8,7 +8,7 @@ branding: inputs: version: - required: false + required: true description: "Version of YQ to install" default: "v4.44.3" download-compressed: @@ -35,6 +35,7 @@ runs: id: yq-check-unix if: (runner.os == 'Linux' || runner.os == 'macOS') shell: bash +e {0} + # language=bash run: | _yq_bin="$(which yq)" if [ -f "${_yq_bin}" ]; then @@ -55,6 +56,7 @@ runs: id: yq-check-windows if: runner.os == 'Windows' shell: powershell + # language=powershell run: | if (Get-Command "yq.exe" -ErrorAction SilentlyContinue) { diff --git a/scripts/unixish.sh b/scripts/unixish.sh index 37d480a..3fa2d09 100755 --- a/scripts/unixish.sh +++ b/scripts/unixish.sh @@ -65,11 +65,18 @@ else _dl_path="$RUNNER_TEMP/${_root_name}/${_dl_name}" fi -_dl_url="${_base_url}/$YQ_VERSION/${_dl_name}" +# default to _something_... +_version="${YQ_VERSION}" + +if [ -z "${YQ_VERSION}" ]; then + _version='v4.44.3' +fi + +_dl_url="${_base_url}/${_version}/${_dl_name}" echo '::endgroup::' -echo '::group::Downloading yq' +echo "::group::Downloading yq ${_version}" echo "Src: ${_dl_url}" echo "Dst: ${_dl_path}" diff --git a/scripts/windowsish.ps1 b/scripts/windowsish.ps1 index b4a5a89..da7d56e 100644 --- a/scripts/windowsish.ps1 +++ b/scripts/windowsish.ps1 @@ -41,13 +41,21 @@ else New-Item "$Env:RUNNER_TEMP\${_root_name}\" -ItemType Directory -Force } -$_dl_url = "${_base_url}/$Env:YQ_VERSION/${_dl_name}" +$_version = "$Env:YQ_VERSION" + +# default to _something_... +if ($_version -eq "") +{ + $_version = "v4.44.3" +} + +$_dl_url = "${_base_url}/${_version}/${_dl_name}" Write-Host "::endgroup::" # download artifact -Write-Host "::group::Downloading yq" +Write-Host "::group::Downloading yq ${_version}" Write-Host "Src: ${_dl_url}" Write-Host "Dst: ${_dl_path}"