Skip to content

Commit

Permalink
add changelog creator
Browse files Browse the repository at this point in the history
  • Loading branch information
saleweaver committed Dec 14, 2024
1 parent 696818c commit 77e96c4
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 8 deletions.
22 changes: 16 additions & 6 deletions .github/workflows/version_increment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,19 @@ jobs:
- name: Update CHANGELOG.md
if: env.new_version != ''
run: |
echo "## v${{ env.new_version }} - $(date +'%Y-%m-%d')" >> CHANGELOG.md
cat changelog_entry.md >> CHANGELOG.md
echo "" >> CHANGELOG.md
# Write the new version header and generated entry to a temp file
echo "## v${{ env.new_version }} - $(date +'%Y-%m-%d')" > temp_changelog.md
cat changelog_entry.md >> temp_changelog.md
echo "" >> temp_changelog.md
# Append the old CHANGELOG.md content after the new entry
if [ -f CHANGELOG.md ]; then
cat CHANGELOG.md >> temp_changelog.md
fi
# Move temp back to CHANGELOG.md
mv temp_changelog.md CHANGELOG.md
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add CHANGELOG.md
Expand All @@ -79,9 +89,9 @@ jobs:
- name: Read Changelog Entry
id: read_changelog
run: |
body="$(cat changelog_entry.md)"
# Set the output 'body' to contain the file contents.
echo "::set-output name=body::$body"
echo "body<<EOF" >> $GITHUB_OUTPUT
cat changelog_entry.md >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
- name: Create a new GitHub release
if: env.new_version != ''
Expand Down
4 changes: 2 additions & 2 deletions generate_changelog.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
prompt = f"""
You are a helpful assistant who generates changelog entries for the python-amazon-sp-api, a wrapper to access Amazon's Selling Partner API with an easy-to-use interface. This tool helps developers and businesses connect seamlessly with Amazon's vast marketplace, enabling powerful automations and data management.
This is a growing changelog entry for the project. Only add changes that are relevant to the end-users, such as new features, changes to existing features, and bug fixes. Categorize and group changes between internal and relevant to the project..
The current version is {__version__}. Add this to the Changelog header.
The current version is {__version__}. Add this to the Changelog header. Never include dates or release status in the changelog entry.
Given the following git diff, generate a concise, well-formatted Markdown changelog entry:
Expand All @@ -35,7 +35,7 @@
temperature=0.3,
max_tokens=500
)
print (response)

changelog_entry = response.choices[0].message.content.strip()
print(changelog_entry)
with open('changelog_entry.md', 'w') as out_file:
Expand Down

0 comments on commit 77e96c4

Please sign in to comment.