A GitHub Action that provides yq, a lightweight and portable command-line YAML, JSON, INI and XML processor. yq uses jq-like syntax but works with yaml files as well as json, xml, ini, properties, csv and tsv.
- name: Set foobar to cool
uses: step-security/mikefarah-yq@v4
with:
cmd: yq -i '.foo.bar = "cool"' 'config.yml'
- name: Get an entry with a variable that might contain dots or spaces
id: get_username
uses: step-security/mikefarah-yq@v4
with:
cmd: yq '.all.children.["${{ matrix.ip_address }}"].username' ops/inventories/production.yml
- name: Reuse a variable obtained in another step
run: echo ${{ steps.get_username.outputs.result }}| Input | Description | Required |
|---|---|---|
cmd |
The yq command to run | Yes |
| Output | Description |
|---|---|
result |
The complete result from the yq command being run |
See yq documentation for detailed usage of the yq tool itself.
