mirror of
https://github.com/dcarbone/install-jq-action.git
synced 2026-02-12 11:06:55 +08:00
Compare commits
18 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b39bdc213c | ||
|
|
737621eb07 | ||
|
|
04b1c990a4 | ||
|
|
58388b8d70 | ||
|
|
2bd1830d1d | ||
|
|
d3f1c094e8 | ||
|
|
b7ef57d46e | ||
|
|
2eac2baa38 | ||
|
|
f0e10f46ff | ||
|
|
8f16b8ad5b | ||
|
|
26514abd65 | ||
|
|
4e6d52de30 | ||
|
|
8fd607321d | ||
|
|
e397bd8743 | ||
|
|
36b228ee68 | ||
|
|
d5935278d5 | ||
|
|
ca8101273e | ||
|
|
de7c0d1fb1 |
6
.github/dependabot.yml
vendored
Normal file
6
.github/dependabot.yml
vendored
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
version: 2
|
||||||
|
updates:
|
||||||
|
- package-ecosystem: "github-actions"
|
||||||
|
directory: "/"
|
||||||
|
schedule:
|
||||||
|
interval: "weekly"
|
||||||
21
.github/workflows/example-linux.yaml
vendored
21
.github/workflows/example-linux.yaml
vendored
@@ -1,5 +1,22 @@
|
|||||||
name: "Setup jq Example - Linux"
|
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:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
inputs:
|
||||||
@@ -7,7 +24,7 @@ on:
|
|||||||
type: string
|
type: string
|
||||||
required: false
|
required: false
|
||||||
description: 'Version of jq to install'
|
description: 'Version of jq to install'
|
||||||
default: '1.7'
|
default: '1.7.1'
|
||||||
force:
|
force:
|
||||||
type: boolean
|
type: boolean
|
||||||
required: false
|
required: false
|
||||||
@@ -19,7 +36,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: 'Setup jq'
|
- name: 'Setup jq'
|
||||||
uses: dcarbone/install-jq-action@v2
|
uses: dcarbone/install-jq-action@v3
|
||||||
with:
|
with:
|
||||||
version: '${{ inputs.version }}'
|
version: '${{ inputs.version }}'
|
||||||
force: '${{ inputs.force }}'
|
force: '${{ inputs.force }}'
|
||||||
|
|||||||
21
.github/workflows/example-macos.yaml
vendored
21
.github/workflows/example-macos.yaml
vendored
@@ -1,5 +1,22 @@
|
|||||||
name: "Setup jq Example - MacOS"
|
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:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
inputs:
|
||||||
@@ -7,7 +24,7 @@ on:
|
|||||||
type: string
|
type: string
|
||||||
required: false
|
required: false
|
||||||
description: 'Version of jq to install'
|
description: 'Version of jq to install'
|
||||||
default: '1.7'
|
default: '1.7.1'
|
||||||
force:
|
force:
|
||||||
type: boolean
|
type: boolean
|
||||||
required: false
|
required: false
|
||||||
@@ -19,7 +36,7 @@ jobs:
|
|||||||
runs-on: macos-latest
|
runs-on: macos-latest
|
||||||
steps:
|
steps:
|
||||||
- name: 'Setup jq'
|
- name: 'Setup jq'
|
||||||
uses: dcarbone/install-jq-action@v2
|
uses: dcarbone/install-jq-action@v3
|
||||||
with:
|
with:
|
||||||
version: '${{ inputs.version }}'
|
version: '${{ inputs.version }}'
|
||||||
force: '${{ inputs.force }}'
|
force: '${{ inputs.force }}'
|
||||||
|
|||||||
21
.github/workflows/example-windows.yaml
vendored
21
.github/workflows/example-windows.yaml
vendored
@@ -1,5 +1,22 @@
|
|||||||
name: "Setup jq Example - Linux"
|
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:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
inputs:
|
||||||
@@ -7,7 +24,7 @@ on:
|
|||||||
type: string
|
type: string
|
||||||
required: false
|
required: false
|
||||||
description: 'Version of jq to install'
|
description: 'Version of jq to install'
|
||||||
default: '1.7'
|
default: '1.7.1'
|
||||||
force:
|
force:
|
||||||
type: boolean
|
type: boolean
|
||||||
required: false
|
required: false
|
||||||
@@ -19,7 +36,7 @@ jobs:
|
|||||||
runs-on: windows-latest
|
runs-on: windows-latest
|
||||||
steps:
|
steps:
|
||||||
- name: 'Setup jq'
|
- name: 'Setup jq'
|
||||||
uses: dcarbone/install-jq-action@v2
|
uses: dcarbone/install-jq-action@v3
|
||||||
with:
|
with:
|
||||||
version: '${{ inputs.version }}'
|
version: '${{ inputs.version }}'
|
||||||
force: '${{ inputs.force }}'
|
force: '${{ inputs.force }}'
|
||||||
|
|||||||
136
.github/workflows/tests.yaml
vendored
136
.github/workflows/tests.yaml
vendored
@@ -18,29 +18,103 @@ on:
|
|||||||
branches:
|
branches:
|
||||||
- main
|
- 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:
|
jobs:
|
||||||
test-linux:
|
test-linux:
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
image:
|
image:
|
||||||
- "ubuntu-22.04"
|
- "ubuntu-22.04"
|
||||||
- "ubuntu-20.04"
|
- "ubuntu-24.04"
|
||||||
- "macos-13"
|
- "macos-13"
|
||||||
- "macos-11"
|
- "macos-14"
|
||||||
- "macos-12"
|
- "macos-15"
|
||||||
|
- "macos-26"
|
||||||
- "windows-2022"
|
- "windows-2022"
|
||||||
- "windows-2019"
|
- "windows-2025"
|
||||||
force:
|
force:
|
||||||
- 'true'
|
- 'true'
|
||||||
- 'false'
|
- 'false'
|
||||||
version:
|
version:
|
||||||
- '1.5'
|
|
||||||
- '1.6'
|
|
||||||
- '1.7'
|
- '1.7'
|
||||||
|
- '1.7.1'
|
||||||
|
- '1.8.0'
|
||||||
|
include:
|
||||||
|
- image: "ubuntu-22.04"
|
||||||
|
version: '1.6'
|
||||||
|
force: true
|
||||||
|
- image: "ubuntu-22.04"
|
||||||
|
version: '1.6'
|
||||||
|
force: false
|
||||||
|
- image: "ubuntu-22.04"
|
||||||
|
version: '1.5'
|
||||||
|
force: true
|
||||||
|
- image: "ubuntu-22.04"
|
||||||
|
version: '1.5'
|
||||||
|
force: false
|
||||||
|
|
||||||
|
- image: "ubuntu-24.04"
|
||||||
|
version: '1.6'
|
||||||
|
force: true
|
||||||
|
- image: "ubuntu-24.04"
|
||||||
|
version: '1.6'
|
||||||
|
force: false
|
||||||
|
- image: "ubuntu-24.04"
|
||||||
|
version: '1.5'
|
||||||
|
force: true
|
||||||
|
- image: "ubuntu-24.04"
|
||||||
|
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"
|
||||||
|
version: '1.5'
|
||||||
|
force: false
|
||||||
|
|
||||||
|
- image: "windows-2025"
|
||||||
|
version: '1.6'
|
||||||
|
force: true
|
||||||
|
- image: "windows-2025"
|
||||||
|
version: '1.6'
|
||||||
|
force: false
|
||||||
|
- image: "windows-2025"
|
||||||
|
version: '1.5'
|
||||||
|
force: true
|
||||||
|
- image: "windows-2025"
|
||||||
|
version: '1.5'
|
||||||
|
force: false
|
||||||
|
|
||||||
name: "Test Action - (img: ${{ matrix.image }}; version: ${{ matrix.version }}; force: ${{ matrix.force }})"
|
name: "Test Action - (img: ${{ matrix.image }}; version: ${{ matrix.version }}; force: ${{ matrix.force }})"
|
||||||
runs-on: ${{ matrix.image }}
|
runs-on: ${{ matrix.image }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v6
|
||||||
|
|
||||||
- name: Setup jq
|
- name: Setup jq
|
||||||
id: install-jq
|
id: install-jq
|
||||||
@@ -74,15 +148,13 @@ jobs:
|
|||||||
if: runner.os == 'Linux' || runner.os == 'macOS'
|
if: runner.os == 'Linux' || runner.os == 'macOS'
|
||||||
# language=sh
|
# language=sh
|
||||||
run: |
|
run: |
|
||||||
_installed='${{ steps.install-jq.outputs.installed }}'
|
|
||||||
_err=
|
|
||||||
if [[ '${{ matrix.force }}' == 'true' ]]; then
|
if [[ '${{ matrix.force }}' == 'true' ]]; then
|
||||||
# enabling "force" must result in an install
|
# enabling "force" must result in an install
|
||||||
if [[ '${{ steps.install-jq.outputs.installed }}' != 'true' ]]; then
|
if [[ '${{ steps.install-jq.outputs.installed }}' != 'true' ]]; then
|
||||||
echo 'Unexpected value for "installed":'
|
echo 'Unexpected value for "installed":'
|
||||||
echo 'Expected: "true"'
|
echo 'Expected: "true"'
|
||||||
echo 'Actual: "${{ steps.install-jq.outputs.installed }}"'
|
echo 'Actual: "${{ steps.install-jq.outputs.installed }}"'
|
||||||
_err=1
|
exit 1
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
if [[ '${{ steps.install-jq.outputs.found }}' == 'true' ]]; then
|
if [[ '${{ steps.install-jq.outputs.found }}' == 'true' ]]; then
|
||||||
@@ -91,7 +163,7 @@ jobs:
|
|||||||
echo 'Unexpected value for "installed":'
|
echo 'Unexpected value for "installed":'
|
||||||
echo 'Expected: "false"'
|
echo 'Expected: "false"'
|
||||||
echo 'Actual: "${{ steps.install-jq.outputs.installed }}"'
|
echo 'Actual: "${{ steps.install-jq.outputs.installed }}"'
|
||||||
_err=1
|
exit 1
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
# if not found, must be installed
|
# if not found, must be installed
|
||||||
@@ -99,12 +171,10 @@ jobs:
|
|||||||
echo 'Unexpected value for "installed":'
|
echo 'Unexpected value for "installed":'
|
||||||
echo 'Expected: "true"'
|
echo 'Expected: "true"'
|
||||||
echo 'Actual: "${{ steps.install-jq.outputs.installed }}"'
|
echo 'Actual: "${{ steps.install-jq.outputs.installed }}"'
|
||||||
_err=1
|
exit 1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
if [ -n "${_err}" ]; then exit 1; fi;
|
|
||||||
|
|
||||||
|
|
||||||
- name: Check jq - Windows-ish
|
- name: Check jq - Windows-ish
|
||||||
if: runner.os == 'Windows' && matrix.force == 'true'
|
if: runner.os == 'Windows' && matrix.force == 'true'
|
||||||
@@ -129,7 +199,6 @@ jobs:
|
|||||||
$ErrorActionPreference = 'Stop'
|
$ErrorActionPreference = 'Stop'
|
||||||
Set-StrictMode -Version Latest
|
Set-StrictMode -Version Latest
|
||||||
$_installed='${{ steps.install-jq.outputs.installed }}'
|
$_installed='${{ steps.install-jq.outputs.installed }}'
|
||||||
$_err = 0
|
|
||||||
if ("${{ matrix.force }}" -eq "true")
|
if ("${{ matrix.force }}" -eq "true")
|
||||||
{
|
{
|
||||||
# enabling "force" must result in an install
|
# enabling "force" must result in an install
|
||||||
@@ -138,7 +207,7 @@ jobs:
|
|||||||
Write-Host "Unexpected value for installed"
|
Write-Host "Unexpected value for installed"
|
||||||
Write-Host "Expected: true"
|
Write-Host "Expected: true"
|
||||||
Write-Host "Actual: ${{ steps.install-jq.outputs.installed }}"
|
Write-Host "Actual: ${{ steps.install-jq.outputs.installed }}"
|
||||||
$_err=1
|
exit 1
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -151,7 +220,7 @@ jobs:
|
|||||||
Write-Host "Unexpected value for installed"
|
Write-Host "Unexpected value for installed"
|
||||||
Write-Host "Expected: false"
|
Write-Host "Expected: false"
|
||||||
Write-Host "Actual: ${{ steps.install-jq.outputs.installed }}"
|
Write-Host "Actual: ${{ steps.install-jq.outputs.installed }}"
|
||||||
$_err=1
|
exit 1
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -161,20 +230,16 @@ jobs:
|
|||||||
Write-Host "Unexpected value for installed"
|
Write-Host "Unexpected value for installed"
|
||||||
Write-Host "Expected: true"
|
Write-Host "Expected: true"
|
||||||
Write-Host "Actual: ${{ steps.install-jq.outputs.installed }}"
|
Write-Host "Actual: ${{ steps.install-jq.outputs.installed }}"
|
||||||
$_err=1
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if ("${_err}" -ne 0)
|
|
||||||
{
|
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
test-container:
|
test-container:
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
image:
|
image:
|
||||||
|
- "ubuntu-24.04"
|
||||||
- "ubuntu-22.04"
|
- "ubuntu-22.04"
|
||||||
- "ubuntu-20.04"
|
|
||||||
force:
|
force:
|
||||||
- 'true'
|
- 'true'
|
||||||
- 'false'
|
- 'false'
|
||||||
@@ -182,12 +247,14 @@ jobs:
|
|||||||
- '1.5'
|
- '1.5'
|
||||||
- '1.6'
|
- '1.6'
|
||||||
- '1.7'
|
- '1.7'
|
||||||
|
- '1.7.1'
|
||||||
|
- '1.8.0'
|
||||||
name: "Test Action (Container) - (img: ${{ matrix.image }}; version: ${{ matrix.version }}; force: ${{ matrix.force }})"
|
name: "Test Action (Container) - (img: ${{ matrix.image }}; version: ${{ matrix.version }}; force: ${{ matrix.force }})"
|
||||||
runs-on: ${{ matrix.image }}
|
runs-on: '${{ matrix.image }}'
|
||||||
container:
|
container:
|
||||||
image: node:18.12.1
|
image: node:20
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v6
|
||||||
|
|
||||||
- name: Setup jq
|
- name: Setup jq
|
||||||
id: install-jq
|
id: install-jq
|
||||||
@@ -199,35 +266,31 @@ jobs:
|
|||||||
- name: Check jq
|
- name: Check jq
|
||||||
# language=sh
|
# language=sh
|
||||||
run: |
|
run: |
|
||||||
_err=
|
|
||||||
_which="$(which jq)"
|
_which="$(which jq)"
|
||||||
_vers="$(jq --version)"
|
_vers="$(jq --version)"
|
||||||
if [[ "${_which}" != "$RUNNER_TOOL_CACHE/jq/jq" ]]; then
|
if [[ "${_which}" != "$RUNNER_TOOL_CACHE/jq/jq" ]]; then
|
||||||
echo "jq found at unexpected path."
|
echo "jq found at unexpected path."
|
||||||
echo " Expected: \"$RUNNER_TOOL_CACHE/jq/jq\""
|
echo " Expected: \"$RUNNER_TOOL_CACHE/jq/jq\""
|
||||||
echo " Actual: \"${_which}\""
|
echo " Actual: \"${_which}\""
|
||||||
_err=1
|
exit 1
|
||||||
fi
|
fi
|
||||||
if [[ "${_vers}" != 'jq-${{ matrix.version }}' ]]; then
|
if [[ "${_vers}" != 'jq-${{ matrix.version }}' ]]; then
|
||||||
echo "jq --version returned unexpected value"
|
echo "jq --version returned unexpected value"
|
||||||
echo ' Expected: "jq-${{ matrix.version }}"'
|
echo ' Expected: "jq-${{ matrix.version }}"'
|
||||||
echo " Actual: \"${_vers}\""
|
echo " Actual: \"${_vers}\""
|
||||||
_err=1
|
exit 1
|
||||||
fi
|
fi
|
||||||
if [ -n "${_err}" ]; then exit 1; fi;
|
|
||||||
|
|
||||||
- name: Check Outputs
|
- name: Check Outputs
|
||||||
# language=sh
|
# language=sh
|
||||||
run: |
|
run: |
|
||||||
_installed='${{ steps.install-jq.outputs.installed }}'
|
|
||||||
_err=
|
|
||||||
if [[ '${{ matrix.force }}' == 'true' ]]; then
|
if [[ '${{ matrix.force }}' == 'true' ]]; then
|
||||||
# enabling "force" must result in an install
|
# enabling "force" must result in an install
|
||||||
if [[ '${{ steps.install-jq.outputs.installed }}' != 'true' ]]; then
|
if [[ '${{ steps.install-jq.outputs.installed }}' != 'true' ]]; then
|
||||||
echo 'Unexpected value for "installed":'
|
echo 'Unexpected value for "installed":'
|
||||||
echo 'Expected: "true"'
|
echo 'Expected: "true"'
|
||||||
echo 'Actual: "${{ steps.install-jq.outputs.installed }}"'
|
echo 'Actual: "${{ steps.install-jq.outputs.installed }}"'
|
||||||
_err=1
|
exit 1
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
if [[ '${{ steps.install-jq.outputs.found }}' == 'true' ]]; then
|
if [[ '${{ steps.install-jq.outputs.found }}' == 'true' ]]; then
|
||||||
@@ -236,7 +299,7 @@ jobs:
|
|||||||
echo 'Unexpected value for "installed":'
|
echo 'Unexpected value for "installed":'
|
||||||
echo 'Expected: "false"'
|
echo 'Expected: "false"'
|
||||||
echo 'Actual: "${{ steps.install-jq.outputs.installed }}"'
|
echo 'Actual: "${{ steps.install-jq.outputs.installed }}"'
|
||||||
_err=1
|
exit 1
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
# if not found, must be installed
|
# if not found, must be installed
|
||||||
@@ -244,8 +307,7 @@ jobs:
|
|||||||
echo 'Unexpected value for "installed":'
|
echo 'Unexpected value for "installed":'
|
||||||
echo 'Expected: "true"'
|
echo 'Expected: "true"'
|
||||||
echo 'Actual: "${{ steps.install-jq.outputs.installed }}"'
|
echo 'Actual: "${{ steps.install-jq.outputs.installed }}"'
|
||||||
_err=1
|
exit 1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
if [ -n "${_err}" ]; then exit 1; fi;
|
|
||||||
|
|||||||
@@ -1,10 +1,12 @@
|
|||||||
# install-jq-action
|
# install-jq-action
|
||||||
Multiplatform [jq](https://github.com/stedolan/jq) installer action
|
Multiplatform [jq](https://github.com/stedolan/jq) installer action
|
||||||
|
|
||||||
[](https://github.com/dcarbone/install-jq-action/actions/workflows/tests.yaml)
|
[](https://github.com/dcarbone/install-jq-action/actions/workflows/tests.yaml)
|
||||||
|
|
||||||
This action is tested against the following versions of JQ:
|
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.7](https://github.com/jqlang/jq/releases/tag/jq-1.7)
|
||||||
- [1.6](https://github.com/jqlang/jq/releases/tag/jq-1.6)
|
- [1.6](https://github.com/jqlang/jq/releases/tag/jq-1.6)
|
||||||
- [1.5](https://github.com/jqlang/jq/releases/tag/jq-1.5)
|
- [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:
|
version:
|
||||||
required: false
|
required: false
|
||||||
description: "Version of jq to install"
|
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).
|
This must be a version with a [corresponding release](https://github.com/stedolan/jq/releases).
|
||||||
|
|||||||
26
action.yaml
26
action.yaml
@@ -9,8 +9,8 @@ branding:
|
|||||||
inputs:
|
inputs:
|
||||||
version:
|
version:
|
||||||
required: false
|
required: false
|
||||||
description: "Version of jq to install"
|
description: "Version of jq to install."
|
||||||
default: "1.7"
|
default: "1.7.1"
|
||||||
force:
|
force:
|
||||||
required: false
|
required: false
|
||||||
description: "If 'true', does not check for existing jq installation before continuing."
|
description: "If 'true', does not check for existing jq installation before continuing."
|
||||||
@@ -30,7 +30,7 @@ runs:
|
|||||||
- name: 'Check for jq - Unix-ish'
|
- name: 'Check for jq - Unix-ish'
|
||||||
id: jq-check-unix
|
id: jq-check-unix
|
||||||
if: (runner.os == 'Linux' || runner.os == 'macOS')
|
if: (runner.os == 'Linux' || runner.os == 'macOS')
|
||||||
shell: bash +e {0}
|
shell: sh +e {0}
|
||||||
# language=sh
|
# language=sh
|
||||||
run: |
|
run: |
|
||||||
_jq_bin="$(which jq)"
|
_jq_bin="$(which jq)"
|
||||||
@@ -40,17 +40,17 @@ runs:
|
|||||||
echo "found=false" >> $GITHUB_OUTPUT
|
echo "found=false" >> $GITHUB_OUTPUT
|
||||||
fi
|
fi
|
||||||
|
|
||||||
- name: 'Install jq - Unix-ish non-1.7'
|
- name: 'Install jq - Unix-ish sub-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')
|
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: bash
|
shell: sh
|
||||||
env:
|
env:
|
||||||
JQ_VERSION: '${{ inputs.version }}'
|
JQ_VERSION: '${{ inputs.version }}'
|
||||||
# language=sh
|
# language=sh
|
||||||
run: ${GITHUB_ACTION_PATH}/scripts/unixish.sh
|
run: ${GITHUB_ACTION_PATH}/scripts/unixish.sh
|
||||||
|
|
||||||
- name: 'Install jq - Unix-ish 1.7'
|
- 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')
|
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: bash
|
shell: sh
|
||||||
env:
|
env:
|
||||||
JQ_VERSION: '${{ inputs.version }}'
|
JQ_VERSION: '${{ inputs.version }}'
|
||||||
# language=sh
|
# language=sh
|
||||||
@@ -71,15 +71,15 @@ runs:
|
|||||||
Add-Content $Env:GITHUB_OUTPUT "found=false"
|
Add-Content $Env:GITHUB_OUTPUT "found=false"
|
||||||
}
|
}
|
||||||
|
|
||||||
- name: 'Install jq - Windows-ish non-1.7'
|
- name: 'Install jq - Windows-ish sub-1.7'
|
||||||
if: runner.os == 'Windows' && (inputs.version == '1.5' || inputs.version == '1.6') && (steps.jq-check-windows.outputs.found == 'false' || inputs.force == 'true')
|
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
|
shell: powershell
|
||||||
env:
|
env:
|
||||||
JQ_VERSION: '${{ inputs.version }}'
|
JQ_VERSION: '${{ inputs.version }}'
|
||||||
run: ${{ github.action_path }}\scripts\windowsish.ps1
|
run: ${{ github.action_path }}\scripts\windowsish.ps1
|
||||||
|
|
||||||
- name: 'Install jq - Windows-ish 1.7'
|
- 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')
|
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
|
shell: powershell
|
||||||
env:
|
env:
|
||||||
JQ_VERSION: '${{ inputs.version }}'
|
JQ_VERSION: '${{ inputs.version }}'
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#!/usr/bin/env bash
|
#!/bin/sh
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
@@ -19,10 +19,10 @@ _dl_path=
|
|||||||
_dl_url=
|
_dl_url=
|
||||||
|
|
||||||
case $RUNNER_OS in
|
case $RUNNER_OS in
|
||||||
Linux)
|
[Ll]inux)
|
||||||
_os='linux'
|
_os='linux'
|
||||||
;;
|
;;
|
||||||
macOS)
|
mac[Oo][Ss])
|
||||||
_os='macos'
|
_os='macos'
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#!/usr/bin/env bash
|
#!/bin/sh
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
@@ -17,10 +17,10 @@ _dl_path=
|
|||||||
_dl_url=
|
_dl_url=
|
||||||
|
|
||||||
case $RUNNER_OS in
|
case $RUNNER_OS in
|
||||||
Linux)
|
[Ll]inux)
|
||||||
_os='linux'
|
_os='linux'
|
||||||
;;
|
;;
|
||||||
macOS)
|
mac[Oo][Ss])
|
||||||
_os='osx'
|
_os='osx'
|
||||||
;;
|
;;
|
||||||
|
|
||||||
@@ -54,7 +54,7 @@ esac
|
|||||||
|
|
||||||
# determine binary name
|
# determine binary name
|
||||||
|
|
||||||
if [[ "${_os}" == "linux" ]]; then
|
if [ "${_os}" = "linux" ]; then
|
||||||
case "${_arch}" in
|
case "${_arch}" in
|
||||||
'386')
|
'386')
|
||||||
_bin_name="jq-linux32"
|
_bin_name="jq-linux32"
|
||||||
|
|||||||
Reference in New Issue
Block a user