From ded4b4a969c2373edbc303cf3468c8343aef7b90 Mon Sep 17 00:00:00 2001 From: "Andrew J.Swan" Date: Fri, 27 Sep 2024 23:00:05 +0300 Subject: [PATCH] Yaml Lint --- .github/CODEOWNERS | 1 + .github/workflows/build.yml | 10 +++++----- .github/workflows/pull-request.yml | 2 +- .github/workflows/workflow_yaml_lint.yml | 23 +++++++++++++++++++++++ .yamllint | 21 +++++++++++++++++++++ 5 files changed, 51 insertions(+), 6 deletions(-) create mode 100644 .github/CODEOWNERS create mode 100644 .github/workflows/workflow_yaml_lint.yml create mode 100644 .yamllint diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000..1f9349e --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1 @@ +* @andrewjswan diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5380cf6..a7c6ff0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -3,7 +3,7 @@ name: Build / Fanart Handler on: push: # On Push to Master branch - branches: + branches: - master # Ignore all Tags / Release tags-ignore: @@ -76,7 +76,7 @@ jobs: name: CodeQL if: ${{ needs.changes.outputs.changes == 'true' }} uses: andrewjswan/MPE/.github/workflows/codeql.yml@master - needs: + needs: - build - changes permissions: @@ -243,9 +243,9 @@ jobs: contents: write outputs: changes: ${{ needs.mpe.outputs.changes }} - + runs-on: ubuntu-latest - + steps: - name: Download Artifacts uses: actions/download-artifact@v4 @@ -314,7 +314,7 @@ jobs: - name: Failure if: ${{ contains(needs.*.result, 'failure') }} run: exit 1 - + cache-clear: name: Clear cache runs-on: ubuntu-latest diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 394f3d0..8ab45ed 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -3,7 +3,7 @@ name: Test / Fanart Handler on: workflow_dispatch: pull_request: - types: + types: - opened - synchronize - edited diff --git a/.github/workflows/workflow_yaml_lint.yml b/.github/workflows/workflow_yaml_lint.yml new file mode 100644 index 0000000..cf8c173 --- /dev/null +++ b/.github/workflows/workflow_yaml_lint.yml @@ -0,0 +1,23 @@ +name: Workflow / YAML lint + +on: + push: + branches: [main] + paths: + - "**.yaml" + - "**.yml" + pull_request: + paths: + - "**.yaml" + - "**.yml" + workflow_dispatch: + +jobs: + yamllint: + name: 🧹 Yaml lint + runs-on: ubuntu-latest + steps: + - name: ⤵️ Check out configuration from GitHub + uses: actions/checkout@v4 + - name: 🚀 Run yamllint + run: yamllint --strict . diff --git a/.yamllint b/.yamllint new file mode 100644 index 0000000..8e4e353 --- /dev/null +++ b/.yamllint @@ -0,0 +1,21 @@ +--- +extends: default + +ignore-from-file: .gitignore + +rules: + document-start: disable + empty-lines: + level: error + max: 1 + max-start: 0 + max-end: 1 + indentation: + level: error + spaces: 2 + indent-sequences: true + check-multi-line-strings: false + line-length: disable + truthy: disable + new-lines: disable + comments-indentation: disable