Skip to content

kehoecj/validate-configs-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

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Validate Configs Github Action

OpenSSF Scorecard Apache 2 License

:octocat: Github Action to validate your config files using the config-file-validator. The config-file-validator will recursively scan the provided search path for the following configuration file types:

  • Apple PList XML
  • CSV
  • EDITORCONFIG
  • ENV
  • HCL
  • HOCON
  • INI
  • JSON
  • Properties
  • TOML
  • XML
  • YAML

Each file will get validated for the correct syntax and the results collected into a report showing the path of the file and if it is invalid or valid. If the file is invalid an error will be displayed along with the line number and column where the error ocurred. By default the $GITHUB_WORKDIR is scanned.

Standard Run

Inputs

Input Required Default Value Description
search-paths false "." The path that will be recursively searched for configuration files
exclude-dirs false "" A comma-separated list of subdirectories to exclude from validation
exclude-file-types false "" A comma-separated list of file extensions to exclude. Possible values are xml, ini, yaml, yml, toml, and json
depth false "" An integer value limiting the depth of recursion for the search paths. For example, setting depth to 0 would disable recursion
reporter false "standard" Format of the report printed to stdout. Options are standard and json
group-by false "" Group output by filetype, directory, pass-fail

Outputs

N/A

Example usage

Standard Run

jobs:
  validate-config-files:
    runs-on: ubuntu-latest
    steps:
      - uses: kehoe/validate-configs-action@v4.0.1

Custom search path

jobs:
  validate-config-files:
    runs-on: ubuntu-latest
    steps:
      - uses: kehoe/validate-configs-action@v4.0.1
        with:
            search-path: ./project/configs

Multiple search paths

jobs:
  validate-config-files:
    runs-on: ubuntu-latest
    steps:
      - uses: kehoe/validate-configs-action@v4.0.1
        with:
            search-path: ./project/configs ./project/devops

Exclude a directory

jobs:
  validate-config-files:
    runs-on: ubuntu-latest
    steps:
      - uses: kehoe/validate-configs-action@v4.0.1
        with:
            exclude-dirs: "tests,vendor"

Exclude file type

jobs:
  validate-config-files:
    runs-on: ubuntu-latest
    steps:
      - uses: kehoe/validate-configs-action@v4.0.1
        with:
            exclude-file-types: "json,xml"

Disable recursive scanning

jobs:
  validate-config-files:
    runs-on: ubuntu-latest
    steps:
      - uses: kehoe/validate-configs-action@v4.0.1
        with:
            depth: 0

JSON Report

jobs:
  validate-config-files:
    runs-on: ubuntu-latest
    steps:
      - uses: kehoe/validate-configs-action@v4.0.1
        with:
            reporter: "json"

Group By Pass/Fail

jobs:
  validate-config-files:
    runs-on: ubuntu-latest
    steps:
      - uses: kehoe/validate-configs-action@v4.0.1
        with:
            group-by: "pass-fail"