https://codeberg.org/adamlui/drone-yamllint
207
Drone / Harness / Woodpecker plugin to run yamllint on your repo.
.drone.yml
kind: pipeline
name: default
trigger:
event: [pull_request, push]
paths: ['**/*.{yml,yaml}']
steps:
- name: yamllint
image: adamlui/drone-yamllint:v1.0.1
.woodpecker/yamllint.yml
when:
- event: manual
- event: [pull_request, push]
path: { include: ['**/*.{yml,yaml}'] }
steps:
- name: yamllint
image: adamlui/drone-yamllint:v1.0.1
.harness/yamllint.yaml
pipeline:
stages:
- identifier: default
name: default
steps:
- identifier: yamllint
name: yamllint
spec:
connectorRef: account.harnessImage
image: adamlui/drone-yamllint:v1.0.1
type: Plugin
Note
YAML settings override matching config file settings where applicable.
- name: yamllint
image: adamlui/drone-yamllint:v1.0.1
settings:
config: .yamllint.yml
strict: true
format: github
files: "**/*.yml **/*.yaml"
ignore_patterns: "vendor/** dist/**"
debug: true
| Setting | Description | Default |
|---|---|---|
config | Path to a yamllint config file. | auto-detected |
no_config | Disable auto-discover config file. | false |
yamllint_args | Additional raw args passed verbatim to the yamllint CLI (e.g. --no-warnings --strict). | none |
strict | Treat warnings as errors. | false |
version | yamllint version to install. Accepts a SemVer pattern. | 1.38.0 |
working_directory | Directory to run yamllint from. | repo root |
| Setting | Description | Default |
|---|---|---|
files | Whitespace-separated list of glob patterns to include (e.g. src/**). | none |
ignore_patterns | Whitespace-separated list of glob patterns to exclude (e.g. vendor/** dist/**). | none |
ignore_path | Path to an ignore file (e.g. .yamllintignore). | none |
extensions | Comma-separated file extensions to lint on pull requests. | yml,yaml |
all_files | Lint all files, not just changed files on pull requests. | false |
base_branch | Base branch that PRs are compared against. | PR target branch |
| Setting | Description | Default |
|---|---|---|
debug | Enable shell tracing (set -x) of the plugin entrypoint. | false |
never_fail | Exit 0 regardless of lint errors (so CI step always passes). | false |
<a target="_blank" href="https://codeberg.org/adamlui/drone-yamllint/#readme">
<img height=32 alt="[Linted by drone-yamllint]" src="https://img.shields.io/badge/Linted_by-drone--yamllint-black?logo=drone&logoColor=white&labelColor=464646&style=for-the-badge"></a>
[![[Linted by drone-yamllint]](https://img.shields.io/badge/Linted_by-drone--yamllint-black?logo=drone&logoColor=white&labelColor=464646&style=for-the-badge)](https://codeberg.org/adamlui/drone-yamllint/#readme)
docs/CONTRIBUTING.md to get started.main.You'll need Docker and (for local pipeline testing) the Drone CLI.
git clone https://codeberg.org/adamlui/drone-yamllint.git
cd drone-yamllint
The plugin is built from the Dockerfile and runs via src/entrypoint.sh + src/utils/*.sh. If you change any of these, rebuild the image:
docker build -t adamlui/drone-yamllint:dev .
Run the example pipeline locally:
drone exec --pipeline default
No Drone CLI? Test the image directly:
docker run --rm -v "$PWD:/app" -w /app adamlui/drone-yamllint:dev
If you find this project useful, you can support its development:
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE
docker pull adamlui/drone-yamllint:latest