13 Commits
v3.0.1 ... main

Author SHA1 Message Date
dependabot[bot]
b39bdc213c Bump actions/checkout from 5 to 6 (#24) 2025-11-24 06:01:06 -06:00
Daniel Carbone
737621eb07 no permissions 2025-09-19 12:20:51 -05:00
Daniel Carbone
04b1c990a4 Add permissions field to Linux setup workflow 2025-09-19 12:18:47 -05:00
Daniel Carbone
58388b8d70 limiting permissions (#23)
* limiting permissions

* also adding concurrency
2025-09-19 12:16:25 -05:00
dependabot[bot]
2bd1830d1d Bump actions/checkout from 4 to 5 (#21)
Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 5.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-09-19 12:12:31 -05:00
Daniel Carbone
d3f1c094e8 updating test runners (#22) 2025-09-19 12:09:23 -05:00
Daniel Carbone
b7ef57d46e Adding 1.8.0 stuff (#20) 2025-06-18 18:11:24 -05:00
Nikolay Ermolovich
2eac2baa38 case sensitive is off (#19) 2025-06-18 09:21:03 -05:00
Daniel Carbone
f0e10f46ff 1.7.1 for windows and some small cleanup (#17)
* 171 for windows and some small cleanup

* startWith -> startsWith
2025-03-31 06:35:49 -05:00
Daniel Carbone
8f16b8ad5b remove ubuntu 20.04 from tests. 2025-03-29 22:45:14 -05:00
Daniel Carbone
26514abd65 always forget the dang readme. 2025-03-29 22:38:50 -05:00
Daniel Carbone
4e6d52de30 bumping default to jq 1.7.1 (#16)
* bumping default to jq 1.7.1
2025-03-29 22:36:49 -05:00
Daniel Carbone
8fd607321d Update README.md
fixing name in badge
2025-03-05 05:17:29 -06:00
8 changed files with 120 additions and 100 deletions

View File

@@ -1,5 +1,22 @@
name: "Setup jq Example - Linux"
# you may need to change this block for your purposes.
permissions:
actions: none
attestations: none
checks: none
contents: none
deployments: none
id-token: none
issues: none
models: none
discussions: none
packages: none
pages: none
pull-requests: none
security-events: none
statuses: none
on:
workflow_dispatch:
inputs:
@@ -7,7 +24,7 @@ on:
type: string
required: false
description: 'Version of jq to install'
default: '1.7'
default: '1.7.1'
force:
type: boolean
required: false

View File

@@ -1,5 +1,22 @@
name: "Setup jq Example - MacOS"
# you may need to change this block for your purposes.
permissions:
actions: none
attestations: none
checks: none
contents: none
deployments: none
id-token: none
issues: none
models: none
discussions: none
packages: none
pages: none
pull-requests: none
security-events: none
statuses: none
on:
workflow_dispatch:
inputs:
@@ -7,7 +24,7 @@ on:
type: string
required: false
description: 'Version of jq to install'
default: '1.7'
default: '1.7.1'
force:
type: boolean
required: false

View File

@@ -1,5 +1,22 @@
name: "Setup jq Example - Linux"
# you may need to change this block for your purposes.
permissions:
actions: none
attestations: none
checks: none
contents: none
deployments: none
id-token: none
issues: none
models: none
discussions: none
packages: none
pages: none
pull-requests: none
security-events: none
statuses: none
on:
workflow_dispatch:
inputs:
@@ -7,7 +24,7 @@ on:
type: string
required: false
description: 'Version of jq to install'
default: '1.7'
default: '1.7.1'
force:
type: boolean
required: false

View File

@@ -18,54 +18,47 @@ on:
branches:
- main
permissions:
actions: none
attestations: none
checks: none
contents: read
deployments: none
id-token: none
issues: none
models: none
discussions: none
packages: none
pages: none
pull-requests: none
security-events: none
statuses: none
concurrency:
group: '${{ github.workflow }}-${{ github.ref }}'
cancel-in-progress: true
jobs:
test-linux:
strategy:
matrix:
image:
- "ubuntu-latest"
- "ubuntu-20.04"
- "ubuntu-22.04"
- "ubuntu-24.04"
- "macos-latest"
- "macos-13"
- "macos-14"
- "macos-15"
- "windows-latest"
- "windows-2019"
- "macos-26"
- "windows-2022"
- "windows-2025"
force:
- 'true'
- 'false'
version:
- '1.7'
- '1.7.1'
- '1.8.0'
include:
- image: "ubuntu-latest"
version: '1.6'
force: true
- image: "ubuntu-latest"
version: '1.6'
force: false
- image: "ubuntu-latest"
version: '1.5'
force: true
- image: "ubuntu-latest"
version: '1.5'
force: false
- image: "ubuntu-20.04"
version: '1.6'
force: true
- image: "ubuntu-20.04"
version: '1.6'
force: false
- image: "ubuntu-20.04"
version: '1.5'
force: true
- image: "ubuntu-20.04"
version: '1.5'
force: false
- image: "ubuntu-22.04"
version: '1.6'
force: true
@@ -92,49 +85,36 @@ jobs:
version: '1.5'
force: false
- image: "windows-latest"
- image: "windows-2022"
version: '1.6'
force: true
- image: "windows-latest"
- image: "windows-2022"
version: '1.6'
force: false
- image: "windows-latest"
- image: "windows-2022"
version: '1.5'
force: true
- image: "windows-latest"
- image: "windows-2022"
version: '1.5'
force: false
- image: "windows-2019"
- image: "windows-2025"
version: '1.6'
force: true
- image: "windows-2019"
- image: "windows-2025"
version: '1.6'
force: false
- image: "windows-2019"
- image: "windows-2025"
version: '1.5'
force: true
- image: "windows-2019"
version: '1.5'
force: false
- image: "windows-2022"
version: '1.6'
force: true
- image: "windows-2022"
version: '1.6'
force: false
- image: "windows-2022"
version: '1.5'
force: true
- image: "windows-2022"
- image: "windows-2025"
version: '1.5'
force: false
name: "Test Action - (img: ${{ matrix.image }}; version: ${{ matrix.version }}; force: ${{ matrix.force }})"
runs-on: ${{ matrix.image }}
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- name: Setup jq
id: install-jq
@@ -168,15 +148,13 @@ jobs:
if: runner.os == 'Linux' || runner.os == 'macOS'
# language=sh
run: |
_installed='${{ steps.install-jq.outputs.installed }}'
_err=
if [[ '${{ matrix.force }}' == 'true' ]]; then
# enabling "force" must result in an install
if [[ '${{ steps.install-jq.outputs.installed }}' != 'true' ]]; then
echo 'Unexpected value for "installed":'
echo 'Expected: "true"'
echo 'Actual: "${{ steps.install-jq.outputs.installed }}"'
_err=1
exit 1
fi
else
if [[ '${{ steps.install-jq.outputs.found }}' == 'true' ]]; then
@@ -185,7 +163,7 @@ jobs:
echo 'Unexpected value for "installed":'
echo 'Expected: "false"'
echo 'Actual: "${{ steps.install-jq.outputs.installed }}"'
_err=1
exit 1
fi
else
# if not found, must be installed
@@ -193,12 +171,10 @@ jobs:
echo 'Unexpected value for "installed":'
echo 'Expected: "true"'
echo 'Actual: "${{ steps.install-jq.outputs.installed }}"'
_err=1
exit 1
fi
fi
fi
if [ -n "${_err}" ]; then exit 1; fi;
- name: Check jq - Windows-ish
if: runner.os == 'Windows' && matrix.force == 'true'
@@ -223,7 +199,6 @@ jobs:
$ErrorActionPreference = 'Stop'
Set-StrictMode -Version Latest
$_installed='${{ steps.install-jq.outputs.installed }}'
$_err = 0
if ("${{ matrix.force }}" -eq "true")
{
# enabling "force" must result in an install
@@ -232,7 +207,7 @@ jobs:
Write-Host "Unexpected value for installed"
Write-Host "Expected: true"
Write-Host "Actual: ${{ steps.install-jq.outputs.installed }}"
$_err=1
exit 1
}
}
else
@@ -245,7 +220,7 @@ jobs:
Write-Host "Unexpected value for installed"
Write-Host "Expected: false"
Write-Host "Actual: ${{ steps.install-jq.outputs.installed }}"
$_err=1
exit 1
}
}
else
@@ -255,21 +230,16 @@ jobs:
Write-Host "Unexpected value for installed"
Write-Host "Expected: true"
Write-Host "Actual: ${{ steps.install-jq.outputs.installed }}"
$_err=1
exit 1
}
}
}
if ("${_err}" -ne 0)
{
exit 1
}
test-container:
strategy:
matrix:
image:
- "ubuntu-24.04"
- "ubuntu-22.04"
- "ubuntu-20.04"
force:
- 'true'
- 'false'
@@ -277,12 +247,14 @@ jobs:
- '1.5'
- '1.6'
- '1.7'
- '1.7.1'
- '1.8.0'
name: "Test Action (Container) - (img: ${{ matrix.image }}; version: ${{ matrix.version }}; force: ${{ matrix.force }})"
runs-on: ${{ matrix.image }}
runs-on: '${{ matrix.image }}'
container:
image: node:20
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- name: Setup jq
id: install-jq
@@ -294,35 +266,31 @@ jobs:
- name: Check jq
# language=sh
run: |
_err=
_which="$(which jq)"
_vers="$(jq --version)"
if [[ "${_which}" != "$RUNNER_TOOL_CACHE/jq/jq" ]]; then
echo "jq found at unexpected path."
echo " Expected: \"$RUNNER_TOOL_CACHE/jq/jq\""
echo " Actual: \"${_which}\""
_err=1
exit 1
fi
if [[ "${_vers}" != 'jq-${{ matrix.version }}' ]]; then
echo "jq --version returned unexpected value"
echo ' Expected: "jq-${{ matrix.version }}"'
echo " Actual: \"${_vers}\""
_err=1
exit 1
fi
if [ -n "${_err}" ]; then exit 1; fi;
- name: Check Outputs
# language=sh
run: |
_installed='${{ steps.install-jq.outputs.installed }}'
_err=
if [[ '${{ matrix.force }}' == 'true' ]]; then
# enabling "force" must result in an install
if [[ '${{ steps.install-jq.outputs.installed }}' != 'true' ]]; then
echo 'Unexpected value for "installed":'
echo 'Expected: "true"'
echo 'Actual: "${{ steps.install-jq.outputs.installed }}"'
_err=1
exit 1
fi
else
if [[ '${{ steps.install-jq.outputs.found }}' == 'true' ]]; then
@@ -331,7 +299,7 @@ jobs:
echo 'Unexpected value for "installed":'
echo 'Expected: "false"'
echo 'Actual: "${{ steps.install-jq.outputs.installed }}"'
_err=1
exit 1
fi
else
# if not found, must be installed
@@ -339,8 +307,7 @@ jobs:
echo 'Unexpected value for "installed":'
echo 'Expected: "true"'
echo 'Actual: "${{ steps.install-jq.outputs.installed }}"'
_err=1
exit 1
fi
fi
fi
if [ -n "${_err}" ]; then exit 1; fi;

View File

@@ -1,10 +1,12 @@
# install-jq-action
Multiplatform [jq](https://github.com/stedolan/jq) installer action
[![Tests - Setup jq Action](https://github.com/dcarbone/install-jq-action/actions/workflows/tests.yaml/badge.svg)](https://github.com/dcarbone/install-jq-action/actions/workflows/tests.yaml)
[![Tests - Install jq Action](https://github.com/dcarbone/install-jq-action/actions/workflows/tests.yaml/badge.svg)](https://github.com/dcarbone/install-jq-action/actions/workflows/tests.yaml)
This action is tested against the following versions of JQ:
- [1.8.0](https://github.com/jqlang/jq/releases/tag/jq-1.8.0)
- [1.7.1](https://github.com/jqlang/jq/releases/tag/jq-1.7.1)
- [1.7](https://github.com/jqlang/jq/releases/tag/jq-1.7)
- [1.6](https://github.com/jqlang/jq/releases/tag/jq-1.6)
- [1.5](https://github.com/jqlang/jq/releases/tag/jq-1.5)
@@ -29,7 +31,7 @@ This action is tested against the following versions of JQ:
version:
required: false
description: "Version of jq to install"
default: "1.7"
default: "1.7.1"
```
This must be a version with a [corresponding release](https://github.com/stedolan/jq/releases).

View File

@@ -9,8 +9,8 @@ branding:
inputs:
version:
required: false
description: "Version of jq to install"
default: "1.7"
description: "Version of jq to install."
default: "1.7.1"
force:
required: false
description: "If 'true', does not check for existing jq installation before continuing."
@@ -40,16 +40,16 @@ runs:
echo "found=false" >> $GITHUB_OUTPUT
fi
- name: 'Install jq - Unix-ish non-1.7'
if: (runner.os == 'Linux' || runner.os == 'macOS') && (inputs.version == '1.5' || inputs.version == '1.6') && (steps.jq-check-unix.outputs.found == 'false' || inputs.force == 'true')
- name: 'Install jq - Unix-ish sub-1.7'
if: (runner.os == 'Linux' || runner.os == 'macOS') && (startsWith(inputs.version, '1.5') || startsWith(inputs.version, '1.6')) && (steps.jq-check-unix.outputs.found == 'false' || inputs.force == 'true')
shell: sh
env:
JQ_VERSION: '${{ inputs.version }}'
# language=sh
run: ${GITHUB_ACTION_PATH}/scripts/unixish.sh
- name: 'Install jq - Unix-ish 1.7'
if: (runner.os == 'Linux' || runner.os == 'macOS') && inputs.version == '1.7' && (steps.jq-check-unix.outputs.found == 'false' || inputs.force == 'true')
- name: 'Install jq - Unix-ish 1.7+'
if: (runner.os == 'Linux' || runner.os == 'macOS') && (startsWith(inputs.version, '1.7') || startsWith(inputs.version, '1.8')) && (steps.jq-check-unix.outputs.found == 'false' || inputs.force == 'true')
shell: sh
env:
JQ_VERSION: '${{ inputs.version }}'
@@ -71,15 +71,15 @@ runs:
Add-Content $Env:GITHUB_OUTPUT "found=false"
}
- name: 'Install jq - Windows-ish non-1.7'
if: runner.os == 'Windows' && (inputs.version == '1.5' || inputs.version == '1.6') && (steps.jq-check-windows.outputs.found == 'false' || inputs.force == 'true')
- name: 'Install jq - Windows-ish sub-1.7'
if: runner.os == 'Windows' && (startsWith(inputs.version, '1.5') || startsWith(inputs.version, '1.6')) && (steps.jq-check-windows.outputs.found == 'false' || inputs.force == 'true')
shell: powershell
env:
JQ_VERSION: '${{ inputs.version }}'
run: ${{ github.action_path }}\scripts\windowsish.ps1
- name: 'Install jq - Windows-ish 1.7'
if: runner.os == 'Windows' && inputs.version == '1.7' && (steps.jq-check-windows.outputs.found == 'false' || inputs.force == 'true')
- name: 'Install jq - Windows-ish 1.7+'
if: runner.os == 'Windows' && (startsWith(inputs.version, '1.7') || startsWith(inputs.version, '1.8')) && (steps.jq-check-windows.outputs.found == 'false' || inputs.force == 'true')
shell: powershell
env:
JQ_VERSION: '${{ inputs.version }}'

View File

@@ -19,10 +19,10 @@ _dl_path=
_dl_url=
case $RUNNER_OS in
Linux)
[Ll]inux)
_os='linux'
;;
macOS)
mac[Oo][Ss])
_os='macos'
;;

View File

@@ -17,10 +17,10 @@ _dl_path=
_dl_url=
case $RUNNER_OS in
Linux)
[Ll]inux)
_os='linux'
;;
macOS)
mac[Oo][Ss])
_os='osx'
;;