diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml
index 68e9f19c89d0f9fec2d0b0997db3bf00cc6e7df4..f5fa28f27b7c934c87d42167757a5fa3086e9b1b 100644
--- a/.github/workflows/codeql.yml
+++ b/.github/workflows/codeql.yml
@@ -1,6 +1,11 @@
 name: "CodeQL"
 
-on: [push, pull_request]
+on:
+  push:
+    branches:
+      - 'master'
+      - 'release-**'
+  pull_request:
 
 jobs:
   analyze: