mirror of
https://github.com/bombsquad-community/plugin-manager.git
synced 2025-10-08 14:54:36 +00:00
get changes from CHANGELOG.md
This commit is contained in:
parent
20aef6312a
commit
d07a276f1a
2 changed files with 27 additions and 4 deletions
10
.github/workflows/release.yml
vendored
10
.github/workflows/release.yml
vendored
|
|
@ -12,6 +12,10 @@ jobs:
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
- name: Set up Python
|
||||||
|
uses: actions/setup-python@v5
|
||||||
|
with:
|
||||||
|
python-version: '3.11'
|
||||||
- name: Create Release
|
- name: Create Release
|
||||||
id: create_release
|
id: create_release
|
||||||
uses: actions/create-release@v1
|
uses: actions/create-release@v1
|
||||||
|
|
@ -19,11 +23,9 @@ jobs:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
|
||||||
with:
|
with:
|
||||||
tag_name: ${{ github.ref }}
|
tag_name: ${{ github.ref }}
|
||||||
release_name: Release ${{ github.ref }}
|
release_name: ${{ github.ref }}
|
||||||
body: |
|
body: |
|
||||||
Changes in this Release
|
$(python3 test/get_changes.py `github.ref`)
|
||||||
- First Change
|
|
||||||
- Second Change
|
|
||||||
draft: false
|
draft: false
|
||||||
prerelease: false\
|
prerelease: false\
|
||||||
- name: Upload Release Asset
|
- name: Upload Release Asset
|
||||||
|
|
|
||||||
21
test/get_changes.py
Normal file
21
test/get_changes.py
Normal file
|
|
@ -0,0 +1,21 @@
|
||||||
|
import re
|
||||||
|
import sys
|
||||||
|
|
||||||
|
def get_version_changelog(version):
|
||||||
|
with open('CHANGELOG.md', 'r') as file:
|
||||||
|
content = file.read()
|
||||||
|
pattern = rf"### {version} \(\d\d-\d\d-\d{{4}}\)\n(.*?)(?=### \d+\.\d+\.\d+|\Z)"
|
||||||
|
matches = re.findall(pattern, content, re.DOTALL)
|
||||||
|
if matches:
|
||||||
|
return matches[0].strip()
|
||||||
|
else:
|
||||||
|
return f"Changelog entry for version {version} not found."
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
if len(sys.argv) < 2:
|
||||||
|
print("Usage: python3 script.py version_number")
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
|
version = sys.argv[1]
|
||||||
|
changelog = get_version_changelog(version)
|
||||||
|
print(changelog)
|
||||||
Loading…
Add table
Add a link
Reference in a new issue