-
Notifications
You must be signed in to change notification settings - Fork 319
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into henrymercer/zstd-stream
- Loading branch information
Showing
15 changed files
with
115 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import os | ||
import sys | ||
|
||
EMPTY_CHANGELOG = 'No changes.\n\n' | ||
|
||
# Prepare the changelog for the new release | ||
# This function will extract the part of the changelog that | ||
# we want to include in the new release. | ||
def extract_changelog_snippet(changelog_file, version_tag): | ||
output = '' | ||
if (not os.path.exists(changelog_file)): | ||
output = EMPTY_CHANGELOG | ||
|
||
else: | ||
with open('CHANGELOG.md', 'r') as f: | ||
lines = f.readlines() | ||
|
||
# Include everything up to, but excluding the second heading | ||
found_first_section = False | ||
for i, line in enumerate(lines): | ||
if line.startswith('## '): | ||
if found_first_section: | ||
break | ||
found_first_section = True | ||
output += line | ||
|
||
output += f"See the full [CHANGELOG.md](https:/github/codeql-action/blob/{version_tag}/CHANGELOG.md) for more information." | ||
|
||
return output | ||
|
||
|
||
if len(sys.argv) < 3: | ||
raise Exception('Expecting argument: changelog_file version_tag') | ||
changelog_file = sys.argv[1] | ||
version_tag = sys.argv[2] | ||
|
||
print(extract_changelog_snippet(changelog_file, version_tag)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters