mirror of
https://github.com/ReaJason/MemShellParty.git
synced 2026-09-21 22:50:42 +08:00
ci: change scripts location
This commit is contained in:
@@ -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())
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user