ci: change scripts location

This commit is contained in:
ReaJason
2025-02-23 02:33:09 +08:00
parent ef6ca026f2
commit 185be332a5
2 changed files with 1 additions and 2 deletions
@@ -0,0 +1,24 @@
import argparse
import sys
if __name__ == '__main__':
capture = False
result_lines = []
parser = argparse.ArgumentParser(description="Extract changelog for a specific version")
parser.add_argument("version", help="The version of the changelog to extract, e.g. 'v1.0.0'")
args = parser.parse_args()
version = args.version
with open("../CHANGELOG.md") as f:
lines = f.readlines()
for line in lines:
if line.startswith(f"## [{version}]"):
capture = True
elif capture and line.startswith("## ["):
break
elif capture:
result_lines.append(line)
if not result_lines:
print("Specified version not found.", file=sys.stderr)
sys.exit(1)
print("".join(result_lines).strip())
+1 -2
View File
@@ -25,9 +25,8 @@ jobs:
- name: Get ChangeLog
id: get_changelog
working-directory: scripts
working-directory: .github/scripts
run: |
CHANGELOG=$(python parse_changelog_of_version.py "${{ steps.get_version.outputs.version }}")
echo "changelog<<EOF" >> $GITHUB_OUTPUT
echo "$(python parse_changelog_of_version.py ${{ steps.get_version.outputs.version }})" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT