diff --git a/.gitlab/ci/build.gitlab-ci.yml b/.gitlab/ci/build.gitlab-ci.yml
index 86eb6d980415225729bbc1fc52fe56139b377647..c309b6db0bcbbf31ceb74a704285a24233804533 100644
--- a/.gitlab/ci/build.gitlab-ci.yml
+++ b/.gitlab/ci/build.gitlab-ci.yml
@@ -58,9 +58,9 @@ cta_rpm_xrootd4:
     - .cta_rpm
   rules:
     - !reference [.cta_build, rules]
-    - if: $XROOTD_VERSION == "4" &&  $SCHED_TYPE == "objectstore" && $ORACLE_SUPPORT == "ON"
     - if: $CI_COMMIT_TAG
       when: never
+    - if: $XROOTD_VERSION == "4" &&  $SCHED_TYPE == "objectstore" && $ORACLE_SUPPORT == "ON"
 
 cta_srpm_xrootd4_pgsched:
   stage: build:srpm
@@ -76,9 +76,9 @@ cta_rpm_xrootd4_pgsched:
     - .cta_rpm
   rules:
     - !reference [.cta_build, rules]
-    - if: $XROOTD_VERSION == "4" && $SCHED_TYPE == "pgsched" && $ORACLE_SUPPORT == "OFF"
     - if: $CI_COMMIT_TAG
       when: never
+    - if: $XROOTD_VERSION == "4" && $SCHED_TYPE == "pgsched" && $ORACLE_SUPPORT == "OFF"
 
 cta_srpm_xrootd5:
   stage: build:srpm
@@ -94,28 +94,10 @@ cta_rpm_xrootd5:
     - .cta_rpm
   rules:
     - !reference [.cta_build, rules]
-    - if: $XROOTD_VERSION == "5" &&  $SCHED_TYPE == "objectstore" && $ORACLE_SUPPORT == "ON"
     - if: $CI_COMMIT_TAG
       when: never
-
-cta_srpm_xrootd5:
-  stage: build:srpm
-  extends:
-    - .cta_srpm
-  rules:
-    - !reference [.cta_build, rules]
     - if: $XROOTD_VERSION == "5" &&  $SCHED_TYPE == "objectstore" && $ORACLE_SUPPORT == "ON"
 
-cta_rpm_xrootd5:
-  stage: build:rpm
-  extends:
-    - .cta_rpm
-  rules:
-    - !reference [.cta_build, rules]
-    - if: $XROOTD_VERSION == "5" &&  $SCHED_TYPE == "objectstore" && $ORACLE_SUPPORT == "ON"
-    - if: $CI_COMMIT_TAG
-      when: never
-
 cta_srpm_no_oracle:
   stage: build:srpm
   extends:
@@ -130,6 +112,6 @@ cta_rpm_no_oracle:
     - .cta_rpm
   rules:
     - !reference [.cta_build, rules]
-    - if: $XROOTD_VERSION == "4" &&  $SCHED_TYPE == "objectstore" && $ORACLE_SUPPORT == "OFF"
     - if: $CI_COMMIT_TAG
-      when: never
\ No newline at end of file
+      when: never
+    - if: $XROOTD_VERSION == "4" &&  $SCHED_TYPE == "objectstore" && $ORACLE_SUPPORT == "OFF"
diff --git a/ReleaseNotes.md b/ReleaseNotes.md
index 15996eaf9d1e42b0f4254d0caa4d9a9694c9361a..fc57ca07bab277309634590b1460719c13bb7e0c 100644
--- a/ReleaseNotes.md
+++ b/ReleaseNotes.md
@@ -11,6 +11,7 @@
 - cta/CTA#160 - Improve DB access to get all the Tape Drive States
 - cta/CTA#164 - Cppcheck job is not failing when there are errors
 - cta/CTA#165 - Fix oracle dbunittests
+- cta/CTA#169 - Fix misconfigured rules in .gitlab-ci.yml files
 
 # v4.7.11-1