diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml
index f0421f5166503a1353803b7125114ae13333bc02..de9d5bb3f0a2f07bab4390157914d8c2d73dd2c4 100644
--- a/.github/workflows/codeql.yml
+++ b/.github/workflows/codeql.yml
@@ -24,6 +24,7 @@ jobs:
           filters: .github/file-paths.yaml
   analyze:
     needs: files-changed
+    if: needs.files-changed.outputs.codeql == 'true'
     runs-on: ubuntu-22.04
     steps:
     - name: Checkout repository