https://github.com/devatherock/drone-yaml-validator
CI plugin to validate yaml files
https://github.com/devatherock/drone-yaml-validator
ci ci-cd ci-plugin circleci docker drone-ci plugin vela yaml yaml-validator yml
Last synced: 2 months ago
JSON representation
CI plugin to validate yaml files
- Host: GitHub
- URL: https://github.com/devatherock/drone-yaml-validator
- Owner: devatherock
- License: mit
- Created: 2018-09-24T03:27:53.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2025-02-15T14:28:55.000Z (4 months ago)
- Last Synced: 2025-03-18T13:32:23.763Z (3 months ago)
- Topics: ci, ci-cd, ci-plugin, circleci, docker, drone-ci, plugin, vela, yaml, yaml-validator, yml
- Language: Groovy
- Homepage:
- Size: 362 KB
- Stars: 6
- Watchers: 1
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.txt
Awesome Lists containing this project
README
[](https://circleci.com/gh/devatherock/drone-yaml-validator)
[](https://hub.docker.com/r/devatherock/drone-yaml-validator/)
[](https://coveralls.io/github/devatherock/drone-yaml-validator?branch=master)
[](https://www.codacy.com/gh/devatherock/drone-yaml-validator/dashboard?utm_source=github.com&utm_medium=referral&utm_content=devatherock/drone-yaml-validator&utm_campaign=Badge_Grade)
[](https://hub.docker.com/r/devatherock/drone-yaml-validator/)
[](https://hub.docker.com/r/devatherock/drone-yaml-validator/)
[](https://opensource.org/licenses/MIT)
# yaml-validator
CI plugin to validate yaml files## Usage
### Docker```shell script
docker run --rm \
-e PLUGIN_DEBUG=true \
-v path/to/yamls:/work \
-w /work \
devatherock/drone-yaml-validator:latest
```### CI
The following parameters can be set to configure the plugin.* **debug** - Flag to enable debug logs. Optional, by default, debug logs are disabled
* **continue_on_error** - Flag to indicate if processing should continue when an invalid file is encountered. Optional,
defaults to true* **search_path** - If specified, only YAMLs present in this path will be validated
* **allow_duplicate_keys** - Flag to indicate if YAML files with duplicate keys should be considered valid. Optional,
defaults to false* **ignore_unknown_tags** - Flag to indicate if YAML files with unknown tags should be considered valid. Optional,
defaults to true#### vela
```yaml
steps:
- name: yaml_validator
ruleset:
branch: master
event: push
image: devatherock/drone-yaml-validator:latest
parameters:
debug: false
continue_on_error: true
allow_duplicate_keys: false
ignore_unknown_tags: true
```#### drone
```yaml
steps:
- name: yaml_validator
image: devatherock/drone-yaml-validator:latest
settings:
debug: false
continue_on_error: true
allow_duplicate_keys: false
ignore_unknown_tags: true
```#### CircleCI
```yaml
version: 2.1
jobs:
validate_yamls:
docker:
- image: devatherock/drone-yaml-validator:latest
working_directory: ~/my-repo
environment:
PARAMETER_DEBUG: false
PARAMETER_CONTINUE_ON_ERROR: true
PARAMETER_ALLOW_DUPLICATE_KEYS: false
PARAMETER_IGNORE_UNKNOWN_TAGS: true
steps:
- checkout
- run: sh /scripts/entry-point.sh
```## Tests
To test the latest plugin image, run the below command```shell
make functional-test
```