Skip to content

Commit

Permalink
ci: add YAML linter
Browse files Browse the repository at this point in the history
  • Loading branch information
ashishb committed Sep 18, 2024
1 parent 3ee6d5a commit 219cb8c
Showing 1 changed file with 53 additions and 0 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/lint-yaml.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Generated by Gabo (https://github.com/ashishb/gabo)
---
# Run this locally with act - https://github.com/nektos/act
# act -j lintYaml
name: Lint YAML

on: # yamllint disable-line rule:truthy
push:
branches: [main, master]
paths:
- '**.yml'
- '**.yaml'
- '.github/workflows/**.yml'
- '.github/workflows/**.yaml'
pull_request:
branches: [main, master]
paths:
- '**.yml'
- '**.yaml'
- '.github/workflows/**.yml'
- '.github/workflows/**.yaml'

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

jobs:
lintYaml:
runs-on: ubuntu-latest
timeout-minutes: 15

steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Check YAML files with linter
uses: ibiqlik/action-yamllint@v3
with:
# All files under base dir
file_or_dir: "."
config_data: |
extends: default
yaml-files:
- '*.yaml'
- '*.yml'
rules:
document-start:
level: warning
line-length:
level: warning
new-line-at-end-of-file:
level: warning
trailing-spaces:
level: warning

0 comments on commit 219cb8c

Please sign in to comment.