Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sergeysova/jq-action
This lets you do jq operations in GitHub Actions.
https://github.com/sergeysova/jq-action
Last synced: 12 days ago
JSON representation
This lets you do jq operations in GitHub Actions.
- Host: GitHub
- URL: https://github.com/sergeysova/jq-action
- Owner: sergeysova
- License: other
- Fork: true (r26D/jq-action)
- Created: 2020-10-27T10:48:17.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2023-02-15T08:18:09.000Z (over 1 year ago)
- Last Synced: 2024-10-15T19:32:41.385Z (22 days ago)
- Language: Shell
- Size: 23.4 KB
- Stars: 54
- Watchers: 0
- Forks: 18
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Run jq
Run jq on your data and get result as output
## Inputs
### `cmd`
**Required** This is the actual command that will be passed along### `multiline`
Optional. Default `false`.| Value | Behavior |
| - | - |
| true | Multiple lines of output will be captured. Useful for capturing lists. |
| false | Only the first line of the output will be captured. The rest will be written to stdout. |## Outputs
### `value`
This is the actual result of the command executing## Example usage
```yaml
uses: sergeysova/jq-action@v2
with:
cmd: jq -n env
```## Using output
```yaml
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Extract version from package.json
uses: sergeysova/jq-action@v2
id: version
with:
cmd: 'jq .version package.json -r'
- name: Show my version
run: 'echo "version ${{ steps.version.outputs.value }}"'
```## Using multiline output
```yaml
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Extract all keywords from package.json
uses: sergeysova/jq-action@v2
id: keywords
with:
cmd: 'jq .keywords[] package.json -r'
multiline: true
- name: Show keywords
run: |
keywords="${{ steps.keywords.outputs.value }}"
for keyword in $keywords; do
echo "$keyword"
done
```