diff --git a/scripts/update_license_headers.py b/scripts/update_license_headers.py
index 88f51138755b3210cc32c9db896d5e37f4dca78b..62a166f17e301ad0537ac32d60dcc6a45396c84b 100644
--- a/scripts/update_license_headers.py
+++ b/scripts/update_license_headers.py
@@ -87,6 +87,7 @@ def process_file(
 
     temp_file_path = file_path + '.temp'
     replaced = False
+    file_mode = os.stat(file_path)
     try:
         with open(file_path, encoding='UTF-8') as source:
             with open(temp_file_path, 'w', encoding='UTF-8') as target:
@@ -103,6 +104,7 @@ def process_file(
         file_updated.write(file_path + '\n')
 
     os.rename(temp_file_path, file_path)
+    os.chmod(file_path, file_mode)
 
 def main() -> int:
     with open(FILE_PATH_NO_HEADER, 'w', encoding='UTF-8') as file_no_header: