Skip to content

JSON Lint GitLab CI Component

A GitLab CI component for jq - a command-line JSON processor that validates JSON syntax and structure.

Features

  • JSON Validation: Ensures all JSON files have valid syntax
  • Recursive Scanning: Automatically finds and validates JSON files in specified paths
  • Fast Processing: Leverages jq's high-performance JSON parsing
  • Configurable Paths: Specify custom directories to scan for JSON files
  • CI/CD Integration: Seamlessly integrates into GitLab CI/CD pipelines

Usage

Basic Usage

include:
  - component: $CI_SERVER_FQDN/niclas-zone/ci/json-lint/main@1.2.1

stages:
  - lint

With Custom Configuration

include:
  - component: $CI_SERVER_FQDN/niclas-zone/ci/json-lint/main@1.2.1
    inputs:
      path: "src"
      job_name: "validate-json"
      stage: "validation"

Inputs

Input Description Default
job_name Name of the CI job "json"
stage Pipeline stage name "lint"
image Container image for running jq "registry.gitlab.com/niclas-zone/ctr/jq:1.8.0"
path Folder to search for JSON files "."