diff --git a/tag_publish/__init__.py b/tag_publish/__init__.py
index 97de100..b5f7592 100644
--- a/tag_publish/__init__.py
+++ b/tag_publish/__init__.py
@@ -67,9 +67,16 @@ def get_security_md(gh: GH) -> security_md.Security:
         gh: The GitHub helper
 
     """
-    security_file = gh.repo.get_contents("SECURITY.md")
-    assert isinstance(security_file, github.ContentFile.ContentFile)
-    return security_md.Security(security_file.decoded_content.decode("utf-8"))
+    try:
+        security_file = gh.repo.get_contents("SECURITY.md")
+        assert isinstance(security_file, github.ContentFile.ContentFile)
+        return security_md.Security(security_file.decoded_content.decode("utf-8"))
+    except github.GithubException as exception:
+        if exception.status == 404:
+            print("No security file in the repository")
+            return security_md.Security("")
+        else:
+            raise exception
 
 
 def merge(default_config: Any, config: Any) -> Any:
diff --git a/tag_publish/cli.py b/tag_publish/cli.py
index 4720732..61afb66 100644
--- a/tag_publish/cli.py
+++ b/tag_publish/cli.py
@@ -267,9 +267,12 @@ def _handle_docker_publish(
             )
         security_text = ""
         if local:
-            with open("SECURITY.md", encoding="utf-8") as security_file:
-                security_text = security_file.read()
-                security = security_md.Security(security_text)
+            if os.path.exists("SECURITY.md"):
+                with open("SECURITY.md", encoding="utf-8") as security_file:
+                    security_text = security_file.read()
+                    security = security_md.Security(security_text)
+            else:
+                security = security_md.Security("")
         else:
             security = tag_publish.get_security_md(github)