mirror of
https://github.com/dcarbone/install-jq-action.git
synced 2026-02-12 11:06:55 +08:00
Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b39bdc213c | ||
|
|
737621eb07 | ||
|
|
04b1c990a4 | ||
|
|
58388b8d70 | ||
|
|
2bd1830d1d | ||
|
|
d3f1c094e8 | ||
|
|
b7ef57d46e | ||
|
|
2eac2baa38 |
19
.github/workflows/example-linux.yaml
vendored
19
.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
.github/workflows/example-macos.yaml
vendored
19
.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
.github/workflows/example-windows.yaml
vendored
19
.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
|
||||||
|
|||||||
76
.github/workflows/tests.yaml
vendored
76
.github/workflows/tests.yaml
vendored
@@ -18,41 +18,47 @@ 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-latest"
|
|
||||||
- "ubuntu-22.04"
|
- "ubuntu-22.04"
|
||||||
- "ubuntu-24.04"
|
- "ubuntu-24.04"
|
||||||
- "macos-latest"
|
|
||||||
- "macos-13"
|
- "macos-13"
|
||||||
- "macos-14"
|
- "macos-14"
|
||||||
- "macos-15"
|
- "macos-15"
|
||||||
- "windows-latest"
|
- "macos-26"
|
||||||
- "windows-2019"
|
|
||||||
- "windows-2022"
|
- "windows-2022"
|
||||||
|
- "windows-2025"
|
||||||
force:
|
force:
|
||||||
- 'true'
|
- 'true'
|
||||||
- 'false'
|
- 'false'
|
||||||
version:
|
version:
|
||||||
- '1.7'
|
- '1.7'
|
||||||
- '1.7.1'
|
- '1.7.1'
|
||||||
|
- '1.8.0'
|
||||||
include:
|
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-22.04"
|
- image: "ubuntu-22.04"
|
||||||
version: '1.6'
|
version: '1.6'
|
||||||
force: true
|
force: true
|
||||||
@@ -79,49 +85,36 @@ jobs:
|
|||||||
version: '1.5'
|
version: '1.5'
|
||||||
force: false
|
force: false
|
||||||
|
|
||||||
- image: "windows-latest"
|
- image: "windows-2022"
|
||||||
version: '1.6'
|
version: '1.6'
|
||||||
force: true
|
force: true
|
||||||
- image: "windows-latest"
|
- image: "windows-2022"
|
||||||
version: '1.6'
|
version: '1.6'
|
||||||
force: false
|
force: false
|
||||||
- image: "windows-latest"
|
- image: "windows-2022"
|
||||||
version: '1.5'
|
version: '1.5'
|
||||||
force: true
|
force: true
|
||||||
- image: "windows-latest"
|
- image: "windows-2022"
|
||||||
version: '1.5'
|
version: '1.5'
|
||||||
force: false
|
force: false
|
||||||
|
|
||||||
- image: "windows-2019"
|
- image: "windows-2025"
|
||||||
version: '1.6'
|
version: '1.6'
|
||||||
force: true
|
force: true
|
||||||
- image: "windows-2019"
|
- image: "windows-2025"
|
||||||
version: '1.6'
|
version: '1.6'
|
||||||
force: false
|
force: false
|
||||||
- image: "windows-2019"
|
- image: "windows-2025"
|
||||||
version: '1.5'
|
version: '1.5'
|
||||||
force: true
|
force: true
|
||||||
- image: "windows-2019"
|
- image: "windows-2025"
|
||||||
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'
|
version: '1.5'
|
||||||
force: false
|
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
|
||||||
@@ -255,12 +248,13 @@ jobs:
|
|||||||
- '1.6'
|
- '1.6'
|
||||||
- '1.7'
|
- '1.7'
|
||||||
- '1.7.1'
|
- '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:20
|
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
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ Multiplatform [jq](https://github.com/stedolan/jq) installer action
|
|||||||
|
|
||||||
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.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)
|
||||||
|
|||||||
12
action.yaml
12
action.yaml
@@ -40,7 +40,7 @@ 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') && (startsWith(inputs.version, '1.5') || startsWith(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: sh
|
shell: sh
|
||||||
env:
|
env:
|
||||||
@@ -48,8 +48,8 @@ runs:
|
|||||||
# 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') && startsWith(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: sh
|
shell: sh
|
||||||
env:
|
env:
|
||||||
JQ_VERSION: '${{ inputs.version }}'
|
JQ_VERSION: '${{ inputs.version }}'
|
||||||
@@ -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' && (startsWith(inputs.version, '1.5') || startsWith(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' && startsWith(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 }}'
|
||||||
|
|||||||
@@ -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'
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
|||||||
@@ -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'
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user