-
Notifications
You must be signed in to change notification settings - Fork 194
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1284 from aFlyBird0/feat-yaml-lint
ci: yaml lint
- Loading branch information
Showing
5 changed files
with
68 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name: Yaml Lint | ||
|
||
on: | ||
pull_request: | ||
branches: [ main ] | ||
paths: | ||
- '**.yaml' | ||
- '**.yml' | ||
|
||
jobs: | ||
yamlLint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Remove All Strings In Square Brackets | ||
run: | | ||
# remove strings in "[[]]" in .yml or .yaml files, or yaml lint will fail | ||
sed -i "s/\[\[.*\]\]//g" `grep "\[\[.*\]\]" -rl --include="*.yml" --include="*.yaml" .` | ||
- name: Yaml Lint | ||
uses: ibiqlik/action-yamllint@v3 | ||
with: | ||
file_or_dir: . | ||
config_file: .yamllint.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
extends: default | ||
rules: | ||
brackets: disable # do not check brackets | ||
comments: | ||
require-starting-space: true | ||
min-spaces-from-content: 1 # at leaset 1 space between comment and content | ||
document-start: disable # whether the document must start with '---' is optional | ||
indentation: | ||
spaces: 2 | ||
# block sequences should not be indented | ||
# e.g.: | ||
# OK: | ||
# key: | ||
# - value1 | ||
# - value2 | ||
# NOT OK: | ||
# key: | ||
# - value1 | ||
# - value2 | ||
indent-sequences: false | ||
line-length: disable | ||
new-line-at-end-of-file: enable # must have a new line at the end of file | ||
trailing-spaces: disable # do not check trailing spaces | ||
truthy: disable # do not check truthy | ||
ignore: | | ||
*.tpl.yaml | ||
*.tpl.yml | ||
*tmpl.yaml | ||
*tmpl.yml | ||
*template.yml | ||
*template.yaml | ||
**/.github/** | ||
**/githubactions/** | ||
**/workflows/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
kind: Cluster | ||
apiVersion: kind.x-k8s.io/v1alpha4 | ||
nodes: | ||
- role: control-plane | ||
extraPortMappings: | ||
- containerPort: 8080 | ||
hostPort: 8080 | ||
listenAddress: "0.0.0.0" | ||
protocol: tcp | ||
- role: control-plane | ||
extraPortMappings: | ||
- containerPort: 8080 | ||
hostPort: 8080 | ||
listenAddress: "0.0.0.0" | ||
protocol: tcp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters