From a29cd2cdc242de560700f3df7e57b2867f45486e Mon Sep 17 00:00:00 2001
From: Nick Schonning <nschonni@gmail.com>
Date: Thu, 5 Jan 2023 07:45:21 -0500
Subject: [PATCH] Move Prettier CI checks to filtered jobs (#22376)

---
 .github/workflows/lint-json.yml | 38 +++++++++++++++++++++++++++++++
 .github/workflows/lint-yml.yml  | 40 +++++++++++++++++++++++++++++++++
 .github/workflows/linter.yml    |  2 --
 3 files changed, 78 insertions(+), 2 deletions(-)
 create mode 100644 .github/workflows/lint-json.yml
 create mode 100644 .github/workflows/lint-yml.yml

diff --git a/.github/workflows/lint-json.yml b/.github/workflows/lint-json.yml
new file mode 100644
index 0000000000..5bf4349b3d
--- /dev/null
+++ b/.github/workflows/lint-json.yml
@@ -0,0 +1,38 @@
+name: JSON Linting
+on:
+  push:
+    branches-ignore:
+      - 'dependabot/**'
+    paths:
+      - 'package.json'
+      - 'yarn.lock'
+      - '.prettier*'
+      - '**/*.json'
+      - '.github/workflows/lint-json.yml'
+
+  pull_request:
+    paths:
+      - 'package.json'
+      - 'yarn.lock'
+      - '.prettier*'
+      - '**/*.json'
+      - '.github/workflows/lint-json.yml'
+
+jobs:
+  lint:
+    runs-on: ubuntu-latest
+
+    steps:
+      - name: Clone repository
+        uses: actions/checkout@v3
+
+      - name: Set up Node.js
+        uses: actions/setup-node@v3
+        with:
+          cache: yarn
+
+      - name: Install all yarn packages
+        run: yarn --frozen-lockfile
+
+      - name: Prettier
+        run: yarn prettier --check "**/*.json"
diff --git a/.github/workflows/lint-yml.yml b/.github/workflows/lint-yml.yml
new file mode 100644
index 0000000000..b939ec8ce2
--- /dev/null
+++ b/.github/workflows/lint-yml.yml
@@ -0,0 +1,40 @@
+name: YML Linting
+on:
+  push:
+    branches-ignore:
+      - 'dependabot/**'
+    paths:
+      - 'package.json'
+      - 'yarn.lock'
+      - '.prettier*'
+      - '**/*.yaml'
+      - '**/*.yml'
+      - '.github/workflows/lint-yml.yml'
+
+  pull_request:
+    paths:
+      - 'package.json'
+      - 'yarn.lock'
+      - '.prettier*'
+      - '**/*.yaml'
+      - '**/*.yml'
+      - '.github/workflows/lint-yml.yml'
+
+jobs:
+  lint:
+    runs-on: ubuntu-latest
+
+    steps:
+      - name: Clone repository
+        uses: actions/checkout@v3
+
+      - name: Set up Node.js
+        uses: actions/setup-node@v3
+        with:
+          cache: yarn
+
+      - name: Install all yarn packages
+        run: yarn --frozen-lockfile
+
+      - name: Prettier
+        run: yarn prettier --check "**/*.{yml,yaml}"
diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml
index 319152e93d..b6438d6659 100644
--- a/.github/workflows/linter.yml
+++ b/.github/workflows/linter.yml
@@ -57,8 +57,6 @@ jobs:
           cache: yarn
       - name: Install dependencies
         run: yarn install --frozen-lockfile
-      - name: Check prettier formatting
-        run: yarn format-check
       - name: Set-up RuboCop Problem Mathcher
         uses: r7kamura/rubocop-problem-matchers-action@v1
       - name: Set-up Stylelint Problem Matcher