Add YAML Linter to GitHub CI (#172)

This commit is contained in:
Ashish Bhatia 2023-03-26 20:53:18 -07:00 committed by GitHub
parent 6c50a49d0a
commit 3e6216bda2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 55 additions and 1 deletions

52
.github/workflows/lint-yaml.yaml vendored Normal file
View File

@ -0,0 +1,52 @@
---
# Run this locally with act - https://github.com/nektos/act
# act -j lintYaml
name: Lint YAML
on: # yamllint disable-line rule:truthy
push:
branches: [master, main]
paths:
- '**.yml'
- '**.yaml'
- '.github/workflows/**.yml'
- '.github/workflows/**.yaml'
pull_request:
branches: [master, main]
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@v3
- 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

View File

@ -1,4 +1,6 @@
# android-security-awesome ![Awesome](https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg) [![Lint Markdown](https://github.com/ashishb/android-security-awesome/actions/workflows/lint-markdown.yaml/badge.svg)](https://github.com/ashishb/android-security-awesome/actions/workflows/lint-markdown.yaml) [![Test](https://github.com/ashishb/android-security-awesome/actions/workflows/test.yml/badge.svg)](https://github.com/ashishb/android-security-awesome/actions/workflows/test.yml) # android-security-awesome ![Awesome](https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg)
[![Test](https://github.com/ashishb/android-security-awesome/actions/workflows/test.yml/badge.svg)](https://github.com/ashishb/android-security-awesome/actions/workflows/test.yml) [![Lint Markdown](https://github.com/ashishb/android-security-awesome/actions/workflows/lint-markdown.yaml/badge.svg)](https://github.com/ashishb/android-security-awesome/actions/workflows/lint-markdown.yaml) [![Lint YAML](https://github.com/ashishb/android-security-awesome/actions/workflows/lint-yaml.yaml/badge.svg)](https://github.com/ashishb/android-security-awesome/actions/workflows/lint-yaml.yaml)
A collection of android security related resources. A collection of android security related resources.