Skip to content

Commit

Permalink
Merge pull request #112 from omnisat/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
hathbanger authored Oct 13, 2024
2 parents 3338377 + 928df5c commit db11ab4
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ jobs:
- name: Generate release notes with GPT
if: ${{ env.changed == 'true' && github.ref == 'refs/heads/main' }}
run: |
python3 scripts/generate_release_notes.py
python3 scripts/generate_release_notes.py ${{ env.new_version }}
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}

Expand Down
1 change: 1 addition & 0 deletions packages/lasereyes/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,4 @@ test
test
test
test
test
2 changes: 1 addition & 1 deletion packages/lasereyes/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@omnisat/lasereyes",
"private": false,
"version": "0.0.25",
"version": "0.0.26-rc.1",
"type": "module",
"main": "./dist/index.umd.cjs",
"module": "./dist/index.js",
Expand Down
6 changes: 5 additions & 1 deletion scripts/generate_release_notes.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
import openai
import os
import sys

# Get the OpenAI API key from environment variables
openai.api_key = os.getenv("OPENAI_API_KEY")

# Get the version from the script arguments
version = sys.argv[1]

# Read the git diff content from a file (generated in the GitHub Action)
with open('changes.diff', 'r') as f:
diff_content = f.read()
Expand All @@ -13,7 +17,7 @@
model="gpt-4",
messages=[
{"role": "system", "content": "You are a release note generator. Create detailed release notes based on the git diff provided."},
{"role": "user", "content": diff_content}
{"role": "user", "content": f"Version: {version}\n{diff_content}"}
]
)

Expand Down

0 comments on commit db11ab4

Please sign in to comment.