validate-configs-action
validate-configs-action copied to clipboard
:octocat: Github Action to validate your config files using the config-file-validator
Validate Configs Github Action
: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
- HCL
- 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.
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 |
Outputs
N/A
Example usage
Standard Run
jobs:
validate-config-files:
runs-on: ubuntu-latest
steps:
- uses: kehoe/validate-configs-action@v1
Custom search path
jobs:
validate-config-files:
runs-on: ubuntu-latest
steps:
- uses: kehoe/validate-configs-action@v1
with:
search-path: ./project/configs
Multiple search paths
jobs:
validate-config-files:
runs-on: ubuntu-latest
steps:
- uses: kehoe/validate-configs-action@v1
with:
search-path: ./project/configs ./project/devops
Exclude a directory
jobs:
validate-config-files:
runs-on: ubuntu-latest
steps:
- uses: kehoe/validate-configs-action@v1
with:
exclude-dirs: "tests,vendor"
Exclude file type
jobs:
validate-config-files:
runs-on: ubuntu-latest
steps:
- uses: kehoe/validate-configs-action@v1
with:
exclude-file-types: "json,xml"
Disable recursive scanning
jobs:
validate-config-files:
runs-on: ubuntu-latest
steps:
- uses: kehoe/validate-configs-action@v1
with:
depth: 0
JSON Report
jobs:
validate-config-files:
runs-on: ubuntu-latest
steps:
- uses: kehoe/validate-configs-action@v1
with:
reporter: "json"