Repository: provectus/kafka-ui
Issue: [Feature] Add workflow to check workflows in .github/workflows/**
Labels: status/accepted
scope/infrastructure
type/feature

Currently we have required job build-and-test for different paths that pull requests affect.
However, we lack the job for changes in workflows path and merges are possible only with admin privileges.
The task is to add the workflow that will contain build-and-test job for changes in .github/workflows/** path.

Issue comments:

Pull request review comments:

Patch that resolved the issue:
diff --git a/.github/workflows/aws_publisher.yaml b/.github/workflows/aws_publisher.yaml
index 052f4e8ed9e..39468d4dde3 100644
--- a/.github/workflows/aws_publisher.yaml
+++ b/.github/workflows/aws_publisher.yaml
@@ -48,4 +48,4 @@ jobs:
           arguments: "-color=false -on-error=abort -var=kafka_ui_release_version=${{ github.event.inputs.KafkaUIReleaseVersion }}"
           target: kafka-ui-infra/ami/kafka-ui.pkr.hcl
         env:
-          PACKER_LOG: 1
\ No newline at end of file
+          PACKER_LOG: 1
diff --git a/.github/workflows/helm.yaml b/.github/workflows/helm.yaml
index 18abec82f01..b11f7ccc2e1 100644
--- a/.github/workflows/helm.yaml
+++ b/.github/workflows/helm.yaml
@@ -26,7 +26,7 @@ jobs:
           echo "NEXT K8S VERSIONS ARE GOING TO BE TESTED: $K8S_VERSIONS"
           echo ""
           for version in $K8S_VERSIONS
-            do 
+            do
               echo $version;
               helm template charts/kafka-ui -f charts/kafka-ui/values.yaml | kubeval --additional-schema-locations https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master --strict -v $version;
             done
diff --git a/.github/workflows/release_drafter.yml b/.github/workflows/release_drafter.yml
index 89b1779ffcb..742254b942e 100644
--- a/.github/workflows/release_drafter.yml
+++ b/.github/workflows/release_drafter.yml
@@ -16,4 +16,4 @@ jobs:
           config-name: release_drafter.yaml
           disable-autolabeler: true
         env:
-          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
\ No newline at end of file
+          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
diff --git a/.github/workflows/welcome-first-time-contributors.yml b/.github/workflows/welcome-first-time-contributors.yml
index f0caa2053e1..b0258c9235b 100644
--- a/.github/workflows/welcome-first-time-contributors.yml
+++ b/.github/workflows/welcome-first-time-contributors.yml
@@ -21,7 +21,7 @@ jobs:
             Thank you and congratulations 🎉 for opening your very first issue in this project! 💖
 
             In case you want to claim this issue, please comment down below! We will try to get back to you as soon as we can. 👀
-            
+
           pr-message: |
             Hello there ${{ github.actor }}! 👋
 
diff --git a/.github/workflows/workflow_linter.yaml b/.github/workflows/workflow_linter.yaml
new file mode 100644
index 00000000000..92012e77455
--- /dev/null
+++ b/.github/workflows/workflow_linter.yaml
@@ -0,0 +1,22 @@
+name: "Workflow linter"
+on:
+  pull_request:
+    types:
+      - "opened"
+      - "reopened"
+      - "synchronize"
+      - "edited"
+    paths:
+      - ".github/workflows/**"
+jobs:
+  build-and-test:
+    runs-on: ubuntu-latest
+    steps:
+      - uses: actions/checkout@v2
+        with:
+          fetch-depth: 0
+          ref: ${{ github.event.pull_request.head.sha }}
+      - name: Install yamllint
+        run: sudo apt install -y yamllint
+      - name: Validate workflow yaml files
+        run: yamllint .github/workflows/. -d relaxed -f github --no-warnings


Test patch: