diff --git a/download-latest-firmware-build.py b/download-latest-firmware-build.py
index 60b95269f0520f0fe6dd4eb08bbb47438ae81f91..29cdacdfc23b3439da06e479833be14fc056843d 100755
--- a/download-latest-firmware-build.py
+++ b/download-latest-firmware-build.py
@@ -50,12 +50,14 @@ def find_latest_pipeline_id():
     return None
 
 if args.pipeline_id is None:
-    pipeline_id = find_latest_pipeline_id()
+    pipeline_id = int(find_latest_pipeline_id())
 
     if args.pipeline_id_file:
         try:
             with open(args.pipeline_id_file, "r") as pipeline_id_file:
-                if pipeline_id == pipeline_id_file.read():
+                pipeline_id_from_file = int(pipeline_id_file.read())
+                
+                if pipeline_id == pipeline_id_from_file:
                     print("Pipeline up to date")
                     sys.exit(1)
         except FileNotFoundError: