Skip to content

flex-development/jq-action

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

jq

github release test module type: esm license conventional commits yarn

A jq utility for GitHub Actions

Contents

What is this?

This is a simple, but useful, action for executing JSON queries with jq.

Use

---
name: format
on:
  - pull_request
  - push
jobs:
  preflight:
    runs-on: ubuntu-latest
    steps:
      - id: checkout
        name: Checkout ${{ github.head_ref || github.ref_name }}
        uses: actions/checkout@v5.0.0
        with:
          persist-credentials: false
          ref: ${{ github.head_ref || github.ref }}
      - id: version
        name: Get dprint version
        uses: flex-development/jq-action@1.0.0
        with:
          data: package.json
          filter: .devDependencies.dprint
      - id: check
        name: Check formatting
        uses: dprint/check@v2.3
        with:
          args: --config-discovery=false --incremental=false --log-level=info
          config-path: .dprint.jsonc
          dprint-version: ${{ steps.version.outputs.result }}

See .github/workflows/test.yml for more usage examples.

Inputs

data

The data to operate on.

filter

The filter to apply.

The simplest filter is ., which copies jq's input to its output unmodified (except for formatting). For more advanced filters, see https://jqlang.github.io/jq/manual.

options

The command options to apply (optional).

raw

default: true

Shortcut for the raw output option, -r.

With this option, if the result of the filter is a string, it will not be formatted as a JSON string with escapes and quotes.

Outputs

result

The result of the filter.

Related

Contribute

See CONTRIBUTING.md.

This project has a code of conduct. By interacting with this repository, organization, or community you agree to abide by its terms.