From b00856f0007176cec07b3b88497a9efdd67d5c5d Mon Sep 17 00:00:00 2001 From: Daniel Carbone Date: Tue, 19 Nov 2024 15:59:00 -0600 Subject: [PATCH 1/4] remembering why I do things. --- .github/workflows/example-linux.yaml | 1 - .github/workflows/example-macos.yaml | 1 - .github/workflows/example-windows.yaml | 2 +- .github/workflows/tests.yaml | 7 ++++++- action.yaml | 4 +++- 5 files changed, 10 insertions(+), 5 deletions(-) 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) { From 3bad70fc89cc7c2b84413313a8d3feb18cd4a038 Mon Sep 17 00:00:00 2001 From: Daniel Carbone Date: Tue, 19 Nov 2024 16:07:40 -0600 Subject: [PATCH 2/4] versions.... --- scripts/unixish.sh | 5 ++++- scripts/windowsish.ps1 | 10 +++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/scripts/unixish.sh b/scripts/unixish.sh index 37d480a..2d2fa9a 100755 --- a/scripts/unixish.sh +++ b/scripts/unixish.sh @@ -65,7 +65,10 @@ else _dl_path="$RUNNER_TEMP/${_root_name}/${_dl_name}" fi -_dl_url="${_base_url}/$YQ_VERSION/${_dl_name}" +# default to _something_... +_version="${YQ_VERSION:-'v4.44.3'}" + +_dl_url="${_base_url}/${_version}/${_dl_name}" echo '::endgroup::' diff --git a/scripts/windowsish.ps1 b/scripts/windowsish.ps1 index b4a5a89..6fbd3cf 100644 --- a/scripts/windowsish.ps1 +++ b/scripts/windowsish.ps1 @@ -41,7 +41,15 @@ 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::" From 6cded9bbcd89b167d41356bf0dbe8626703c529d Mon Sep 17 00:00:00 2001 From: Daniel Carbone Date: Tue, 19 Nov 2024 16:12:45 -0600 Subject: [PATCH 3/4] c'mon man --- scripts/unixish.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/scripts/unixish.sh b/scripts/unixish.sh index 2d2fa9a..3fa2d09 100755 --- a/scripts/unixish.sh +++ b/scripts/unixish.sh @@ -66,13 +66,17 @@ else fi # default to _something_... -_version="${YQ_VERSION:-'v4.44.3'}" +_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}" From 65e4d13ce2fb1c7487b5fcf8ea0c100f0ba3cc81 Mon Sep 17 00:00:00 2001 From: Daniel Carbone Date: Tue, 19 Nov 2024 16:28:42 -0600 Subject: [PATCH 4/4] brain... --- scripts/windowsish.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/windowsish.ps1 b/scripts/windowsish.ps1 index 6fbd3cf..da7d56e 100644 --- a/scripts/windowsish.ps1 +++ b/scripts/windowsish.ps1 @@ -46,7 +46,7 @@ $_version = "$Env:YQ_VERSION" # default to _something_... if ($_version -eq "") { - $_version = = "v4.44.3" + $_version = "v4.44.3" } $_dl_url = "${_base_url}/${_version}/${_dl_name}" @@ -55,7 +55,7 @@ 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}"