File tree 1 file changed +12
-11
lines changed
1 file changed +12
-11
lines changed Original file line number Diff line number Diff line change @@ -779,17 +779,18 @@ def dump_modules(modules: Any) -> None:
779
779
780
780
with open ("CHANGELOG.md" , "r+" , encoding = "utf-8" ) as file :
781
781
content = file .read ()
782
- if "### Updated APIs" in content :
783
- file_content = content .replace (
784
- "### Updated APIs" ,
785
- f"### Updated APIs\n - Updated opensearch-py APIs to reflect [opensearch-api-specification@{ latest_commit_sha [:7 ]} ]({ commit_url } )" ,
786
- 1 ,
787
- )
788
- file .seek (0 )
789
- file .write (file_content )
790
- file .truncate ()
791
- else :
792
- raise Exception ("'Updated APIs' section is not present in CHANGELOG.md" )
782
+ if commit_url not in content :
783
+ if "### Updated APIs" in content :
784
+ file_content = content .replace (
785
+ "### Updated APIs" ,
786
+ f"### Updated APIs\n - Updated opensearch-py APIs to reflect [opensearch-api-specification@{ latest_commit_sha [:7 ]} ]({ commit_url } )" ,
787
+ 1 ,
788
+ )
789
+ file .seek (0 )
790
+ file .write (file_content )
791
+ file .truncate ()
792
+ else :
793
+ raise Exception ("'Updated APIs' section is not present in CHANGELOG.md" )
793
794
794
795
795
796
if __name__ == "__main__" :
You can’t perform that action at this time.
0 commit comments