Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
2f5211a
Test yamllint action
Feb 23, 2023
e797a4d
Add: Separate job for yaml lint [WIP]
Feb 24, 2023
e30b038
Merge branch 'main' into A0-2005-gha-yamllint
Feb 24, 2023
3901098
Add main and current feature branch for testing
Feb 24, 2023
c971081
typo
Feb 24, 2023
928b3ae
echo ref_name
Feb 24, 2023
e7a64c7
Better paths
Feb 24, 2023
d5c45ea
Try to trigger
Feb 24, 2023
5ed2ed5
vars
Feb 24, 2023
5ce15cf
as env
Feb 24, 2023
5e30c0c
double asterisk
Feb 24, 2023
0d44eb1
those envs are sketchy
Feb 24, 2023
47cb9d9
missing one env, removed this branched from 'push' event
Feb 24, 2023
4eafc10
some git tinkering
Feb 24, 2023
9518c1e
try without fetching
Feb 24, 2023
d639854
Fetch is a must-have, removed 'push' triggers
Feb 24, 2023
3f1ae32
Test diff
Feb 24, 2023
c47c8f0
variable test
Feb 24, 2023
0d48dd3
Replace '\n' with ' '
Feb 24, 2023
af594f0
quiet 'git fetch'
Feb 24, 2023
8d796eb
try to lint
Feb 24, 2023
ce6bae8
check again
Feb 24, 2023
bec9a08
Try without additional repo path
Feb 24, 2023
dad2948
Try again with output
Feb 24, 2023
73982d3
Try as an env
Feb 24, 2023
35c32b3
i hate it
Feb 24, 2023
7dca1c3
Test to trigger linter after editing new files
Feb 24, 2023
77a2580
Test to trigger linter after editing new files - remove those changes
Feb 24, 2023
b1efdb9
Better grep
Feb 27, 2023
4c7d446
Add .yamllint config and remove nested lint in e2e-tests-main-devnet
Mar 1, 2023
7aaf2d6
Fixed lenght of line
Mar 1, 2023
7ee4cc4
Enforced true and false instead of other boolean values
Mar 1, 2023
cea6876
Set line-length to error
Mar 2, 2023
65bf32c
Merge branch 'main' into A0-2005-gha-yamllint
Mar 2, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions .github/workflows/yaml-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
name: GH Action YAML linter

on:
pull_request:
paths:
- ".github/**/**.yml"
- ".github/**/**.yaml"

concurrency:
group: ${{ github.ref }}-${{ github.workflow }}
cancel-in-progress: true

jobs:
main:
name: YAML Lint
runs-on: ubuntu-20.04
steps:
- name: GIT | Checkout source code
uses: actions/checkout@v3
with:
repository: Cardinal-Cryptography/aleph-node
token: ${{ secrets.CI_GH_TOKEN }}

- name: GIT | Check diff
id: check-diff
run: |
git fetch --quiet origin ${GITHUB_BASE_REF}:refs/remotes/origin/${GITHUB_BASE_REF}
YAML_FILES=`git --no-pager diff origin/${GITHUB_BASE_REF} --name-only \
| grep -E ".github\/.*\/.*(.yaml|.yml)" | tr '\n' ' '`
echo "Changed YAML files: ${YAML_FILES}"
echo "YAML_FILES=`echo $YAML_FILES`" >> $GITHUB_ENV

- name: LINT | Execute yaml-lint
uses: ibiqlik/action-yamllint@v3.1.1
with:
strict: true
file_or_dir: ${{ env.YAML_FILES }}
config_file: .yamllint
57 changes: 57 additions & 0 deletions .yamllint
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
---
extends: default

rules:
braces:
min-spaces-inside: 0
max-spaces-inside: 0
min-spaces-inside-empty: -1
max-spaces-inside-empty: -1
brackets:
min-spaces-inside: 0
max-spaces-inside: 0
min-spaces-inside-empty: -1
max-spaces-inside-empty: -1
colons:
max-spaces-before: 0
max-spaces-after: 1
commas:
max-spaces-before: 0
min-spaces-after: 1
max-spaces-after: 1
comments:
level: warning
require-starting-space: true
min-spaces-from-content: 2
comments-indentation: disable
document-end: disable
document-start: enable
empty-lines:
max: 2
max-start: 1
max-end: 1
empty-values:
forbid-in-block-mappings: false
forbid-in-flow-mappings: false
hyphens:
max-spaces-after: 1
indentation:
spaces: consistent
indent-sequences: true
check-multi-line-strings: false
key-duplicates: enable
key-ordering: disable
line-length:
max: 100
level: error
allow-non-breakable-words: true
allow-non-breakable-inline-mappings: false
new-line-at-end-of-file: enable
new-lines:
type: unix
trailing-spaces: enable
truthy:
allowed-values:
- "true"
- "false"
check-keys: false