Skip to content

get-celq/celq-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

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Celq GitHub Action

Run celq commands in your GitHub Actions workflows.

Usage

- name: Example Celq Action
  id: exampleID
  uses: get-celq/celq-action@main
  with:
    cmd: celq 'this.exampleID' < example.json

- name: Reuse a variable obtained in another step
  run: echo ${{ steps.exampleID.outputs.result }}

Inputs

cmd (required)

The command to run. This can be any shell command that includes celq, such as:

  • celq 'this.field' < input.json
  • curl https://api.example.com/data | celq 'this.items.filter(x, x.has("otherfield"))'
  • cat data.json | celq 'this.users[0].name'

version (optional)

The version of celq to use. Defaults to latest.

You can specify:

  • A specific version: 0.1.1
  • A version with v prefix: v0.1.1
  • Latest version: latest (default)

Outputs

result

The output from the celq command, which can be used in subsequent steps.

Examples

Basic usage

- name: Parse JSON file
  id: responseStatus
  uses: get-celq/celq-action@main
  with:
    cmd: celq 'this.status' < response.json

- name: Use the result
  run: echo "Status is ${{ steps.responseStatus.outputs.result }}"

With specific version

- name: Run celq with specific version
  id: query
  uses: get-celq/celq-action@main
  with:
    cmd: celq -n -b 'this.status' < response.json
    version: 0.1.2

We also handle the v prefix:

- name: Run celq with specific version
  id: query
  uses: get-celq/celq-action@main
  with:
    cmd: celq 'this.data.items' < response.json
    version: v0.1.2

With piped input

- name: Fetch and parse data
  id: fetch
  uses: get-celq/celq-action@main
  with:
    cmd: echo '[1, 2, 3]' | celq 'this[1]'

- name: Display result
  run: echo "Username: ${{ steps.fetch.outputs.result }}"

This will output: 2.

License

MIT

About

GitHub Action for celq

Resources

License

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors