Skip to content

Commit

Permalink
Upload on Tag workflow: allow empty change log for version missing in…
Browse files Browse the repository at this point in the history
… Readme's Change Log
  • Loading branch information
CyrilleB79 committed Oct 16, 2023
1 parent e503f29 commit a0519dd
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion .github/workflows/upload-on-tag.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ jobs:
print(f'===> Version:{version}')
pattern = rf'## Change log.*### Version {version}\s*(.*?)\s*(\n(### Version)|(\[\d+\]:)|$)'
fileContent = open('readme.md', 'r', encoding='utf8').read()
changeLog = re.search(pattern, fileContent, re.DOTALL).group(1) + '\n'
match = re.search(pattern, fileContent, re.DOTALL)
changeLog = match.group(1) if match else ""
changeLog += '\n'
print(f'===> ChangeLog:\n<<<{changeLog}>>>\n')
open('changelog.md', 'w', encoding='utf-8').write(changeLog)
shell: python
Expand Down

0 comments on commit a0519dd

Please sign in to comment.