diff --git a/python-packages/base.yml b/python-packages/base.yml
index 81ec4cf4e6523690cf1f86184c0b6e94eb5249d8..53c968b912dd7726a7b895eeb7783797bfd82038 100644
--- a/python-packages/base.yml
+++ b/python-packages/base.yml
@@ -12,8 +12,14 @@ base:
   image: $ACR_URL/python:3.8
   tags:
     - docker
+  only:
+    refs:
+    # run only when new tag is published or changes pushed to master
+    - tags
+    - master
+
   script:
     - pip install virtualenv  # install virtualenv to create a virtual environment to install required packages
     - virtualenv $VIRTUALENV_NAME  # create a virtualenvironment
     - source $VIRTUALENV_NAME/bin/activate  # activate the virtualenvironment
-    - python -V  # print python version for debugging
\ No newline at end of file
+    - python -V  # print python version for debugging