From 3e6216bda26851fac1b8e5cab134d47f8d4f9fbe Mon Sep 17 00:00:00 2001 From: Ashish Bhatia Date: Sun, 26 Mar 2023 20:53:18 -0700 Subject: [PATCH] Add YAML Linter to GitHub CI (#172) --- .github/workflows/lint-yaml.yaml | 52 ++++++++++++++++++++++++++++++++ README.md | 4 ++- 2 files changed, 55 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/lint-yaml.yaml diff --git a/.github/workflows/lint-yaml.yaml b/.github/workflows/lint-yaml.yaml new file mode 100644 index 0000000..83b03d7 --- /dev/null +++ b/.github/workflows/lint-yaml.yaml @@ -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 diff --git a/README.md b/README.md index 2ae5303..ab0d940 100644 --- a/README.md +++ b/README.md @@ -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.